Ubuntu 24.04 freezes everyt time after 10 minutes or less after boot

Discussions related to using VirtualBox on Windows hosts.
Post Reply
abcuser
Volunteer
Posts: 595
Joined: 10. May 2007, 20:03
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu, Windows XP

Ubuntu 24.04 freezes everyt time after 10 minutes or less after boot

Post by abcuser »

Software:
- host: Windows 11 with latest updates
- VirtualBox 7.0.14
- guest: Ubuntu 24.04

I start up guest and it works fine until e.g 10 min or less and in Ubuntu freezes all windows and all windows are non-clickable. Work-around is power-off virtual machine and reboot the Ubuntu. Freeze happens every time 10 min or less after Ubuntu boots.

This is pretty much useless, I can't afford to reboot Linux every 10 min and lose all unsaved work.

I am attaching Virtualbox log files is someone see something there.

I am only using default NAT network in Ubuntu guest, is it safe to install VirtualBox 7.0.16? Is this maybe a solution?

EDIT:
1. All this freezes happens on default Wayland session. I tried to use x.org at Ubuntu login, but login is immediately returned to login again, so x.org does not work on my laptop at all.
2. I have written simple one liner that I execute in terminal: while true; do date; sleep 1; done
that displays current time every second and I see when freeze appears that no new time is displayed, so I am pretty sure whole Ubuntu freezes instantly.
Attachments
VBoxSVC.log
(11.27 KiB) Downloaded 14 times
VBox.log
(234.56 KiB) Downloaded 7 times
multiOS
Volunteer
Posts: 871
Joined: 14. Sep 2019, 16:51
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: WIN11,10, 7, Linux (various)
Location: United Kingdom

Re: Ubuntu 24.04 freezes everyt time after 10 minutes or less after boot

Post by multiOS »

First, you need to deal with these issues:
00:00:03.724135 HM: HMR3Init: Attempting fall back to NEM: AMD-V is not available
00:00:03.817848 NEM: info: Found optional import WinHvPlatform.dll!WHvQueryGpaRangeDirtyBitmap.
00:00:03.817862 NEM: info: Found optional import vid.dll!VidGetHvPartitionId.
00:00:03.817865 NEM: info: Found optional import vid.dll!VidGetPartitionProperty.
00:00:03.817940 NEM: WHvCapabilityCodeHypervisorPresent is TRUE, so this might work...

0:00:03.818914 NEM: Adjusting APIC configuration from X2APIC to APIC max mode. X2APIC is not supported by the WinHvPlatform API!
00:00:03.818916 NEM: Disable Hyper-V if you need X2APIC for your guests!
00:00:03.819111 NEM:
00:00:03.819111 NEM: NEMR3Init: Snail execution mode is active!
00:00:03.819111 NEM: Note! VirtualBox is not able to run at its full potential in this execution mode.
00:00:03.819111 NEM: To see VirtualBox run at max speed you need to disable all Windows features
00:00:03.819111 NEM: making use of Hyper-V. That is a moving target, so google how and carefully
00:00:03.819111 NEM: consider the consequences of disabling these features.
00:00:03.819112 NEM:
00:00:03.819175 CPUM: No hardware-virtualization capability detected
Please see: viewtopic.php?t=99390 for forum guidance on the options and actions you can take.

Notes:
1. AFAIK full Wayland support in VirtualBox is still 'in development', so you may still need to try running with 'X11' or 'X-Wayland' if you still experience problems.

2. The VBox.log appears to be incomplete. If you need to submit logs in future please create 'zip' files to ensure they remain within the forum's attachment size limit.
abcuser
Volunteer
Posts: 595
Joined: 10. May 2007, 20:03
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu, Windows XP

Re: Ubuntu 24.04 freezes everyt time after 10 minutes or less after boot

Post by abcuser »

@multiOS, holly molly. Thanks a lot. Problem fixed with turning off Hyper-V from instructions you provided.

TL;DR
I didn't know for green turtle and I am using VirtualBox like a decade or more... Why the hack is icon "green". Green colour is usually used to indicate "perfect state" without a problem. Why isn't icon red turtle instead or some warning launched when virtualbox guest is fired up? Holly molly what a surprising design.

