VirtualBox freezes after Windows inactivity/sleep

Discussions related to using VirtualBox on Windows hosts.

VirtualBox freezes after Windows inactivity/sleep

Postby vb_user_6128 » 19. Jan 2021, 00:11

If VirtualBox (Ubuntu guest) is running on a Windows 10 Host and I leave my computer for a period of time, when I return the OS running within the VirtualBox GUI (Ubuntu in this case) will be completely unresponsive. The VirtualBox menu controls themselves are still responsive, however. The image displayed on the screen within VirtualBox is always in the exact state I left it. So far the only solution I've found is to keep clicking the red 'X' close button in the upper right corner of the VirtualBox window, which first causes a "Not Responding" message to appear on the VirtualBox window title bar and then closes the VirtualBox session. This problem just started occurring about a couple weeks ago. I am running Version 6.1.16 r140961 (Qt5.6.2).
vb_user_6128
 
Posts: 17
Joined: 15. Jan 2018, 23:54

Re: VirtualBox freezes after Windows inactivity/sleep

Postby scottgus1 » 19. Jan 2021, 03:55

Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show Log. Save the far left tab's log and the hardening log next to it, zip them, and post the zip file, using the forum's Upload Attachment tab.
scottgus1
Site Moderator
 
Posts: 11351
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VirtualBox freezes after Windows inactivity/sleep

Postby vb_user_6128 » 19. Jan 2021, 18:08

scottgus1 wrote:If not possible, close the Virtualbox window for the VM with the Power Off option set.


Can you clarify what you mean by "the Power Off option"?
vb_user_6128
 
Posts: 17
Joined: 15. Jan 2018, 23:54

Re: VirtualBox freezes after Windows inactivity/sleep

Postby scottgus1 » 20. Jan 2021, 18:22

When you click the Close box for the VM's window, a popup comes up with a few options on how to shut off the VM. One of those options is to power off the VM, essentially like pulling the plug on a computer.

This method is only used if you cannot shut down the VM's OS from the OS's normal Shut Down command.
scottgus1
Site Moderator
 
Posts: 11351
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VirtualBox freezes after Windows inactivity/sleep

Postby arQon » 25. Jan 2021, 10:38

I've been experiencing random-ish lockups on my VMs since at least 6.1.16, but unquestionably NOT ever happening prior to ... drat - "whatever I was running prior to 6.1.14", which I unfortunately can't determine any more. I'll see if I can figure it out from somewhere.

I'm not entirely confident that they coincide with suspending the host, since I'm often not using them for a while afterwards, but THIS one unquestionably was: just a couple of hours after updating to 6.1.18.

NOTE: Don't nag about the VM using 4 CPUs. Already tried it with 2 under 6.1.16 when investigating this a few days ago, so unfortunately that's not it. :(

The VM has had to be process-killed every single time. Attempting to close it via the VBox Manager only causes THAT to lock up too.
Attachments
vbox-lockup.7z
(17.93 KiB) Downloaded 5 times
arQon
 
Posts: 126
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: VirtualBox freezes after Windows inactivity/sleep

Postby fth0 » 25. Jan 2021, 16:56

arQon wrote:I've been experiencing random-ish lockups on my VMs since at least 6.1.16

When did you get the DELL U2415? ;)

In the brandi-2021-01-24-23-52-17.log file, after the resumption of the VM (around 03:05:25 or 2021-01-25T07:52:19Z), there is one DirectSound output device missing. A few possibly related problems have been reported by other VirtualBox users in the previous years, where monitors connected via HDMI exhibited problems with missing sound or hangs after host resumption, but I'm not sure if there was a solution.

arQon wrote:The VM has had to be process-killed every single time. Attempting to close it via the VBox Manager only causes THAT to lock up too.

If it happens again, please check if the VBoxSVC process is still running before and after the VirtualBox Manager locks up, and check (and/or post) the VBoxSVC.log file. Note that the log file could potentially reveal more about voluntary slaves. ;)
fth0
Volunteer
 
Posts: 1776
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: VirtualBox freezes after Windows inactivity/sleep

Postby arQon » 26. Jan 2021, 02:38

> When did you get the DELL U2415?

about 7 years ago. :)
It doesn't have speakers, which I'm guessing is what you're thinking, and it's connected via DP. Audio out is into proper speakers.

> If it happens again

It will: it may take a few days though.

> check if the VBoxSVC process

Will do. My bad: should have grabbed that one earlier too. Thanks.
arQon
 
Posts: 126
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: VirtualBox freezes after Windows inactivity/sleep

Postby fth0 » 26. Jan 2021, 03:19

arQon wrote:It doesn't have speakers, which I'm guessing is what you're thinking, and it's connected via DP. Audio out is into proper speakers.

