Monday, April 21, 2014

How to Autostart a headless Virtual Machine Guest in Oracle Virtualbox on a Windows host


Create a text file with .bat extension containing the following line. Let's call it autostart_oracle_vm.bat

C:\Program Files\Oracle\VirtualBox\vboxheadless.exe --startvm MYVM

Now create a text file with the extension .vbs with following content, let's call this autostart_oracle_vm.vbs

Set oShell = CreateObject ("Wscript.Shell") 
Dim strArgs
strArgs = "cmd /c D:\autostart_oracle_vm.bat"
oShell.Run strArgs, 0, false

Now add a short-cut to autostart_oracle_vm.vbs in the following location

C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup