Headless VirtualBox

Send to Kindle

VirtualBox

I tend to create a lot of proofs of concept, be it applications or servers, and this process will usually start with spinning up a VM. For this I prefer to use Oracle’s VirtualBox mainly because it’s free and easy to use.

However, using VirtualBox each time I want to start and stop the VM isn’t great as it will open up the VM in a new window and you need to have both the VM window and VirtualBox running on your machine at the same time.

Luckily you can use the “start” command to run VirtualBox’s VBoxHeadless application to boot up a VM without starting VirtualBox itself and without having a window open, other than the command line.

start "Build Server VM" /D"C:\Program Files\Oracle\VirtualBox\" /MIN VBoxHeadless.exe --startvm "Server 2008 32"

Just make sure the name of the VM at the end of the command is the same as that within VirtualBox:

VirtualBox dashboard

You can then access this via RDP (if your VM is windows) or SSH (if it’s Linux), as can anyone else on your network, should you have configured its network settings correctly.

Installing Vagrant on Windows

Send to Kindle

If you’d like to get into pro levels of VM administration and fancy giving Vagrant a go on your Windows machine, be careful with the install; if you’re running 64 bit Windows you have to use a different Ruby installer to the usual one!

Related installation errors:

  • fatal error: ffi.h: No such file or directory
  • ERROR: Failed to build gem native extension
Go back to top