ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Discussions about using Linux guests in VirtualBox.
Post Reply
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by fencekicker »

Hi,

I'm running Ubuntu 22.04 in VirtualBox 7.0.8 on Windows 10 21H2. Quite often after a screen lock (automatic after X mins or manual) and unlock, the VM gets stuck - it's completely unresponsive, I can't do anything in the VM, and ACPI shutdown does not work, so I have to force it off (Machine > Stop > Power Off). Ubuntu was installed directly in the VM (not updated from an older release), and is running Wayland. Any ideas on how to determine if this is coming from VirtualBox or Ubuntu / Wayland? I've attached the VirtualBox log. I hadn't seen this before with VirtualBox 6, though I don't think I had Wayland active in the old VM (it was an Ubuntu 22.04 updated from 20.04, possibly updated from 18.04).
Attachments
ubuntu-dev-vm2-2023-08-31-11-47-55.log
(111.27 KiB) Downloaded 63 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by scottgus1 »

The log is from a save-stated VM and wasn't taken after the VM was shut down. So much of the diagnostic data is missing.

Some form of Guest Additions appear to be installed, since the screen is resizing to non-standard sizes.

The VM is showing a lot of heartbeat flatlining. No idea why yet.

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 in Explorer/Finder/File Manager. In the "Logs" subfolder, zip the VM's "vbox.log", and post the zip file, using the forum's Attachments tab. (Configure your host OS to show all extensions so you can find the "vbox.log", not "vbox.log.1", etc.)

Also please set up a new VM of the same OS, see if it also has the same problem.
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by fencekicker »

OK, I'll try to see if I can reproduce this right after restarting the guest, and update in this thread.
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by fencekicker »

It looks like I was able to reproduce the issue. I left my desk for a while, and when returning, the VM screen looked like it was locked; I unlocked it and then it showed the previous screen, but I couldn't do anything, it was stuck. I powered it down forcefully. Attached the zipped VBox.log.
Attachments
VBox.zip
(39.68 KiB) Downloaded 50 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by mpack »

Do you have power saving enabled in the VM OS? If yes then disable it: let the host manage physical power.
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by fencekicker »

mpack wrote: 4. Sep 2023, 13:21 Do you have power saving enabled in the VM OS? If yes then disable it: let the host manage physical power.
Yes, actually it seems to be enabled in Ubuntu (I have Automatic Power Saved set to on, and also Automatic Suspend). The laptop had the power cable connected when the VM went into a hung state, though. I'll try to disable everything and see if that achieves anything.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by mpack »

fencekicker wrote: 4. Sep 2023, 14:05 The laptop had the power cable connected when the VM went into a hung state, though.
Power settings of the host do not transfer automatically to the guest - it's a separate PC. What would be relevent is whether the VM saw any user activity over the timed period.
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by fencekicker »

After disabling Automatic Power Saving in Ubuntu, I can report that the issue is still happening, without any suspend / resume as far as I can tell. Will take a second look at settings to see if there's anything else to disable. Attached the archived VBox.log.
Attachments
VBox.zip
Zipped VBox.log
(41.71 KiB) Downloaded 57 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by mpack »

