VM crashing since Ubuntu 20 as host OS

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Tobida
Posts: 4
Joined: 17. Nov 2020, 18:45

VM crashing since Ubuntu 20 as host OS

Post by Tobida »

Hi,

I am Using an Windows 10 VM with virtualbox. It worked fine the last years, using Ubuntu 18 as Host and virtualbox 5.2, on a thinkpad t450s.

I upgraded to Ubuntu 20, now using virtualbox 6.1.10, with the fitting guest additions.

I always shutdown the VM completey after usage and boot the VM the next time. No pausing or saving a state.

The VM boots fine. After some time (i dont have to do anything in the VM) the laptop nearly comes to a freeze. After some minutes virtualbox cancels the VM by force.

I then remvoed virtualbox and installet virtualbox 6.1.16 via oracle repository. After installing extension package but without installing the guest additions, VM works fine. After installing the guest additions after at first running nicely, after some time (without me doing anything in the VM) i see the same beaviour as before: laptop nearly comes to a freeze, then afeter some minutes virtualbox cancels the VM by force.

As attachment you find the vbox.log

I hope for ideas how to solve this - thank you in advance ...
Attachments
W7 Arbeit-2021-01-11-14-13-50.zip
vbox.log
(29.75 KiB) Downloaded 10 times
multiOS
Volunteer
Posts: 832
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: VM crashing since Ubuntu 20 as host OS

Post by multiOS »

I suspect the real problem is the limitation of the base system:
00:00:01.820351 CPUM: Logical host processors: 4 present, 4 max, 4 online, online mask: 000000000000000f
00:00:01.820406 CPUM: Physical host cores: 2
i.e you have a dual-core CPU (2 Physical Cores) but you are trying to run 2 64-bit OSs at the same time, both of which really expect/need at least a dual-core processor (2 Physical Cores) to operate effectively. You could try to allocate both CPUs to the Guest VM, but be prepared for the Host PC to become unstable if it gets 'stressed'.
Tobida
Posts: 4
Joined: 17. Nov 2020, 18:45

Re: VM crashing since Ubuntu 20 as host OS

Post by Tobida »

multiOS wrote:I suspect the real problem is the limitation of the base system:
00:00:01.820351 CPUM: Logical host processors: 4 present, 4 max, 4 online, online mask: 000000000000000f
00:00:01.820406 CPUM: Physical host cores: 2
i.e you have a dual-core CPU (2 Physical Cores) but you are trying to run 2 64-bit OSs at the same time, both of which really expect/need at least a dual-core processor (2 Physical Cores) to operate effectively. You could try to allocate both CPUs to the Guest VM, but be prepared for the Host PC to become unstable if it gets 'stressed'.
Thank you for your ideas!

You are right, the T450s has a i5-5300U CPU with 2 Cores and 4 Threads, but it is a VT-x processor, prepared for virtualisation.

Using Ubuntu 18 and the same VM i already had 2 64 bit OS at the same time running, without any problems and with no crashing. After switching to Ubuntu 18 (and from virtualbox5 to virtualbox6) the problems began.

I was operating the VM with 2 cores already (having the same problems), downsized it to one core after reading in this forum that this could cause a problem for the host OS, with the idea to destress the host.

But i will try to switch the VM back to 2 cores.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM crashing since Ubuntu 20 as host OS

Post by mpack »

Tobida wrote: I was operating the VM with 2 cores already (having the same problems), downsized it to one core after reading in this forum
Perfectly sensible. Unfortunately there is no good solution for your host. Allocating both cores to a VM is not ideal, as it could lead to lagging and instability if both guest and host stress both cores at the same time. Unfortunately, trying to run a modern 64bit OS (particularly Windows 10) on 1 core is no picnic either, so I personally consider the first option to be the lesser evil.

I don't have anything concrete to offer on your problem. I would suggest that, next time it starts lagging, open up Windows 10's task manager, go to the details panel and make sure that CPU, IO reads and IO writes columns are enabled, and see if you can identify a CPU or I/O hog. That might give us a clue as to what should be tried next.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: VM crashing since Ubuntu 20 as host OS

Post by fth0 »

Tobida wrote:Windows 10 VM
You're (still) telling VirtualBox that it is a Windows 7 guest. In the VM configuration, set General > Basic > Version to Windows 10 (64-bit) and see if that makes a difference.
Tobida
Posts: 4
Joined: 17. Nov 2020, 18:45

[SOLVED] Re: VM crashing since Ubuntu 20 as host OS

Post by Tobida »

Thank you for your suggestions! I reconfigured the VM to be a Windows 10 guest. And tried the VM with one and two cores, with 2 GiB and 4 GiB of memory - no effect.

I then monitored the running processes and the over all used memory. And found the reason for the crashing VM: When the CPU runs at 100% and the system freezes, kswapd0 is running with high cpu load. kswapd0 is the process that manages virtual memory.
My laptop has 12 GIB memory, so i had swap turned off.
In fact, an Ubuntu 20 with snap packages seems to use more memory then Ubuntu 18 on my system. Having firefox, thunderbird, and virtualbox with the guest addition running, was enough to trigger kswapd0 for swapping. As there was no swap, kswapd0 kicked the process with the VM, to free memory.

My solution was to add a swap partition to the system.

Now everything works fine and smooth, the VM has now 2 Cores and 4 GiB memory.

Lession learned: Sometimes the cause of an observed symptom is completely different from what you think.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VM crashing since Ubuntu 20 as host OS

Post by mpack »

Interesting story, thanks for reporting back.
Post Reply