Virtualbox Start VM Headless on Windows

If you use

vboxmanage import ovffile.ovf --dry-run

you will get a report telling you what configuration is going to be applied when the import is actually done. You'll also get advice on how to make changes if required.

As to running vboxheadless detached from a command line and a window it's not as straightforward as you may think. A simple

start /b vboxheadless -s vmname

appears to work in that it detaches from the command line but if you close the window the child process dies too and the 'power cord' is pulled from your vm.

To solve this use a small vbs script test.vbs

Set WshShell = WScript.CreateObject("WScript.Shell")
obj = WshShell.Run("c:\temp\test.bat", 0)
set WshShell = Nothing

My test.bat

@echo off
vboxheadless -s vmname

This is pretty old post but I spent a lot of time looking for this

Here's what I use

VBoxManage.exe startvm "myvm" --type "headless"

And to stop it

VBoxManage.exe controlvm "myvm" savestate 

or poweroff

I have put these in the Widows 7 task scheduler so it starts and stops with Windows.

Start:
Trigger at start up

Shut down:
Trigger on an Event

System event:
Source User32
Event ID 1074

The one issue I have found with this is if the IP changes it becomes difficult to figure out the right IP address.