Page 1 of 1

Start a virtual machine from terminal

Posted: 26. Jun 2009, 13:03
by kennethe
Hey all

Anyone know if it is possible to start a virtual machine from terminal. The reason is that I want a (physical) server running with a base ubuntu server installation. On this server I want a virtual machine functioning as a FTP server (a Debian installation). If I want to remotely restart the ubuntu server, then I also want to be able to get the virtual FTP server going... All this I want to do through ssh (my server is not that power full, so I want avoid using the GUI)

Is this possible??

Re: Start a virtual machine from terminal

Posted: 26. Jun 2009, 13:31
by TerryE
Yup and their are lots of examples posted. The core to this are the VBoxHeadless and VBoxManage commands. There are two ways that I use and both have wrapper scripts. The first is to use nohup VBox... and the second is what I do for my LAMP VMs which I run headless which is to run an at job to run VBoxHeadless -s vmName -v off. My script uses the heredoc operator to allow me to pass the VM name as a parameter. On my todo list is a shutdown script which does a controlvm poweroff of running machines and then automatically restart them on the next startup.

Search the manual for the bold terms for more details.