BITLOCKER RECOVERY KEY WINDOW
To the point. I have followed tutorial you provided and performed tasks to turn off Hyper-V and rebooted Windows 11 host. At some point (I forgot now what was actual settings, because I did this three days ago) after Windows host reboot I have got a "Bitlocker Recovery Key" window, so tutorial suggestions may not be innocent, but pretty dangerous, if someone loses or not properly saves the Bitlocker Recovery Key. I have finally got my Bitlocker Recovery Key from company system administrator that has a collection of all of the recovery keys stored in safe place and then Windows successfully booted. Pretty nasty I was required to contact sysadmin.

ALL SETTING TRIED
Then I did one after another step, did all of the settings... all of them... then in my Lenovo laptop's BIOS disable "Memory protection" and save. Back to BIOS and executed build-in battery shutdown. Nothing worked and I have followed tutorial twice. What ever I did, I always got green turtle when I started virtual machine. I gave up... nothing worked. I have powered-off the Windows host on laptop and today after three days I powered laptop again, started Windows host and started Virtualbox GUI and started Ubuntu virtual guest and I wanted to do another try, but to my surprise I no longer see green turtle, but instead blue background icon with "V" in it. It looks like I have got rid of Hyper-V. I really don't know now what was deciding thing I did the last time...

ALL LOOKS FINE NOW
I have now been using Ubuntu guest for 2 hours and without any freezes, it looks like Hyper-V was the problem in my case.

NOT THE BEST EXPERIENCE
I know this is a "feature" of Hyper-V, but it would be very nice if VirtualBox at guest boot time displays any warning or something, that Hyper-V is messing with VirtualBox and some checking would be nice, what is turned on on Windows host that makes the trouble. You know better user experience. I assume most of the Windows users gets into this trouble sooner or later and may uninstall VirtualBox instead of solving the problems. The first thing to do should be get rid of "green" icon, set the "red" icon and when clicked on red icon display proper help what is wrong, what setting should user set on Windows to solve the problem.
multiOS
Volunteer
Posts: 871
Joined: 14. Sep 2019, 16:51
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: WIN11,10, 7, Linux (various)
Location: United Kingdom

Re: Ubuntu 24.04 freezes everyt time after 10 minutes or less after boot

Post by multiOS »

Well done, you've solved the puzzle: If the Blue V icon shows that is the indicator that VirtualBox has direct access to hardware virtualisation and therefore should be able to provide the best performance. The Green Turtle (moves slowly on land), was introduced with the release of VirtualBox 7.0 and indicate that VirtualBox is having to use the Host's Hypervisor which can (and often does) result in a dramatic slowdown in VM performance. The main thing to watch for is any icon change after Windows Host updates, which can sometimes activate their own Hypervisor.

I would guess that part of the challenge in providing more explicit and consistent visible warnings when another active hypervisor is present and may impact on performance is variation in that impact where, due to the cross-platform nature of VirtualBox Host Systems, performance may not always be affected to the same extent. i.e. I have one Windows laptop on which (somewhat unusually) VirtualBox VMs often run without any obvious slowdown even when the Green Turtle indicates Hyper-V is active, so some effects may be affected by the host hardware. macOS also now forces the use of it's own hypervisor by 3rd party virtualisation software and can't be 'switched off', so the Green Turtle and VBox.log warnings are always present, but there does not appear to be any significant negative impact on VirtualBox VM performance; and macOS even allows multiple 3rd-party virtualisation applications to be active at the same time; and then, of course, the virtualisation options are again different on 'Linux' Hosts, so can have different requirements - generally they can co-exist with VirtualBox, but must not be active when VirtualBox is in use.
ehasis
Posts: 2
Joined: 19. Sep 2012, 16:52

Re: Ubuntu 24.04 freezes everyt time after 10 minutes or less after boot

Post by ehasis »

I was having the same issue, after few tweaks when I disabled the Drag & Drop feature it stopped to freeze.
Lazo007
Posts: 4
Joined: 13. Feb 2021, 23:13

Re: Ubuntu 24.04 freezes everyt time after 10 minutes or less after boot

Post by Lazo007 »

