Page 1 of 2
How do I auto starting a vm?
Posted: 20. Dec 2008, 17:00
by Ram
I'd like to have a vm auto start when my host is rebooted so I don't to login into my server and start it.
Is this possible?
I am running openSUSE11 with the 2.1 VB
Posted: 20. Dec 2008, 18:51
by stefan.becker
Yes, that is possible. Look into the Manual. Command "VBoxManage".
Posted: 20. Dec 2008, 22:26
by Ram
I've had a look in the manual, can't see anything to auto start a VM.
Posted: 20. Dec 2008, 23:14
by stefan.becker
Search manual for "startvm".
Posted: 21. Dec 2008, 00:22
by Ram
That only gives me command line options not auto start options.
Posted: 21. Dec 2008, 00:53
by stefan.becker
Write a Script, put the Comand in it and autostart the script via your distro.
There are sveral ways. In Example "/etc/rc.d/boot.local".
Posted: 21. Dec 2008, 01:00
by Ram
I was hoping there was easier way.
Cheers Stefan.
Ram.
Posted: 21. Dec 2008, 11:17
by stefan.becker
Not with VirtualBox.
Its a Desktop Product. Your Feature is more like a Server Feature. VMWARE Server can this for example.
Posted: 21. Dec 2008, 11:17
by s1oan
If you're asking for the command to start a vm, try this :
VirtualBox -startvm "name_of_the_virtual_machine"
Posted: 21. Dec 2008, 17:17
by Ram
Cheers but no, what I want is an auto (re)start of the VM if the server is rebooted. I don't wish to login to my host for it to run.
Posted: 21. Dec 2008, 20:37
by Sasquatch
For the start, put this in a script that is executed on boot, so it runs with root privileges.
Code: Select all
su -u <your username> VBoxHeadless -startvm <vmname> -p <vrdp port to listen to>
That should do it, but I can't give you a guarantee that it works. The VM will be accessible through RDP if you want. See VBoxHeadless --help for more info, and the manual too.
Posted: 22. Dec 2008, 21:38
by Ram
Cheers I'll give that a try once I've setup the VM as I need it.
Currently having a problem redirecting port 80 to the VM ( no hardware router )
Posted: 22. Dec 2008, 21:57
by TerryE
Again, it's a Q of reading the manual. You can't redirect ports <1000 on Linux. You need to use an alternative port eg. host:8080 -> guest:80 then browsing host:8080 will get you what you want as long as your guest web service uses site relative addressing.
Posted: 22. Dec 2008, 22:48
by Ram
Hi Terry,
I've seen the limitation in the manual. I'm trying to get the host to do the port forwarding.
Posted: 22. Dec 2008, 23:01
by Sasquatch
Still you can't redirect port 80. Some services, even your webbrowser, can rely on this port. Only use ports above 1000, as those are not on the stricktly used 'reserved' ports list.