Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using windows on a virtual box in ubuntu.Is there anyway to automatically start windows in the virtual box when ubuntu boots and when i shut down the windows in virtual box , i want ubuntu to shut down. Any ideas how do i go about it.

share|improve this question

migrated from Jan 17 '13 at 16:28

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

Note : This works on many Linux distro not only Ubuntu

You have to create init shell script for VirtualBox management. You have to know :

  • The command (which absolute path) which start your VirtualBox
  • The command (which absolute path) which stops your VirtualBox

Then go to /etc/init.d/, copy the skeleton script to "virtualBox" and edit it to use start and stop commands.

You can test your virtualBox script using "./virtualBox start" and "./virtualBox stop".

Once ready, activate scripts in the right directories :

update-rc.d virtualBox defaults

At this point, "virtualBox start" will be automatically called on boot, and "virtualBox stop" automatically called on halt and reboot.

To remove it

update-rc.d -f virtualBox remove

There should be other solutions with the newer "upstart" wrapper.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.