Dear team,

I am experiencing the same issue. I have installed the latest version of the VirtualBox 7.0.18 and Ubuntu 24.04 Desktop as a Guest (the host is Windows 10 but I do not think it is relevant in this case). The latest version of the VBox extensions was installed within VM Guest as well.

When I boot Ubuntu 24.04 guest, it takes 2-3 minutes until the VM machine freezes completely. It seems (it is fact actually as described below) as if the operating system halts. Nothing can be done within the virtual machine, the only option is to forcibly shut it down by closing its window (using the standard "X" button on the top-right window corner).

So, I enabled kernel debugging within the virtual machine, configured named pipes where kernel log is published, and connected Putty over named pipes from the Host to capture kernel logs until the machine freezes. I have attached this log below. What I can see from the kernel log is that there is a kernel exception from the vmwgfx driver that halts the virtual machine:
...
[   94.057222]  ? vmw_du_cursor_plane_atomic_update+0x1d3/0x270 [vmwgfx]
[   94.058979]  drm_atomic_helper_commit_planes+0x2b2/0x370
[   94.060839]  drm_atomic_helper_commit_tail+0x49/0x90
[   94.080913]  commit_tail+0x11f/0x1b0
[   94.082573]  ? __schedule+0x284/0x6b0
...
BTW, I have disabled 3D Acceleration for the VM machine.

I searched the web and found a few "indirect" hints from the past where a defect within the same driver was causing issues on VirtualBox. So maybe it can help to narrow down the issue.

BTW, I have 100% repro for this issue. All I need to do is boot into Ubuntu Desktop 24.04 (GNOME), open File or Text Editor, move it on the screen, and maybe wait 2-3 minutes and the machine is halted. Ubuntu Server 24.04 installed as a guest without any graphical components works flawlessly so I would bet the issue is caused by the graphics subsystem/driver as captured above.

Hope this may help.
Petr
Attachments
VBox-Kernel-Log.txt
This file was produced by running sudo dmesg -w command in the putty connected to virtual machine over named pipes. It is captured kernel log.
(102.54 KiB) Downloaded 1 time
VBox.zip
This file is content of the Log directory of the failed virtual machine.
(184.02 KiB) Downloaded 1 time
multiOS
Volunteer
Posts: 871
Joined: 14. Sep 2019, 16:51
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: WIN11,10, 7, Linux (various)
Location: United Kingdom

Re: Ubuntu 24.04 freezes everyt time after 10 minutes or less after boot

Post by multiOS »

I am not surprised you have the same issue as your VBox.log reports the same performance obstruction pointed out to the OP:

i.e.
00:00:06.298508 ********************* End of CFGM dump **********************
00:00:06.298676 HM: HMR3Init: Attempting fall back to NEM: VT-x is not available
00:00:06.313074 NEM: info: Found optional import WinHvPlatform.dll!WHvQueryGpaRangeDirtyBitmap.
00:00:06.313084 NEM: info: Found optional import vid.dll!VidGetHvPartitionId.
00:00:06.313087 NEM: info: Found optional import vid.dll!VidGetPartitionProperty.
00:00:06.313133 NEM: WHvCapabilityCodeHypervisorPresent is TRUE, so this might work...

00:00:06.314405 NEM: Adjusting APIC configuration from X2APIC to APIC max mode. X2APIC is not supported by the WinHvPlatform API!
00:00:06.314408 NEM: Disable Hyper-V if you need X2APIC for your guests!
00:00:06.314556 NEM:
00:00:06.314557 NEM: NEMR3Init: Snail execution mode is active!
00:00:06.314557 NEM: Note! VirtualBox is not able to run at its full potential in this execution mode.
00:00:06.314557 NEM: To see VirtualBox run at max speed you need to disable all Windows features
00:00:06.314557 NEM: making use of Hyper-V. That is a moving target, so google how and carefully
00:00:06.314557 NEM: consider the consequences of disabling these features.
So, your VM is running, but extremely slowly; and the advice has to be to follow the guidance in the link already provided in response to the original posting.
Lazo007
Posts: 4
Joined: 13. Feb 2021, 23:13

