Home » Questions » Computers [ Ask a new question ]

Run a VM on Virtual Box on a headless Debian machine

Run a VM on Virtual Box on a headless Debian machine

I have a headless Debian server which I have installed Virtual Box on. From there, I would like to run a VM, but, without something like KDE, I have no idea how to start up the VM from the shell, and boot it up when the server does.

Asked by: Guest | Views: 226
Total answers/comments: 1
Guest [Entry]

"The command you're looking for is

VBoxManage startvm ""VirtualMachineName""

That does assume the software is installed and your virtual machines are in the correct directory.

To make it start on boot, you could do something like an init.d script. You can do that by copying one of the existing ones, editing it to your liking (you might also want to add a stop/shutdown function to turn the VM off before you turn the host machine off), and then register it with the OS using the command

update-rc.d VMControl defaults

This assumes your file is located at /etc/init.d/VMControl, and you have made it executable (chmod 775 ./VMControl).

Hope that helps."