VBoxHeadlessTray icon indicating copy to clipboard operation
VBoxHeadlessTray copied to clipboard

Not shutting down under Windows 10 with VBox 5.1.4r110228

Open adhawkins opened this issue 8 years ago • 12 comments

Since upgrading to VirtualBox 5.1 and the appropriate version of VBoxHeadlessTray, my machine no longer shuts down correctly. It appears that VBoxHeadlessTray may be retaining a COM connection to the VirtualBox API that is preventing this.

The window that appears when you try to shut down Windows 10 showing programs it's waiting for has an entry 'VirtualBox Interface' that is preventing the machine from shutting down.

If I close all instances VBoxHeadlessTray myself before shutting down, then the machine shuts down cleanly.

I may take a look at this myself to see if I can work out what's going on, but thought I'd report it to you in case you have a 'aha!' moment.

adhawkins avatar Aug 30 '16 07:08 adhawkins

I think this should be considered more of a "Feature" than a "Bug" - I personally like having something prevent me from shutdown/restart Windows while guests are running.

If this is considered a bug, then by all means - make it configurable.

Onepamopa avatar Sep 09 '16 14:09 Onepamopa

One of the whole points of VBoxHeadlessTray is that it should automatically save the state of any guests that are running when Windows is shut down. It has been this way ever since I have started using it. It's only recently that I've noticed it blocking Windows shutdown.

adhawkins avatar Sep 09 '16 15:09 adhawkins

I've had this happen many times before ever installing VBoxHeadlessTray.
This is a VirtualBox issue, I've had this problem for the last few VirtualBox updates. Only resolution I can find is to uninstall the VirtualBox network device, and reinstall.

mortis42 avatar Jan 18 '17 20:01 mortis42

Can you point to any references for this proposed fix?

Thanks

Andy

adhawkins avatar Jan 18 '17 20:01 adhawkins

@mortis42 I have the same issue, would you please share the resolution?

apptaro avatar Feb 13 '18 10:02 apptaro

I'm not sure it's just limited to VBoxHeadlessTray. If you load up the VirtualBox interface, then shut down the PC, I believe you get the same issue.

Haven't checked for a while, it's possible an update to VirtualBox has resolved this.

Andy

adhawkins avatar Feb 13 '18 10:02 adhawkins

@adhawkins For me, it only happens when I use VBoxHeadlessTray. If I use VirtualBox GUI to save state the machine and quit, VBoxSVC.exe terminates and Windows shutdown normally.

apptaro avatar Feb 14 '18 00:02 apptaro

If you try to shut down with the VirtualBox GUI still running then you see the same issue.

adhawkins avatar Feb 14 '18 11:02 adhawkins

@adhawkins No, if you try to shut down with the VirtualBox GUI still running, then you see the same issue only for some seconds, but the PC will shutdown normally afterwards. With VBoxHeadlessTray, it takes about 10 minutes for VBoxSVC.exe to terminates and then the PC can shutdown.

apptaro avatar Feb 15 '18 03:02 apptaro

Taken from here: https://doc.2cheren.com/virtualbox/ch12.html#idp15218336

In some cases - such as when a virtual machine is terminated unexpectedly - the COM server will not notice that the client is disconnected and stay active for a longer period (10 minutes or so) keeping the configuration files locked. In other rare cases the COM server might experience an internal error and subsequently other processes fail to initialize it. In these situations, it is recommended to use the Windows task manager to kill the process VBoxSVC.exe.

So, I would think that VBoxSVC.exe will hang around for about 10 minutes only when something have gone wrong. The same issue does not happen when I use VirtualBox GUI or VBoxVmService.

apptaro avatar Feb 15 '18 03:02 apptaro

For a note, I have fixed the issue temporarily by the methods below:

<Method 1> Uninstall virtualbox completely and reinstall. Ref: https://dottech.org/101997/how-to-uninstall-virtualbox-drivers-on-windows/

<Method 2> Do the combination of below for several times:

  • change IPv4 address of VirtualBox Host-Only Ethernet Adapter (File > Preferences > Network > Host-only Networks OR File > Host Network Manager)
  • starting and stopping the virtual machine with VBoxHeadlessTray and VirtualBox GUI
  • restarting Windows

But after some restarts, the issue started happening again.

apptaro avatar Feb 15 '18 03:02 apptaro

That suggests more that it's an intermittent issue, than you've 'fixed' it. I'll try to find time to do some tests on my machine here, and see if I can get it to happen using just VirtualBox apps. I'm pretty sure I could last time I tried it.

adhawkins avatar Feb 19 '18 16:02 adhawkins