Re: Ubuntu 24.04 freezes everyt time after 10 minutes or less after boot

Post by Lazo007 »

Thank you very much for your response.

My context is that I am using WSL also so I am trying to avoid turning of Hyper-V on and off every time I would like to switch virtualization platforms. I am aware that Hyper-V creates challenges for virtualization software like VirtualBox. My confusion is that I am able to run previous Ubuntu versions on VirtualBox 7.0.x with identical configuration (2 virtual CPUs and APIC I/O enabled) without any problems. System halt (crash) is experienced *only* with the latest Ubuntu 24.04 release and only with graphical Desktop edition. It is possible that Microsoft might pushed some changes to Hyper-V though Windows Update that I am not aware of tand this can create additional problems for VirtualBox...

My experiments also show that running Ubuntu 24.04 Server with 2 CPUs and APIC I/O enabled works perfectly. If I don't enable graphical Ubuntu 24.04 desktop, system works perfectly (performance aside). To be explicit, when I run Ubuntu 24.04 Server with 2 CPUs and APIC I/O enabled on Windows 10 with Hyper-V on, I see Snail execution mode enabled in the log as you highlighted:

Code: Select all

00:00:06.576631 NEM: Adjusting APIC configuration from X2APIC to APIC max mode.  X2APIC is not supported by the WinHvPlatform API!
00:00:06.576634 NEM: Disable Hyper-V if you need X2APIC for your guests!
00:00:06.576791 NEM:
00:00:06.576791 NEM: NEMR3Init: Snail execution mode is active!
00:00:06.576791 NEM: Note! VirtualBox is not able to run at its full potential in this execution mode.
00:00:06.576792 NEM:       To see VirtualBox run at max speed you need to disable all Windows features
00:00:06.576792 NEM:       making use of Hyper-V.  That is a moving target, so google how and carefully
00:00:06.576792 NEM:       consider the consequences of disabling these features.
BUT, for my needs it works perfectly fine (meaning performance is a bit subjective based on the current needs).

What I was trying to report in my previous message was a different result - in this case Virtual Machine completely halts (freezes). System halt (freeze) happens within 2-3 minutes after system boots and user logs on to GNOME desktop. I am trying to explain that halt (freeze) is not the same as "system runs slowly" - system does not run at all, it is halted.

Your response forced me to do additional experiment though and I focused on the number of CPUs and APIC I/O. When I use only 1 CPU and APIC I/O is enabled, I am able to run Ubuntu 24.04 Desktop with GNOME virtual machine without freeze. Yes, it runs slowly, but it is usable. I am seeing Snail Mode in logs as you highlighted, but that is OK, machine us usable. I am using this virtual machine for more then 1 hour now without freeze. As I explained above, it is *very different* result that I tried to report in my previous email where virtual machine completely freezes (halts) 2-3 minutes after GNOME Desktop boots.

Summary of my experience with Ubuntu 24.04 Desktop with GNOME on Virtual Box 7.0.18 on Windows 10 with Hyper-V enabled is:

- APIC I/O enabled, 2 CPUs - halts (freezes) cca 2-3 minutes after user logs in to the GNOME desktop
- APIC I/O enabled, 1 CPUs - slow, but usable. No halt (freeze) of the system

Ubuntu 24.04 Server without GNOME user interface (only terminal mode) runs in Snail mode, but is stable (no freeze/system halt).

That is why it seems to me that graphical X11 subsystem of Ubuntu 24.04 in combination with Virtual Box is causing system crash (halt). Latest experiment also seems to show that number of CPUs are impacting it (and my original kernel log actually gives a hint that it may be caused by thread synchronization access to shared structure related to graphical subsystem).

If disabling Hyper-V is long term solution - as it seems to be due to constrains Hyper-V creates for higher level virtualization software - then I would personally consider dual boot system for WSL configurations. Going though the dance of enabling/disabling Hyper-V and potentially causing other side effects on the system seems to me more problematic then enabling dual boot and boot into desired system configuration according to given development session. Windows 7 and later can boot from VHD file and this enables some additional flexibility rather then enabling/disabling Hyper-V all the time and risking side-effects from such drastic system reconfiguration.
Post Reply