I am using Fedora since version 35 and I have never had any strange behavior with VirtualBox until I installed Win11 VM today with VirtualBox.
At some point when I start to install chrome and firefox simultaneously in my VM and the VM having still 2gb ram free, and my host with 37% of the memory also free F37 starts to lag until virtualbox explodes and everything is back to normal again.
If I have approximately 37% free ram on my host, why is this happening?
Jan 20 11:54:36 rog systemd-oomd: Killed /firstname.lastname@example.org/app.slice/app-gnome-virtualbox-9013.scope due to memory pressure for /user.slice/user-1000.slice being 60.91% > 50.00% for > 20s with reclaim activity
Jan 20 11:54:36 rog systemd: app-gnome-virtualbox-9013.scope: systemd-oomd killed 39 process(es) in this unit.
Kernel: 6.1.6-200.fc37.x86_64 arch: x86_64 bits: 64 compiler: gcc
v: 2.38-25.fc37 Desktop: GNOME v: 43.2 tk: GTK v: 3.24.36 wm: gnome-shell
dm: GDM Distro: Fedora release 37 (Thirty Seven)
Type: Laptop System: ASUSTeK product: ROG Strix G731GU_G731GU v: 1.0
serial: <superuser required>
Mobo: ASUSTeK model: G731GU v: 1.0 serial: <superuser required>
UEFI: American Megatrends v: G731GU.312 date: 02/19/2021
ID-1: BAT0 charge: 11.3 Wh (58.9%) condition: 19.2/66.0 Wh (29.1%)
volts: 15.7 min: 15.7 model: ASUSTeK ASUS Battery serial: N/A
status: not charging
Device-1: hidpp_battery_0 model: Logitech Wireless Mouse B330/M330/M331
serial: <filter> charge: 55% (should be ignored) status: discharging
Info: 6-core model: Intel Core i7-9750H bits: 64 type: MT MCP
arch: Coffee Lake rev: A cache: L1: 384 KiB L2: 1.5 MiB L3: 12 MiB
Speed (MHz): avg: 1176 high: 2600 min/max: 800/4500 cores: 1: 900 2: 815
3: 2600 4: 900 5: 900 6: 2600 7: 899 8: 900 9: 900 10: 900 11: 900 12: 900
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: ASUSTeK
driver: i915 v: kernel arch: Gen-9.5 ports: active: eDP-1 empty: none
bus-ID: 00:02.0 chip-ID: 8086:3e9b
Device-2: NVIDIA TU116M [GeForce GTX 1660 Ti Mobile] vendor: ASUSTeK
driver: nouveau v: kernel arch: Turing pcie: speed: 8 GT/s lanes: 8 ports:
active: none empty: DP-1,HDMI-A-1 bus-ID: 01:00.0 chip-ID: 10de:2191
temp: 43.0 C
Device-3: Logitech HD Webcam C615 type: USB driver: snd-usb-audio,uvcvideo
bus-ID: 1-3:2 chip-ID: 046d:082c
Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 22.1.7
compositor: gnome-shell driver: gpu: i915 display-ID: 0
Monitor-1: eDP-1 model: AU Optronics 0x409d res: 1920x1080 dpi: 128
diag: 438mm (17.3")
API: OpenGL v: 4.6 Mesa 22.3.3 renderer: Mesa Intel UHD Graphics 630 (CFL
GT2) direct render: Yes
Device-1: Intel Cannon Lake PCH cAVS vendor: ASUSTeK driver: snd_hda_intel
bus-ID: 1-3:2 v: kernel chip-ID: 046d:082c bus-ID: 00:1f.3
Device-2: NVIDIA TU116 High Definition Audio vendor: ASUSTeK
driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 8 bus-ID: 01:00.1
Device-3: Logitech HD Webcam C615 type: USB driver: snd-usb-audio,uvcvideo
Sound API: ALSA v: k6.1.6-200.fc37.x86_64 running: yes
Sound Server-1: PulseAudio v: 16.1 running: no
Sound Server-2: PipeWire v: 0.3.64 running: yes
Device-1: Intel Cannon Lake PCH CNVi WiFi driver: iwlwifi v: kernel
bus-ID: 00:14.3 chip-ID: 8086:a370
IF: wlo1 state: up mac: <filter>
Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
vendor: ASUSTeK driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1
port: 3000 bus-ID: 03:00.0 chip-ID: 10ec:8168
IF: eno2 state: down mac: <filter>
Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB
driver: btusb v: 0.8 bus-ID: 1-14:5 chip-ID: 8087:0aaa
Report: rfkill ID: hci0 rfk-id: 1 state: up address: see --recommends
Local Storage: total: 1.14 TiB used: 497.62 GiB (42.5%)
ID-1: /dev/nvme0n1 vendor: Western Digital model: PC SN520
SDAPNUW-256G-1002 size: 238.47 GiB speed: 15.8 Gb/s lanes: 2
serial: <filter> temp: 36.9 C
ID-2: /dev/sda vendor: Seagate model: ST1000LX015-1U7172 size: 931.51 GiB
speed: 6.0 Gb/s serial: <filter> temp: 37 C
ID-1: / size: 69.65 GiB used: 22.35 GiB (32.1%) fs: btrfs
ID-2: /boot size: 973.4 MiB used: 276.5 MiB (28.4%) fs: ext4
ID-3: /boot/efi size: 96 MiB used: 43.2 MiB (45.0%) fs: vfat
ID-4: /home size: 69.65 GiB used: 22.35 GiB (32.1%) fs: btrfs
ID-1: swap-1 type: zram size: 8 GiB used: 2.97 GiB (37.2%) priority: 100
System Temperatures: cpu: 50.0 C pch: 52.0 C mobo: N/A gpu: nouveau
temp: 43.0 C
Fan Speeds (RPM): cpu: 2800 gpu: nouveau fan: 0
Processes: 424 Uptime: 3h 38m Memory: 15.47 GiB used: 5.38 GiB (34.8%)
Init: systemd v: 251 target: graphical (5) default: graphical Compilers:
gcc: 12.2.1 Packages: pm: rpm pkgs: N/A note: see --rpm pm: flatpak pkgs: 44
Shell: Bash v: 5.2.15 running-in: gnome-terminal inxi: 3.3.24
Have you tried rebooting into xorg instead of using wayland. Also your not using the nvidia drivers .You might also make sure secure boot and tpm are enabled in virtualbox .
Free RAM on the host should not impact RAM use on the VM. 6GB on the VM with 4 cpus should not have an issue with most things. It might be worth noting that in most OSes the VM assignment of RAM and CPU is not absolute but shared, so the host and other VMs have access to the same hardware on a shared basis. As such, swapping usage can present an issue if it happens a lot with both the VM and its host competing for resources.
It also may be an issue with available disk space for the VM. As with all OSes, running out of space on the virtual disk used by the VM causes problems as well.
If I understand the post correctly you have fedora 37 on the host and win11 on the VM. You also are trying to install both chrome and firefox on the VM simultaneously. It could easily become an issue with trying to install the same files (DLLs) and or updating the windows registry at the same time that causes conflicts.
Have you tried installing one at a time? What else have you tried to mitigate the problem?
Guess i read that wrong I thought Fedora had the vbox and they were running win11 in vbox.
Killed […] app-gnome-virtualbox-9013.scope due to memory pressure for […]
is your host killing virtualbox because the out of memory daemon systemd-oomd is kicking in?
See related topic:
Alternative to switching off oomd is to add a large swap file on ssd (or faster).
I was using win11 VM and this situation hasn’t happened anymore, but I can’t understand how my system started to lag, in which case what was expected was that the VM would crash but my system would continue as normal.
@augenauf Thank you for the resource, very interesting post: Fedora 36 silently kills apps in the background
I want to take the opportunity to kill this doubt that I have always had: Is it normal for VMs to be slow in processes?
As much as I assign more ram or CPU, they practically work the same, is this normal and part of hypervisor tech limitations?
When I install any linux distro the updates are SUPER slow, incredibly slow.
Now using win11, I wanted to use Bandicam to record the screen and that’s an odyssey when I start recording, that hangs loading.
In my experience, properly configured VM’s are not annoyingly slower than native installs. Poor performance usually means either host or VM is under memory pressure or has some CPU-intensive processes. Linux and Windows both have many tools to help monitor CPU and memory pressure. OOM generally means some process gets killed rather than slowing the system to the point where it is non-responsive.
One common cause of excessive memory pressure I have often encountered with new users is using when a command-line job is taking a long time, ending with many inactive jobs using memory.
With spinning disks, I have often seen a big drop in performance just before the disk fails.
Windows often has a lot of background overhead scanning for malware, etc. If this is causing OOM to kill the VM you could get into an endless loop of restarts.
It can be several things.
- The total number of processes running (VM + host)
- The total amount of RAM available
- The particular hyperviser in use. Each uses its own style of management, and all use some portion of host RAM and CPU time to operate.
- With each VM the assigned processors and RAM are not dedicated, but instead are shared. Thus it is possible for the usage to be traded back and forth between host and VM, causing more intensive work for the host in keeping track of what is being used by each OS, adding to the workload for the host and ram usage (as well as potentially requiring more swap, etc.) After all the host is the one having the physical ram and cpus thus has to manage their utilization via the hypervisor.
I have 32 GB RAM and 12 CPUs in my host with the VMs and never have more than 2 VMs active at a time with each only assigned 4GB RAM and 2 CPUs. I have never seen the situation you describe, but can envision it easily. I also only use libvirt, qemu, and VMM to manage my VMs and do not use VirtualBox so have no experience with VB to compare.
I presently have 2 VMs active, essentially idling, with the host showing 13GB RAM used, ~6GB swap used, and ~30% cpu usage. (I am only running 8GB swap total on the host). When the VMs are not in use the host usually shows ~4GB RAM, 0 swap, and still about 27% CPU usage.
It can also be an issue with win11 and virtualbox.
With win11 requiring a tpm module and secure boot on the hardware that may be a factor since win11 is in the VM.
You made me curious to investigate the native stack hypervisor you are using. Ah, even though I knew it existed, I hadn’t paid attention to this! What better way to virtualize than a type 1 virtualization, I already understand why you don’t present this type of poor performance that I’m talking about in my case using VBox.
Thanks! I found an amazing video that explains the whole process using the Linux Hypervisor Setup (libvirt/qemu/kvm) stack.
Learning all the time!