Good guess, and I didn't think about a monitor without speakers but with an audio out socket. ;)

In the brandi-2021-01-24-23-52-17.log file, search for all log messages containing "Audio:", then you'll see what I've been talking about. The monitor is not off the line of fire yet. ;)

Regarding the VBoxSVC.log file, the last 10 are kept, so the information is possibly still available.
fth0
Volunteer
 
Posts: 1776
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: VirtualBox freezes after Windows inactivity/sleep

Postby arQon » 26. Jan 2021, 03:35

To be clear, i meant "Audio out is into proper speakers", from the mobo. I don't think there's any audio support of any type on the monitor itself.
I can't stop Windows incorrectly considering the monitor to be an audio-out device, unfortunately.

So, 6.1.18 didn't survive even a single suspend, again. The service was still running, and my guess is THAT'S fine, since once I kill the VM and Manager I can restart both before the service shuts down and have everything work fine again.

I'm probably going to have to revert to at least .14 for a while: the hang rate on .16 was "often enough to be annoying", but the rate on .18 is over 50%, and that's just not practical. (Infuriatingly, that means I'm stuck with .14's sound bugs after host suspend, where dis- and re- enabling audio generally doesn't work, but it's a small price to pay). I'll keep .18 around to try things with, but it's way too broken for me to use on a daily basis.

As you say, the audio code (not the monitor itself) may well be the cause of the lockup, since that broke HARD a few revisions ago. I may try running the VM with audio out disabled and see if that helps.
arQon
 
Posts: 126
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: VirtualBox freezes after Windows inactivity/sleep

Postby fth0 » 26. Jan 2021, 04:36

arQon wrote:I don't think there's any audio support of any type on the monitor itself.

If we're not speaking about different variants of your monitor, it should have an audio out socket (as described in the manual). If this audio out socket has no automatic plug recognition, and if the monitor is not configured otherwise, then it advertises its DP Audio capability to the PC. This would be consistent with the VirtualBox enumeration of the DirectSound devices.

If you have the possibility to use a remote desktop solution to access your host, you could try to reproduce the problem without the monitor (it must not be connected at any time from the host power on). Of course, those are only suggestions I'd try myself, you don't have to jump through hoops for me. :)
fth0
Volunteer
 
Posts: 1776
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: VirtualBox freezes after Windows inactivity/sleep

Postby arQon » 27. Jan 2021, 06:34

> it should have an audio out socket

You are correct - though I needed a torch and some contortions to find it. :)
The OSD doesn't offer any way to disable it. I could try removing the AMD Audio driver though, but, see below...

So, hrm. I'll have to ponder that for a bit: unfortunately, I don't have any suitable machines to RDP into it from, and I suspect the bug is in the DSound code specifically, since that's been pretty hopelessly broken for as long as I've been on the 6.1 branch, so booting it into Linux and ssh-ing in is unlikely to gain any insight.

I can't remember if DSound has the same "resource lost" behavior as D3D, but if so, whatever's trying to recover from that seems the likely cause of this lockup.

> I may try running the VM with audio out disabled and see if that helps.

That was a fit of stupidity. What I MEANT was "with *DS* disabled", i.e. either the null driver or Audio disabled entirely, duh. But since I was in a hurry and not thinking clearly, what I DID was just disabled the Audio Out as I'd originally written. As usual, the VM locked up on the next sleep, and I reverted to 6.1.14.
6.1.16 had what I assume is the same bug, but would generally survive a week or so of getting suspended half a dozen times a day before it locked up. 6.1.18 has, I think, NEVER survived even a single suspend. So at least it's easy to test stuff: I wish all the bugs in my code over the decades had been so reproducible... :P

So, that's what I SHOULD have done, and if that did work, removing the ATI Audio driver (assuming W10 (a) actually lets me, and (b) doesn't then immediately reinstall it behind my back) would have been a good next step.

One thing I DIDN'T do is revert the GAs too, since that gives me another piece of information - and so far, the 6.1.18 GAs and the 6.1.14 core binaries hasn't locked up yet. It's only been suspended a handful of times, but given the hang rate of 6.1.18 that's still enough to say fairly confidently that the bug is in the binaries rather than the GAs.

I'm going to have to wait a while before I can try .18 again: that's too crashtastic to really leave installed at all, so I'll need a big enough window to run all the tests and then revert again. Will try to get to it this weekend though.

sidenote: I had a look at the VBoxSVC logfiles, but I don't see anything interesting in them (or much of anything at all, in fact).

Cheers.
arQon
 
Posts: 126
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: VirtualBox freezes after Windows inactivity/sleep

Postby fth0 » 27. Jan 2021, 18:18

arQon wrote:I needed a torch and some contortions to find it. :D

I learned once that a smart phone with its front camera can be a really useful tool. Or an old school makeup mirror. ;)

