toptensoftware / VBoxHeadlessTray

Run a VirtualBox machine in a tray icon
180 stars 23 forks source link

Go headless saves state instead #31

Open cableghost opened 4 years ago

cableghost commented 4 years ago

When I use the option 'Go headless', it saves the machine state and does not put it into headless mode.

This is without Snapshots. I've tried by opening the machine via GUI first, Power Up, etc.

Virtualbox Version 6.0.12 r133076 (Qt5.6.2)

toptensoftware commented 4 years ago

Saving the state of the machine is the first step in switching the machine to headless mode. After that it's supposed to launch VBoxHeadless.exe and reload the state. VBoxHeadless.exe is a program included in VirtualBox and called by VBoxHeadlessTray.

I just did some quick tests here and while it seemed to be basically working, a couple of times I did see a crash in VBoxHeadless.exe.

I wonder if that's what's happening for you. Perhaps check the system application event log and see if there's anything indicating that's happening. That would explain why the machine doesn't end up in headless mode.

Another thing to check... after it fails to go to headless mode, if you bring up the main VirtualBox Gui that lists out the machines, does it display it in an aborted state? That too would indicate VBoxHeadless failed to launch correctly.

If this is a crash in VBoxHeadless then almost certainly this is a bug in virtual box.

cableghost commented 4 years ago

Thanks for the explanation of how it functions. I've ran the below several times, rebooting the host along the way.

For Windows-based clients...if client is in a Saved or Powered Off State, I can use VBoxHeadlessTray/Power Up to place client in headless mode, or at least the window is not opened. If client is already open and I attempt to use 'Go Headless', client is placed in Saved State, and does not appear to attempt being placed in Headless Mode...no Abort indication, and I do not see any issues in Event Viewer, though I may be looking in the wrong section (Winevt\Logs\System).

For my HASSIO-based client...Go Headless function works as expected...places client in saved state, then places it in headless mode, and shows it as 'Running'.

Here's another oddity...when client is placed in Headless Mode via VBoxHeadlessTray from a Saved or Powered Off State, when I then attempt to 'Show' it via the VB GUI, a blank window appears. I need to select the 'Send shutdown signal', then the client window reappears. This does not occur if client is placed in Headless Mode via VB GUI...the window opens normal.

cableghost commented 4 years ago

Based on the last part of my previous reply, it sounds like the 'Power Up' function is supposed to open the client window. This is why when using the 'Show' commend in the VB GUI, a blank window is presented...VB already thinks the client window is open.