toptensoftware / VBoxHeadlessTray

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

Not shutting down under Windows 10 with VBox 5.1.4r110228 #22

Open adhawkins opened 7 years ago

adhawkins commented 7 years ago

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.

Onepamopa commented 7 years ago

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.

adhawkins commented 7 years ago

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.

mortis42 commented 7 years ago

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.

adhawkins commented 7 years ago

Can you point to any references for this proposed fix?

Thanks

Andy

apptaro commented 6 years ago

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

adhawkins commented 6 years ago

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

apptaro commented 6 years ago

@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.

adhawkins commented 6 years ago

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

apptaro commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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:

But after some restarts, the issue started happening again.

adhawkins commented 6 years ago

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.