How to schedule a VM to start with linux?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
henriquelm
Posts: 5
Joined: 19. Aug 2009, 20:06
Primary OS: Ubuntu 8.10
VBox Version: OSE Debian
Guest OSses: Windows XP Pro SP2

How to schedule a VM to start with linux?

Post by henriquelm »

I would like to know if it's possible to schedule a virtual machine to start together with a linux server without the GUI?

If it's possible I would like to know how to do that.

Thanks
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: How to schedule a VM to start with linux?

Post by Sasquatch »

Just starting during or right after boot? Init script.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
virtualdisaster
Posts: 6
Joined: 5. Jun 2009, 13:06
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Solaris, Windows XP, Ubuntu Linux
Location: Texas
Contact:

Re: How to schedule a VM to start with linux?

Post by virtualdisaster »

Yeah on ubuntu you can use, (I think), /etc/rc.local and include any scripts you have. I feel it should be easy enough to do. I plan on writing some shell scripts to manage headless vbox instances which will include a way to auto start virtual machines.
"Have I become your enemy because I tell you the truth?" G 4:16
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Re: How to schedule a VM to start with linux?

Post by TerryE »

/etc/rc.local is not the best place, because you want to savestate any running VMs on shutdown as well. I have created a custom entry in /etc/init.d with the standard stop|start|restart|status option. The stop enumerates the running vms, records which are running and savestate's them. The start powers up any saved VMs using VBoxHeadless.

Use update-rc.d to add the entries to the /etc/rc.N directories.

OK, all of my normal VMs are headless LAMPs, but this does mean that I can just shutdown and restart my host without worrying about my VMs.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
virtualdisaster
Posts: 6
Joined: 5. Jun 2009, 13:06
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Solaris, Windows XP, Ubuntu Linux
Location: Texas
Contact:

Re: How to schedule a VM to start with linux?

Post by virtualdisaster »

I like the way you approached it but you still might want to add a feature for the "snapshot" feature so when a VM is running and you restart/stop host that it stops it cleanly. Isn't there a API for vbox-addons so that you can trigger scripts on the guest? Sorta like how vmware does it in virtual infrastructure. By the way would you mind sharing your finds? It seems like you have a pretty sweet setup that others could benefit from as well.
"Have I become your enemy because I tell you the truth?" G 4:16
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Re: How to schedule a VM to start with linux?

Post by TerryE »

Yup when we have the new VBox wiki opened, it's on the ToDo list of tutorials to write.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Post Reply