Page 1 of 1
[Solved] Detect if running headless
Posted: 25. Jun 2018, 00:35
by luuk
Hi,
I am running a few Windows guest in headless mode (as build machines). I basically launch them from a Linux host in headless mode. A startup script on the Windows machines subsequently performs the app build. Question is; is there a way to detect on the Windows guest, if the guest has been started in headless mode vs normal mode?
I need to determine this as I need to perform an action within the script based on the mode I started the guest in.
Cheerio,
Luuk
Re: Detect if running headless
Posted: 25. Jun 2018, 11:39
by socratis
That's an interesting question. And the answer might be to parse the output of:
Compare the outputs for a normal vs. a headless start:
(Starting "normal")
...
Session name: GUI/Qt
(Starting "headless")
...
Session name: headless
Re: Detect if running headless
Posted: 26. Jun 2018, 00:39
by luuk
That assumes the 'VboxManage' command is available on the Windows guest. Which I believe it isn't.
The only command one might have avail on the Windows guest, through the guest additions ISO is vboxcontrol.exe. The latter doesn't provide any useful options to interogate what I need from the VM. Well I couldn't find any

Re: Detect if running headless
Posted: 26. Jun 2018, 01:24
by socratis
Oh, you want to know from the guest side, sorry...
You can set a property for the guest, if the guest has Guest Additions installed. See
4.7 Guest properties. If not, a shared file (like a flag) on a shared network location.
Re: Detect if running headless
Posted: 26. Jun 2018, 01:34
by luuk
Thanks, that might work indeed
I thought there would be a more straight forward way to get that info. But hey I should be able to get it to work that way.
Thanks again,
Luuk
Re: Detect if running headless
Posted: 26. Jun 2018, 01:52
by socratis
Glad to have helped. Marking as [Solved].
You're right though, the VBoxControl within the guest could be expanded to include all the information of the "VBoxManage showvminfo" from the host...