Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Jan 17 '13 at 16:28

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

add comment

1 Answer

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
add comment

Your Answer

 
discard

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.