0

Run VirtualBox VM via Powershell

Today I wanted to be able to create a shortcut on my desktop that would allow me to run a virtualbox vm when it was double clicked on. I had approached this before when trying to get my dev server to load in headless mode.

To run a VM in headless mode create a .PS1 file with the following contents:

start-process 'C:\Program Files\Oracle\VirtualBox\vboxheadless' '-s <vmname>' -WindowStyle Hidden

To run a VM in full GUI mode create a .PS1 file with the following contents:

start-process 'C:\Program Files\Oracle\VirtualBox\vboxmanage' 'startvm <vmname>'

Remember to modify your Program Files path if running on a 32bit operating system. Also replace <vmname> with the name of your VM being careful to ensure that you copy the name of the VM from the list in VirtualBox exactly.

Jason Edwards