Windows – Virtualbox Start VM Headless on Windows

headlessvirtualboxwindows

Oracle VirtualBox on Windows

Hi All,

Is there a way to start a vm headless (vboxheadless -s ) but one can close that command window or if I add that as a startup item will that make it run silent ?

I have successfully exported a appliance (linux vm), when I will do the batch import will it retain the settings I had configured originally or will one would have to assign bridged adapter, amount of ram, etc ?

will be grateful for your suggestions !
Kind Regards

EDIT :
Iain, if one wants to script the GuestAdditions install on first boot in a CentOS VM, shall I just put the commands ./VBOXLinux-x86-additions.run to the bash script and it will run at startup, any thoughts on this would be really helpful.

Kind Regards

Best Answer

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