Starting VirtualBox VMs from an Icon or CLI
I get an amazing number of hits (relatively speaking) from Google searches for VirtualBox related information. One of the more frequently recurring search goals is for a way to start a Virtual Machine (VM) from an icon or shortcut as opposed to through the VirtualBox Management Interface.
Well, it’s pretty easy really – at least on Linux, and from what I can gather it’s similar on Windows too. The commands below are from an Ubuntu Linux host so case is important; and the quotes are too! I am not sure about M$ – don’t tend to use it much đŸ˜€ – but it will probably be a similar syntax just case-insensitive.
Basically the command you need is:
VBoxManage startvm "Your Machine Name"
On my system I have a few VMs for testing various things. I have one, for example, called “Ubunty Hardy” as you can see from this screen-shot of the management console.
(The machine name to pass to the VBoxManage startvm
command is the text in bold)
To start the Ubuntu Hardy Virtual Machine from the command line I would simply use VBoxManage startvm "Ubuntu Hardy"
.
Similarly, to start the WinXP vm, I would need to type: VBoxManage startvm "WinXP"
.
So, it should be obvious by now that to create a desktop icon, panel button and the like to start a VM, or to start one automatically during boot-up for example, you just need to use the appropriate command-line instruction in your script, icon configuration or shortcut.
There are a great many parameters that can be given to the VBoxManage utilty. Running it without any switches gives a brief yet comprehensive overview. The VirtualBox documentation pages have plenty more details.
Hope this helps the many Googlers out there.
Tags: Ubuntu, VirtualBox
thanks alot for this
Yeah, like the man page says. What I’d like to know is how to start a VM without a “monitor” device. I don’t want or need a virtual monitor. More accurately, I want a headless VM. I don’t know if Virtualbox can do this.
Answering my own question:
VBoxManage startvm vmname -type vrdp
But it only works with the non-OSE version. Oh well, I guess it’s KVM then. I wanted to have portability between hosts.
Hey here I am not sure what you wanted to do exactly but check this link maybe it will help
http://www.howtoforge.com/vboxheadless-running-virtual-machines-with-virtualbox-2.0-on-a-headless-ubuntu-8.04-server
I have not tried the above howto but im planning some time in the future when I have time. Keep me updated if you can on your progress