This seems to be the important part of the log:
00:59:25.132160 Audio: Output channels = 0
01:13:59.976345 TM: Giving up catch-up attempt at a 867 843 959 781 ns lag; new total: 867 843 959 781 ns
01:13:59.976394 VMMDev: vmmDevHeartbeatFlatlinedTimer: Guest seems to be unresponsive. Last heartbeat received 869 seconds ago
01:13:59.979299 VMMDev: GuestHeartBeat: Guest is alive (gone 869 732 982 075 ns)
01:14:02.006922 NAT: DNS#0: 193.231.252.1
01:14:02.006956 NAT: DNS#1: 213.154.124.1
01:14:02.006966 NAT: DNS#2: 193.231.252.1
01:14:02.006982 NAT: DNS#3: 213.154.124.1
01:14:02.007028 NAT: dnsproxy: timeout: req 000001cc4f9616e0 dnsgen 0 != 1 on socket 932 (udp) exp. in -13 state=SS_ISFCONNECTED f_(addr:port)=10.0.2.3:53 l_(addr:port)=10.0.2.15:46569 name=0.0.0.0:63309
01:14:02.007107 NAT: dnsproxy: timeout: req 000001cc4f95f370 dnsgen 0 != 1 on socket 6140 (udp) exp. in -17 state=SS_ISFCONNECTED f_(addr:port)=10.0.2.3:53 l_(addr:port)=10.0.2.15:40435 name=0.0.0.0:63308
01:14:03.979555 VMMDev: vmmDevHeartbeatFlatlinedTimer: Guest seems to be unresponsive. Last heartbeat received 4 seconds ago
01:14:05.044561 NAT: dnsproxy: timeout: req 000001cc4ea3ec10 dnsgen 0 != 1 on socket 940 (udp) exp. in -2861 state=SS_ISFCONNECTED f_(addr:port)=10.0.2.3:53 l_(addr:port)=10.0.2.15:33439 name=0.0.0.0:63984
01:14:05.044655 NAT: dnsproxy: timeout: req 000001cc4ea3eb90 dnsgen 0 != 1 on socket 5572 (udp) exp. in -2861 state=SS_ISFCONNECTED f_(addr:port)=10.0.2.3:53 l_(addr:port)=10.0.2.15:50543 name=0.0.0.0:63983
01:20:12.819787 TM: Giving up catch-up attempt at a 369 035 940 095 ns lag; new total: 1 236 879 899 876 ns
01:20:12.854164 VMMDev: GuestHeartBeat: Guest is alive (gone 372 874 864 891 ns)
I don't actually know how Windows treats the lock screen. Is it also a power saving mode? From the above I'm guessing that it isn't a power saving mode as far as the host is concerned, however it still looks to me like the guest is triggered into entering a screen saver mode or a power save mode when the lock screen appears - it's set for 15 minutes inactivity, is that right?

You might want to look at section 10.24 in the user manual (Handling of Host Power Management Events), check if any of it applies.
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by fencekicker »

I don't know how Windows treats the lock screen either. I haven't found anything about a screensaver in the Ubuntu settings, the only thing I've found is something about "Blank Screen Delay", which is set to "Never". The only other timer that seems like it might hit is Automatic Suspend, it's set to kick on battery power after 20 minutes. My laptop is always plugged in, but this might still kick in, since right now the battery status is "Not charging" - either because the battery is not getting charged right now, or because Ubuntu's view of the battery status is wrong. I'll try to disable this setting next.

LE: I looked over that part of the manual (I found it under 9.24), my understanding of that section is that the VMs are paused when the Host suspends or is low on battery. I checked that setting (using 'VBoxManage getextradata global "VBoxInternal2/SavestateOnBatteryLow"') and it seems it's not set, so the default behavior applies.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by mpack »

I don't use Linux much so I don't know if "blank screen delay" refers to a screen saver or not. You'll appreciate however that a screensaver's purpose is to avoid burning the phosphor, this function is separate from power saving. VirtualBox shouldn't care about screen savers.

There must be power saving features in Linux otherwise it wouldn't run very well on battery powered devices.
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by fencekicker »

Investigated this a bit further, since the issue still reproduces.

I managed to get to a tty console (Ctrl+Alt+F3, for some reason F1 and 2 don't work nowadays), so it seems the OS is not stuck, just the UI. I suspect this might have something to do with Wayland, that's the default option when installing Ubuntu 22.04 from scratch. I'll ask about this on Ubuntu forums. Thanks for helping me out!
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: ubuntu 22.04 VM getting stuck after screen unlock (win10 host)

Post by fencekicker »

Posting here just to note that I found a bug in the VirtualBox database for what I think is the same (or a similar) issue: https://www.virtualbox.org/ticket/21539. There's no developer reply whatsoever, but maybe it helps for people not to log the same bug again.

The bug also points to an older thread on this forum: viewtopic.php?f=3&t=108794
Post Reply