Your sound strategy sounds good to me (pun intended ;)).

The physical Audio devices, the Windows DirectSound device drivers, the VirtualBox DSoundAudio driver, the VirtualBox AC97 device, the Linux guest audio drivers, and the user form a long, bidirectional chain of commands and actions. Using the Null Audio Driver and unchecking Enable Audio are two good tests for the beginning, cutting the chain in half. I'd suggest to try both, although I don't know what's the real difference, and save the VBox.log files.

According to the VirtualBox 6.1.18 changelog, there were changes regarding audio playback after host sleep/resume.

If you have worked out an easy method to reproduce the problem, you could try to create a VBox.log file with more logging, using the Windows equivalent of the following Linux bash commands:

Code: Select all   Expand viewCollapse view
# Audio
export VBOX_RELEASE_LOG+="+DEV_AC97.e.l.f"
export VBOX_RELEASE_LOG+="+DEV_HDA.e.l.f"
export VBOX_RELEASE_LOG+="+DEV_HDA_CODEC.e.l.f"
export VBOX_RELEASE_LOG+="+DRV_HOST_AUDIO.e.l.f"
export VBOX_RELEASE_LOG+="+DRV_AUDIO.e.l.f"
export VBOX_RELEASE_LOG+="+AUDIO_MIXER.e.l.f"

# Thread name, log group, log level
export VBOX_RELEASE_LOG_FLAGS+=" thread group flag"

# Start VM
VirtualBoxVM --startvm "VM" &

arQon wrote:I had a look at the VBoxSVC logfiles, but I don't see anything interesting in them (or much of anything at all, in fact).

The timestamps of the files could also indicate crashes of the VBoxSVC service. If you're adventurous, you can kill the VBoxSVC service and see what it does to the running VM and the VirtualBox Manager. ;)
fth0
Volunteer
 
Posts: 1776
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: VirtualBox freezes after Windows inactivity/sleep

Postby arQon » 5. Feb 2021, 05:11

Didn't get to it last weekend, but managed to test a few things tonight.

First off, I created a new VM and tried that, and that actually survived a suspend. That also potentially removes any HW-related aspects from the problem. So that's progress. :)

I diffed the XML, and the new one has:
<AudioAdapter codec="AD1980" driver="DirectSound" enabled="true" enabledIn="false"/>
while the one that hardlocks has:
<AudioAdapter driver="DirectSound" enabled="true" enabledIn="false"/>

That seemed worth a shot, but didn't help: the old VM still hardlocks on resume.

So then I tried what I'd originally planned, i.e. disabling Audio completely for the old VM. Suspend, resume, VM NOT frozen, for the first time ever on 6.1.18. So that's more progress.

I think it's PROBABLY safe to say that the 6.1 audio code is just still broken in some (or several) ways, but that doesn't resolve the fact that the new VM DOES work correctly. (And the new one, unlike 6.1.14 and 6.1.16 does actually manage to get the audio working on its own after a resume, without needing the disable/re-enable hack).

The new VM is on the 5.0 kernel, since it was installed from an 18.04.3 image which has HWE active. The original VM is still on 4.15. That's one of the easier pieces to try, so I'll do that second-next. Before that though, I'll just point the new VM at the old VDI and see what happens, since that's even easier.
arQon
 
Posts: 126
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: VirtualBox freezes after Windows inactivity/sleep

Postby arQon » 5. Feb 2021, 07:21

> Before that though, I'll just point the new VM at the old VDI and see what happens, since that's even easier.

Hard lockup again.

I thought I'd try one last thing before jumping to the HWE kernel, and switched the VM from AC97 to HDA. Suspend, resume... DIDN'T lock up!

This is definitely NOT the full answer to the problem though, since the new VM also defaulted to AC97, and that didn't lock up even with those settings. I'm about out of time for this round of experiments (sorry I didn't get as far as your extended logging), but to summarize the story far:

* The fresh VM with a newer (5.0) kernel and AC97 seems fine.
* An old VM on an older (4.15) kernel and AC97 hardlocks 100% of the time.
* The same old VM, still on 4.15 but using HDA has survived 3 of 3 suspends.

I'll see what happens if I switch the old VM back to AC97: if that suddenly starts working, the bug has to be triggered by something in the XML. If it locks up again (which is what I'm expecting) then it's likely to be the AC97 emu specifically. For now though, I'll leave it at HDA and see if it continues to behave over the next few days.
arQon
 
Posts: 126
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: VirtualBox freezes after Windows inactivity/sleep

Postby fth0 » 5. Feb 2021, 14:53

Regarding the XML files and differences, did you check the SettingsVersion?
fth0
Volunteer
 
Posts: 1776
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Next

Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: No registered users and 13 guests