You are not logged in.

#1 2025-10-23 17:42:20

luizzeross
Member
Registered: 2024-07-26
Posts: 4

High CPU usage with VirtualBox 7.2.4-1

I ran into this issue today. I use two VirtualBox VMs for my daily work, and since the last update, the host system has been using 100% of my CPU even when the guests are idle. I downgraded VirtualBox to version 7.1.8-4, and everything went back to normal.

For reference, both VMs are headless network servers (no GUI), running small services for my home network — one with AlmaLinux 10 and the other with Debian 6.1. In case anyone else is facing the same issue, downgrading was the only solution that worked for me, until the moment.

Offline

#2 2025-10-23 20:51:20

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 1,035
Website

Re: High CPU usage with VirtualBox 7.2.4-1

Yeah, same issue. 7.2.2 works, 7.2.4 hogs the CPU to 100%.

I posted here as well FWIW: https://forums.virtualbox.org/viewtopic.php?t=114175

Offline

#3 2025-10-24 21:13:56

NuSkool
Member
Registered: 2015-03-23
Posts: 286

Re: High CPU usage with VirtualBox 7.2.4-1

Running 'virtualbox 7.2.4-1' seems to run normal here...

Running on AMD Ryzen host system, tested an Arch, Frugalware, and a Ventoy USB via vbox running an Arch iso, vm's.

Last edited by NuSkool (2025-10-24 21:23:28)


Scripts I Use                                                 :  https://github.com/Cody-Learner
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 7 8745HS w/ Radeon 780M Graphics
grep -m1 'model name' /proc/cpuinfo    : Intel(R) N95
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 5 PRO 2400GE w/ Radeon Vega Graphics

Offline

#4 2025-10-25 00:29:56

luizzeross
Member
Registered: 2024-07-26
Posts: 4

Re: High CPU usage with VirtualBox 7.2.4-1

NuSkool wrote:

Running 'virtualbox 7.2.4-1' seems to run normal here...

Running on AMD Ryzen host system, tested an Arch, Frugalware, and a Ventoy USB via vbox running an Arch iso, vm's.

I'm running on a i5 7600T host + 20GB RAM. Never had any issues until yesterday. Even when the guest is idling at GRUB boot screen, it's always 100% use. I only noticed it because the host fan started to make a very loud noise. Hehe.

Offline

#5 2025-10-28 11:22:40

auldnwb
Member
Registered: 2025-10-28
Posts: 2

Re: High CPU usage with VirtualBox 7.2.4-1

Same issue on a Dell host, i7-8850H with 16 GB RAM. Since the update to 7.2.4-1, on the host, /usr/lib/virtualbox/VirtualBoxVM uses 100% of one logical CPU core, even when the guest is idle. The guest system is an EndeavourOS VM.

luizzeross wrote:

I downgraded VirtualBox to version 7.1.8-4, and everything went back to normal.

What packages did you downgrade? Only virtualbox?

Offline

#6 2025-10-28 21:15:32

augofeta
Member
Registered: 2025-07-29
Posts: 5

Re: High CPU usage with VirtualBox 7.2.4-1

Same here, happens only if network adapter is NAT.

Offline

#7 2025-10-29 12:39:51

auldnwb
Member
Registered: 2025-10-28
Posts: 2

Re: High CPU usage with VirtualBox 7.2.4-1

Thanks for the tip. Looks like CPU use is back to normal after switching to Bridged Adapter in VM settings.

Offline

#8 2025-10-31 13:00:14

luizzeross
Member
Registered: 2024-07-26
Posts: 4

Re: High CPU usage with VirtualBox 7.2.4-1

luizzeross wrote:

I downgraded VirtualBox to version 7.1.8-4, and everything went back to normal.

What packages did you downgrade? Only virtualbox?

Right now my host have these two installed:

- virtualbox 7.2.2-2
- virtualbox-host-dkms 7.1.8-4

Offline

#9 2025-11-01 19:30:08

atagtm
Member
Registered: 2025-11-01
Posts: 2

Re: High CPU usage with VirtualBox 7.2.4-1

Seems like that setting the network adapter to virtio solves the NAT problem smile

VBoxManage modifyvm "my-vm" --nic1 nat --nictype1 virtio

Last edited by atagtm (2025-11-01 19:36:16)

Offline

#10 2025-11-03 12:28:14

pinkink
Member
Registered: 2022-11-26
Posts: 13

Re: High CPU usage with VirtualBox 7.2.4-1

Same issue here. I have also traced it to NAT.
To see if that's the case for you:

Find the pid of the VirtualBoxVM process, then run "top -H -p <pid>"

This displays the threads of the VM emulation process. If the thread named NAT is eating full CPU core, then this is the same issue.

To fix this and have the same networking behavior, I have switched the virtual adapter from NAT to NAT Network mode.

Offline

#11 2025-11-06 02:50:18

ericaz
Member
Registered: 2025-11-06
Posts: 1

Re: High CPU usage with VirtualBox 7.2.4-1

Had the same issue starting with 7.2.4.   Changing to Bridged Adapter (which works for my purposes) solved the issue... Thanks!

Offline

#12 2025-12-04 09:29:52

twqqis
Member
Registered: 2025-12-04
Posts: 1

Re: High CPU usage with VirtualBox 7.2.4-1

in my case, with 7.2.4 I had high usage due to NAT. Switched to bridged which lowered it to ~40%
I then realised the cpu execution cap was at 40%, which was a prev attempt to lower CPU usage. It showed in the VM as a process "EMT" when doing "top -H -p <vboxpid>" with constant 40% vm cpu usage.
After resetting exec cap back to 100%, host cpu was ~5-10% at idle.

Last edited by twqqis (2025-12-04 09:30:23)

Offline

#13 2025-12-05 04:31:06

sweatyslav
Member
Registered: 2025-12-05
Posts: 1

Re: High CPU usage with VirtualBox 7.2.4-1

Just my luck. Haven't touched VirtualBox for years until this update. Racked my brain until I found this thread. Can confirm that at least for me staying on 7.2.4-1 and simply switching from NAT to Bridged took my CPU usage from ~100% to <1%. Thanks everyone.

Offline

#14 2025-12-08 21:07:46

atagtm
Member
Registered: 2025-11-01
Posts: 2

Re: High CPU usage with VirtualBox 7.2.4-1

atagtm wrote:

Seems like that setting the network adapter to virtio solves the NAT problem smile

VBoxManage modifyvm "my-vm" --nic1 nat --nictype1 virtio

I have to put my words back, the issue still exists.
Fortunately VDE support it built-in in the AUR package...

I use vde_switch + dnsmasq + iptables + socat to create the NAT network...

Stripped shell function:

#!/bin/sh
guest="$1"
CONF_DIR="$HOME"/.cache
wan_if="$(netstat -rn -f inet 2>/dev/null | awk '/UG/ {print $NF; exit}')"
nat_cidr="10.0.2.1/24"

cat << EOF > "$CONF_DIR"/dnsmasq.conf
interface=vboxnat0
dhcp-range=vboxnat0,10.0.2.15,10.0.2.15,infinite
dhcp-option=vboxnat0,3,10.0.2.1
EOF

create_natif() {
	# TAP
	sudo ip tuntap add dev vboxnat0 mode tap group vboxusers
	sudo ip addr add "$nat_cidr" dev vboxnat0
	sudo ip link set vboxnat0 up

	# VDE
	vde_switch -s "$CONF_DIR"/vboxnat0.ctl -g vboxusers -m 770 -d
	vde_plug2tap -s "$CONF_DIR"/vboxnat0.ctl -d vboxnat0

	# VirtualBox
	vboxmanage modifyvm "$guest" --nic1 "Generic" --nicgenericdrv1 "VDE" \
		--nicproperty1 "network=$CONF_DIR/vboxnat0.ctl"
	
	# DHCP
	sudo dnsmasq --conf-file="$CONF_DIR"/dnsmasq.conf \
		--pid-file="$CONF_DIR"/dnsmasq.pid \
		--dhcp-leasefile="$CONF_DIR"/dnsmasq.leases \
		--user=$USER --group=vboxusers

	# NAT 
	sudo iptables -t nat -A POSTROUTING -s "$nat_cidr" -o "$wan_if" -j MASQUERADE

	# Port forward (127.0.0.1:2222 -> 10.0.2.15:22)
	(
		socat TCP-LISTEN:2222,bind=127.0.0.1,reuseaddr,fork TCP:10.0.2.15:22 >/dev/null 2>&1 &
		echo $! > "$CONF_DIR"/socat.pid
		disown
	)
}
  1. Creates a TAP interface

  2. Creates the VDE switch

  3. Configures VirtualBox's network interface (#1)

  4. Starts DHCP service on the NAT network

  5. Masquerades traffic from the VDE subnet

  6. (Optionally) creates SSH port-forwarding

To "delete" it:

kill_natif() {
	sudo kill $(< "$CONF_DIR"/dnsmasq.pid) >/dev/null 2>&1 && \
		rm -f "$CONF_DIR"/dnsmasq.pid 
	kill $(< "$CONF_DIR"/socat.pid) >/dev/null 2>&1 && \
		rm -f "$CONF_DIR"/socat.pid
	sudo pkill vde_switch
	sudo ip tuntap del dev vboxnat0 mode tap
	sudo iptables -t nat -D POSTROUTING -s "$nat_cidr" -o "$wan_if" -j MASQUERADE
}

PS: It may look terrible, but it performs way much better than VBox's built-in NAT...

Last edited by atagtm (2025-12-08 22:04:21)

Offline

#15 2025-12-22 15:26:16

neoexpert
Member
Registered: 2025-12-22
Posts: 1

Re: High CPU usage with VirtualBox 7.2.4-1

I still have the issue, I tried to downgrade, but downgraded version throws an error on start of virtualbox gui. Even when I change to Bridged Adapter in VM settings the VM hangs randomly at some time. How can I downgrade correctly?
I downgraded virtualbox with following commands:

yay -S downgrade
sudo downgrade virtualbox virtualbox-host-dkms

Last edited by neoexpert (2025-12-22 15:28:15)

Offline

#16 2026-01-04 15:11:23

Emanem
Member
Registered: 2010-10-02
Posts: 3

Re: High CPU usage with VirtualBox 7.2.4-1

ericaz wrote:

Had the same issue starting with 7.2.4.   Changing to Bridged Adapter (which works for my purposes) solved the issue... Thanks!

I have switched to Manjaro (from Ubuntu 24.04.3) and stumbled upon this issue as well. Tried QEMU/virt-manager but I can't get a snappy UI like VirtualBox - anyways was about to give in because of 100% CPU usage when idle when I read this post.
I can confirm if I change the network adapter type to 'Bridged' it does work as expected - i.e. when idle the CPU usage can reach 0%.

Thanks all for this workaround!

Last edited by Emanem (2026-01-04 15:14:41)

Offline

#17 2026-01-05 18:49:27

user109396
Member
Registered: 2011-08-30
Posts: 6

Re: High CPU usage with VirtualBox 7.2.4-1

This bug was fixed in a development version:

https://github.com/VirtualBox/virtualbo … 3523303714

I managed to install a testbuild using `virtualbox-bin` PKGBUILD (https://aur.archlinux.org/packages/virtualbox-bin), now CPU usage is back to normal.

Offline

#18 2026-01-13 12:18:42

szebenyib
Member
From: LHBP
Registered: 2011-10-18
Posts: 75

Re: High CPU usage with VirtualBox 7.2.4-1

I just really love how arch and its docs and forums work, this was driving me nuts.

I can confirm the NAT taking the CPU toll via the htop command listed above.

@user109396: How did you install the testbuild? I can edit the PKGBUILD, but what should be changed in it? I cannot find any newer build here, having checked beta and rc: https://download.virtualbox.org/virtualbox

Offline

#19 2026-01-13 12:27:57

user109396
Member
Registered: 2011-08-30
Posts: 6

Re: High CPU usage with VirtualBox 7.2.4-1

@szebenyib I changed pkgver, _build and source URLs. I also had to install the `dkms` package.

This is my PKGBUILD:

# Maintainer : Daniel Bermond <dbermond@archlinux.org>
# Contributor: Rainmaker <rainmaker52@gmail.com>
# Contributor: gary9872	<garysBoXatgeemale.com>
# Contributor: khomutsky <bogdan@khomutsky.com>
# Contributor: M0Rf30
# https://www.virtualbox.org/download/testcase/VirtualBox-7.2.5-171653-Linux_amd64.run
# https://www.virtualbox.org/download/testcase/VirtualBoxSDK-7.2.5-171653.zip
pkgbase=virtualbox-bin
pkgname=(
    'virtualbox-bin'
    'virtualbox-bin-guest-iso'
    'virtualbox-bin-sdk')
pkgver=7.2.5
_build=171653
_rev=110274
pkgrel=1
pkgdesc='Powerful x86 virtualization for enterprise as well as home use (Oracle branded non-OSE)'
arch=('x86_64')
url='https://www.virtualbox.org/'
license=('GPL-3.0-only')
makedepends=(
    'at-spi2-core' # to satisfy pkgcheck
    'cairo' # to satisfy pkgcheck
    'gdk-pixbuf2' # to satisfy pkgcheck
    'gtk2' # to satisfy pkgcheck
    'gtk3' # to satisfy pkgcheck
    'pango' # to satisfy pkgcheck
    'python'
    'python-build'
    'python-installer'
    'python-setuptools'
    'python-wheel')
source=("http://www.virtualbox.org/download/testcase/VirtualBox-${pkgver}-${_build}-Linux_amd64.run"
        "https://www.virtualbox.org/download/testcase/VirtualBoxSDK-${pkgver}-${_build}.zip"
        "VBoxAuth-r${_rev}.h"::"https://www.virtualbox.org/svn/vbox/trunk/include/VBox/VBoxAuth.h?p=${_rev}"
        "VBoxAuthPAM-r${_rev}.c"::"https://www.virtualbox.org/svn/vbox/trunk/src/VBox/HostServices/auth/pam/VBoxAuthPAM.c?p=${_rev}"
        "VBoxAuthSimple-r${_rev}.cpp"::"https://www.virtualbox.org/svn/vbox/trunk/src/VBox/HostServices/auth/simple/VBoxAuthSimple.cpp?p=${_rev}"
        'dkms.conf'
        'vboxreload'
        '60-vboxdrv.rules'
        'vboxweb.service'
        'virtualbox.modprobe'
        'virtualbox.sysusers'
        'LICENSE.sdk'
        '013-Makefile.patch')
noextract=("VirtualBoxSDK-${pkgver}-${_build}.zip")
sha256sums=('561eb61ade4d29c8fbf61c7fbca265dd2f26485ae167db09db4eb2887bab4e2e'
            '5093a9b8c30ad07da458dd99b4e5acc105cdaf8cdf3b96878fb686257c15a403'
            'c344b7196963a1d51f730b52836e7fcc91ace4c137995b91dc00c12205f097cd'
            'be189d96a70820aadcea24453c696275c7c7b9453ac7157b176d93a95796bdc8'
            '7ac1fff6f00a106fbc3fdb7e388f6072e8afb61f4352dfc530d8825222d202cd'
            '63f1e9eabedec2170bd0589aaa2bf5025ff8f8ec1764cc4823cbe446e9ce1388'
            '4001b5927348fe669a541e80526d4f9ea91b883805f102f7d571edbb482a9b9d'
            '9c5238183019f9ebc7d92a8582cad232f471eab9d3278786225abc1a1c7bf66e'
            'e6e875ef186578b53106d7f6af48e426cdaf1b4e86834f01696b8ef1c685787f'
            '07fe5c8b313cd7f01505eb9721357269a288ccd0c04e6467afb954038d6f46df'
            '2101ebb58233bbfadf3aa74381f22f7e7e508559d2b46387114bc2d8e308554c'
            '09335d7d1075df02d29cec13119538134efdf43ea73a93b0f89d0d7d4b6625a1'
            'a3ec0cab869e2d64914bffbf1c11a3c571808438656af654932f96e7a69114fd')

prepare() {
    local _extractdir="${pkgbase}-${pkgver}/VirtualBox-extracted"
    
    # extract files
    mkdir -p "$_extractdir"
    sh "VirtualBox-${pkgver}-${_build}-Linux_amd64.run" --noexec --nox11 --target "${pkgbase}-${pkgver}"
    bsdtar -xf "${pkgbase}-${pkgver}/VirtualBox.tar.bz2" -C "$_extractdir"
    bsdtar -xf "VirtualBoxSDK-${pkgver}-${_build}.zip" -C "${pkgbase}-${pkgver}"
    
    # dkms configuration
    install -D -m644 dkms.conf -t "${_extractdir}/src/vboxhost"
    sed -i "s/^\(PACKAGE_VERSION\)=.*/\1=${pkgver}/" "${_extractdir}/src/vboxhost/dkms.conf"
    
    # fix dkms build
    patch -d "$_extractdir" -Np1 -i "${srcdir}/013-Makefile.patch"
}

build() {
    cd "${pkgbase}-${pkgver}/sdk/installer/python/vboxapi"
    VBOX_INSTALL_PATH='/opt/VirtualBox' python -m build --wheel --no-isolation
}

package_virtualbox-bin() {
    depends=(
        'bash'
        'dbus'
        'dkms'
        'fontconfig'
        'freetype2'
        'gcc-libs'
        'glib2'
        'glibc'
        'hicolor-icon-theme'
        'libgl'
        'libx11'
        'libxcb'
        'libxkbcommon'
        'libxkbcommon-x11'
        'libxt'
        'wayland'
        'xcb-util-cursor'
        'xcb-util-image'
        'xcb-util-keysyms'
        'xcb-util-renderutil'
        'xcb-util-wm'
        'zlib')
    optdepends=(
        'at-spi2-core: for GTK2/GTK3 platformthemes plugins and GTK2 styles plugin'
        'cairo: for GTK3 platformthemes plugin'
        'gdk-pixbuf2: for GTK2/GTK3 platformthemes plugins and GTK2 styles plugin'
        'gtk2: for GTK2 platformthemes and styles plugins'
        'gtk3: for GTK3 platformthemes plugin'
        'pango: for GTK2/GTK3 platformthemes plugins and GTK2 styles plugin'
        'virtualbox-bin-guest-iso: for guest additions CD image'
        'virtualbox-bin-sdk: for the software developer kit'
        'virtualbox-ext-oracle: for Oracle extensions pack')
    provides=("virtualbox=${pkgver}" 'virtualbox-host-dkms' 'VIRTUALBOX-HOST-MODULES')
    #conflicts=('virtualbox' 'virtualbox-host-dkms' 'virtualbox-host-modules-arch')
    conflicts=('virtualbox' 'virtualbox-host-dkms')
    replaces=('virtualbox_bin' 'virtualbox-sun')
    backup=('etc/vbox/vbox.cfg')
    options=('!debug' '!emptydirs' '!strip')
    
    local _installdir='opt/VirtualBox'
    
    # install bundled files
    install -d -m755 "${pkgdir}/opt"
    cp -Pr --no-preserve='ownership' "${pkgbase}-${pkgver}/VirtualBox-extracted" "${pkgdir}/${_installdir}"
    
    # mark binaries suid root, and make sure the directory is only writable by the user
    chmod 4755 "${pkgdir}/${_installdir}"/{VirtualBoxVM,VBox{Headless,Net{AdpCtl,DHCP,NAT},VolInfo}}
    chmod go-w "${pkgdir}/${_installdir}"
    
    # remove guest iso and bundled sdk files
    rm -r "${pkgdir}/${_installdir}"/{additions/VBoxGuestAdditions.iso,sdk}
    
    # module sources_pypath
    install -d -m755 "${pkgdir}/usr/src"
    mv "${pkgdir}/${_installdir}/src/vboxhost" "${pkgdir}/usr/src/vboxhost-${pkgver}_non_OSE"
    
    # module reloading shortcut (with a symlink with default helper)
    install -D -m755 vboxreload -t "${pkgdir}/usr/bin"
    ln -s vboxreload "${pkgdir}/usr/bin/rcvboxdrv"
    
    # do not enable KVM virtualization on module load
    install -D -m0644 virtualbox.modprobe "${pkgdir}/usr/lib/modprobe.d/virtualbox.conf"
    
    # udev rules
    ## we need to copy and not symlink VBoxCreateUSBNode.sh in /usr/lib/udev to avoid udevd
    ## to look /opt when /opt is not mounted. This can be done until VBoxCreateUSBNode.sh doesn't
    ## need more stuff from /opt
    install -D -m644 60-vboxdrv.rules -t "${pkgdir}/usr/lib/udev/rules.d"
    install -D -m755 "${pkgdir}/${_installdir}/VBoxCreateUSBNode.sh" -t "${pkgdir}/usr/lib/udev"
    install -D -m755 "${pkgdir}/${_installdir}/VBoxCreateUSBNode.sh" -t "${pkgdir}/usr/share/virtualbox"
    
    # configuration file
    install -D -m644 <(printf '%s\n' "INSTALL_DIR=/${_installdir}") "${pkgdir}/etc/vbox/vbox.cfg"
    
    # modules-load.d configuration
    install -D -m644 <(printf 'vboxdrv\nvboxnetadp\nvboxnetflt\n') "${pkgdir}/usr/lib/modules-load.d/${pkgname}.conf"
    
    # systemd
    install -D -m644 vboxweb.service -t "${pkgdir}/usr/lib/systemd/system"
    install -D -m644 virtualbox.sysusers "${pkgdir}/usr/lib/sysusers.d/virtualbox.conf"
    
    # symlinks
    local _dir
    local _file
    install -d -m755 "${pkgdir}/usr/share"/{applications,{doc,licenses}/"$pkgname",mime/packages,pixmaps}
    for _file in vboxwebsrv VirtualBox{,VM} VBox{Manage,SDL,VRDP,Headless,Autostart,BalloonCtrl,BugReport,DTrace}
    do
        ln -s "../../${_installdir}/VBox.sh" "${pkgdir}/usr/bin/${_file}"
        [ "$_file" != 'vboxwebsrv' ] && ln -s "../../${_installdir}/VBox.sh" "${pkgdir}/usr/bin/${_file,,}"
    done
    ln -s "../../../${_installdir}/VBoxSysInfo.sh" "${pkgdir}/usr/share/virtualbox/VBoxSysInfo.sh"
    ln -s "../../../usr/src/vboxhost-${pkgver}_non_OSE" "${pkgdir}/${_installdir}/src/vboxhost"
    ln -s "../../../${_installdir}/VBox.png" "${pkgdir}/usr/share/pixmaps/VBox.png"
    ln -s "../../../${_installdir}/virtualbox.desktop" "${pkgdir}/usr/share/applications/virtualbox.desktop"
    ln -s "../../../../${_installdir}/virtualbox.xml" "${pkgdir}/usr/share/mime/packages/virtualbox.xml"
    ln -s "../../../../${_installdir}/UserManual.pdf" "${pkgdir}/usr/share/doc/${pkgname}/UserManual.pdf"
    ln -s "../../../../${_installdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    ## hicolor icons
    while read -r -d '' _file
    do
        if grep -Eq '/virtualbox\.(png|svg)$' <<< "$_file"
        then
            _dir="${_file%/*}/apps"
        else
            _dir="${_file%/*}/mimetypes"
        fi
        install -d -m755 "${pkgdir}/usr/share/icons/hicolor/${_dir}"
        ln -s "../../../../../../${_installdir}/icons/${_dir%/*}/${_file##*/}" \
            "${pkgdir}/usr/share/icons/hicolor/${_dir}/${_file##*/}"
    done < <(find "${pkgdir}/${_installdir}/icons" -type f -print0 | sed -z "s|${pkgdir}/${_installdir}/icons/||")
    ## workaround for unsupported $ORIGIN/.. in VBoxC.so
    for _file in VBox{RT,XPCOM}.so
    do
        ln -s "../${_file}" "${pkgdir}/${_installdir}/components/${_file}"
    done
    
    # https://www.virtualbox.org/ticket/22193
    # https://bbs.archlinux.org/viewtopic.php?pid=2199183#p2199183
    ln -s ../../usr/lib/libdl.so.2 "${pkgdir}/${_installdir}/libdl.so"
    ln -s ../../usr/lib/libpthread.so.0 "${pkgdir}/${_installdir}/libpthread.so"
    ln -sr /usr/lib/libdl.so.2 "${srcdir}/${pkgbase}-${pkgver}/VirtualBox-extracted/libdl.so"
    ln -sr /usr/lib/libpthread.so.0 "${srcdir}/${pkgbase}-${pkgver}/VirtualBox-extracted/libpthread.so"
}

package_virtualbox-bin-guest-iso() {
    pkgdesc='VirtualBox guest additions ISO image for use with virtualbox-bin package'
    arch=('any')
    provides=('virtualbox-guest-iso')
    
    install -D -m644 "${pkgbase}-${pkgver}/VirtualBox-extracted/additions/VBoxGuestAdditions.iso" \
        -t "${pkgdir}/opt/VirtualBox/additions"
}

package_virtualbox-bin-sdk() {
    pkgdesc='VirtualBox software developer kit for use with virtualbox-bin package'
    arch=('any')
    license=('LGPL-2.1-only' 'GPL-3.0-only' 'LicenseRef-Custom')
    depends=('python')
    optdepends=('java-runtime: for webservice java bindings')
    provides=('virtualbox-sdk')
    conflicts=('virtualbox-sdk')
    
    local _dir
    local _installdir='opt/VirtualBox'
    
    install -d -m755 "${pkgdir}/${_installdir}/sdk"
    while read -r -d '' _dir
    do
        cp -Pr --no-preserve='ownership' "$_dir" "${pkgdir}/${_installdir}/sdk"
    done < <(find "${pkgbase}-${pkgver}/sdk" -mindepth 1 -maxdepth 1 -type d ! -name 'installer' -print0)
    
    install -D -m644 "VBoxAuth-r${_rev}.h"    "${pkgdir}/${_installdir}/sdk/bindings/auth/include/VBoxAuth.h"
    install -D -m644 "VBoxAuthPAM-r${_rev}.c" "${pkgdir}/${_installdir}/sdk/bindings/auth/VBoxAuthPAM.cpp"
    install -D -m644 "VBoxAuthSimple-r${_rev}.cpp" "${pkgdir}/${_installdir}/sdk/bindings/auth/VBoxAuthSimple.cpp"
    install -D -m644 LICENSE.sdk "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    
    python -m installer --destdir="$pkgdir" "${pkgbase}-${pkgver}/sdk/installer/python/vboxapi/dist"/*.whl
    
    local _sitepkgs
    _sitepkgs="$(python -c 'import site; print(site.getsitepackages()[0])')"
    ln -s "../../../../${_installdir}/sdk/bindings/xpcom/python/xpcom" "${pkgdir}${_sitepkgs}/xpcom"

Offline

#20 2026-01-13 13:15:31

szebenyib
Member
From: LHBP
Registered: 2011-10-18
Posts: 75

Re: High CPU usage with VirtualBox 7.2.4-1

Many thanks!

This has worked for me:

yay -S --editmenu --mflags --skipinteg virtualbox-bin

Check the available version here: https://www.virtualbox.org/wiki/Testbuilds

# Maintainer : Daniel Bermond <dbermond@archlinux.org>
# Contributor: Rainmaker <rainmaker52@gmail.com>
# Contributor: gary9872	<garysBoXatgeemale.com>
# Contributor: khomutsky <bogdan@khomutsky.com>
# Contributor: M0Rf30
# [url]https://www.virtualbox.org/download/testcase/VirtualBox-7.2.5-171653-Linux_amd64.run[/url]
# [url]https://www.virtualbox.org/download/testcase/VirtualBoxSDK-7.2.5-171653.zip[/url]
pkgbase=virtualbox-bin
pkgname=(
    'virtualbox-bin'
    'virtualbox-bin-guest-iso'
    'virtualbox-bin-sdk')
pkgver=7.2.5
_build=172125
_rev=110274
pkgrel=1
pkgdesc='Powerful x86 virtualization for enterprise as well as home use (Oracle branded non-OSE)'
arch=('x86_64')
url='https://www.virtualbox.org/'
license=('GPL-3.0-only')
makedepends=(
    'at-spi2-core' # to satisfy pkgcheck
    'cairo' # to satisfy pkgcheck
    'gdk-pixbuf2' # to satisfy pkgcheck
    'gtk2' # to satisfy pkgcheck
    'gtk3' # to satisfy pkgcheck
    'pango' # to satisfy pkgcheck
    'python'
    'python-build'
    'python-installer'
    'python-setuptools'
    'python-wheel')
source=("http://www.virtualbox.org/download/testcase/VirtualBox-${pkgver}-${_build}-Linux_amd64.run"
        "[url]https://www.virtualbox.org/download/testcase/VirtualBoxSDK-${pkgver}-${_build}.zip[/url]"
        "VBoxAuth-r${_rev}.h"::"https://www.virtualbox.org/svn/vbox/trunk/include/VBox/VBoxAuth.h?p=${_rev}"
        "VBoxAuthPAM-r${_rev}.c"::"https://www.virtualbox.org/svn/vbox/trunk/src/VBox/HostServices/auth/pam/VBoxAuthPAM.c?p=${_rev}"
        "VBoxAuthSimple-r${_rev}.cpp"::"https://www.virtualbox.org/svn/vbox/trunk/src/VBox/HostServices/auth/simple/VBoxAuthSimple.cpp?p=${_rev}"
        'dkms.conf'
        'vboxreload'
        '60-vboxdrv.rules'
        'vboxweb.service'
        'virtualbox.modprobe'
        'virtualbox.sysusers'
        'LICENSE.sdk'
        '013-Makefile.patch')
noextract=("VirtualBoxSDK-${pkgver}-${_build}.zip")
sha256sums=('561eb61ade4d29c8fbf61c7fbca265dd2f26485ae167db09db4eb2887bab4e2e'
            '5093a9b8c30ad07da458dd99b4e5acc105cdaf8cdf3b96878fb686257c15a403'
            'c344b7196963a1d51f730b52836e7fcc91ace4c137995b91dc00c12205f097cd'
            'be189d96a70820aadcea24453c696275c7c7b9453ac7157b176d93a95796bdc8'
            '7ac1fff6f00a106fbc3fdb7e388f6072e8afb61f4352dfc530d8825222d202cd'
            '63f1e9eabedec2170bd0589aaa2bf5025ff8f8ec1764cc4823cbe446e9ce1388'
            '4001b5927348fe669a541e80526d4f9ea91b883805f102f7d571edbb482a9b9d'
            '9c5238183019f9ebc7d92a8582cad232f471eab9d3278786225abc1a1c7bf66e'
            'e6e875ef186578b53106d7f6af48e426cdaf1b4e86834f01696b8ef1c685787f'
            '07fe5c8b313cd7f01505eb9721357269a288ccd0c04e6467afb954038d6f46df'
            '2101ebb58233bbfadf3aa74381f22f7e7e508559d2b46387114bc2d8e308554c'
            '09335d7d1075df02d29cec13119538134efdf43ea73a93b0f89d0d7d4b6625a1'
            'a3ec0cab869e2d64914bffbf1c11a3c571808438656af654932f96e7a69114fd')

prepare() {
    local _extractdir="${pkgbase}-${pkgver}/VirtualBox-extracted"
    
    # extract files
    mkdir -p "$_extractdir"
    sh "VirtualBox-${pkgver}-${_build}-Linux_amd64.run" --noexec --nox11 --target "${pkgbase}-${pkgver}"
    bsdtar -xf "${pkgbase}-${pkgver}/VirtualBox.tar.bz2" -C "$_extractdir"
    bsdtar -xf "VirtualBoxSDK-${pkgver}-${_build}.zip" -C "${pkgbase}-${pkgver}"
    
    # dkms configuration
    install -D -m644 dkms.conf -t "${_extractdir}/src/vboxhost"
    sed -i "s/^\(PACKAGE_VERSION\)=.*/\1=${pkgver}/" "${_extractdir}/src/vboxhost/dkms.conf"
    
    # fix dkms build
    patch -d "$_extractdir" -Np1 -i "${srcdir}/013-Makefile.patch"
}

build() {
    cd "${pkgbase}-${pkgver}/sdk/installer/python/vboxapi"
    VBOX_INSTALL_PATH='/opt/VirtualBox' python -m build --wheel --no-isolation
}

package_virtualbox-bin() {
    depends=(
        'bash'
        'dbus'
        'dkms'
        'fontconfig'
        'freetype2'
        'gcc-libs'
        'glib2'
        'glibc'
        'hicolor-icon-theme'
        'libgl'
        'libx11'
        'libxcb'
        'libxkbcommon'
        'libxkbcommon-x11'
        'libxt'
        'wayland'
        'xcb-util-cursor'
        'xcb-util-image'
        'xcb-util-keysyms'
        'xcb-util-renderutil'
        'xcb-util-wm'
        'zlib')
    optdepends=(
        'at-spi2-core: for GTK2/GTK3 platformthemes plugins and GTK2 styles plugin'
        'cairo: for GTK3 platformthemes plugin'
        'gdk-pixbuf2: for GTK2/GTK3 platformthemes plugins and GTK2 styles plugin'
        'gtk2: for GTK2 platformthemes and styles plugins'
        'gtk3: for GTK3 platformthemes plugin'
        'pango: for GTK2/GTK3 platformthemes plugins and GTK2 styles plugin'
        'virtualbox-bin-guest-iso: for guest additions CD image'
        'virtualbox-bin-sdk: for the software developer kit'
        'virtualbox-ext-oracle: for Oracle extensions pack')
    provides=("virtualbox=${pkgver}" 'virtualbox-host-dkms' 'VIRTUALBOX-HOST-MODULES')
    #conflicts=('virtualbox' 'virtualbox-host-dkms' 'virtualbox-host-modules-arch')
    conflicts=('virtualbox' 'virtualbox-host-dkms')
    replaces=('virtualbox_bin' 'virtualbox-sun')
    backup=('etc/vbox/vbox.cfg')
    options=('!debug' '!emptydirs' '!strip')
    
    local _installdir='opt/VirtualBox'
    
    # install bundled files
    install -d -m755 "${pkgdir}/opt"
    cp -Pr --no-preserve='ownership' "${pkgbase}-${pkgver}/VirtualBox-extracted" "${pkgdir}/${_installdir}"
    
    # mark binaries suid root, and make sure the directory is only writable by the user
    chmod 4755 "${pkgdir}/${_installdir}"/{VirtualBoxVM,VBox{Headless,Net{AdpCtl,DHCP,NAT},VolInfo}}
    chmod go-w "${pkgdir}/${_installdir}"
    
    # remove guest iso and bundled sdk files
    rm -r "${pkgdir}/${_installdir}"/{additions/VBoxGuestAdditions.iso,sdk}
    
    # module sources_pypath
    install -d -m755 "${pkgdir}/usr/src"
    mv "${pkgdir}/${_installdir}/src/vboxhost" "${pkgdir}/usr/src/vboxhost-${pkgver}_non_OSE"
    
    # module reloading shortcut (with a symlink with default helper)
    install -D -m755 vboxreload -t "${pkgdir}/usr/bin"
    ln -s vboxreload "${pkgdir}/usr/bin/rcvboxdrv"
    
    # do not enable KVM virtualization on module load
    install -D -m0644 virtualbox.modprobe "${pkgdir}/usr/lib/modprobe.d/virtualbox.conf"
    
    # udev rules
    ## we need to copy and not symlink VBoxCreateUSBNode.sh in /usr/lib/udev to avoid udevd
    ## to look /opt when /opt is not mounted. This can be done until VBoxCreateUSBNode.sh doesn't
    ## need more stuff from /opt
    install -D -m644 60-vboxdrv.rules -t "${pkgdir}/usr/lib/udev/rules.d"
    install -D -m755 "${pkgdir}/${_installdir}/VBoxCreateUSBNode.sh" -t "${pkgdir}/usr/lib/udev"
    install -D -m755 "${pkgdir}/${_installdir}/VBoxCreateUSBNode.sh" -t "${pkgdir}/usr/share/virtualbox"
    
    # configuration file
    install -D -m644 <(printf '%s\n' "INSTALL_DIR=/${_installdir}") "${pkgdir}/etc/vbox/vbox.cfg"
    
    # modules-load.d configuration
    install -D -m644 <(printf 'vboxdrv\nvboxnetadp\nvboxnetflt\n') "${pkgdir}/usr/lib/modules-load.d/${pkgname}.conf"
    
    # systemd
    install -D -m644 vboxweb.service -t "${pkgdir}/usr/lib/systemd/system"
    install -D -m644 virtualbox.sysusers "${pkgdir}/usr/lib/sysusers.d/virtualbox.conf"
    
    # symlinks
    local _dir
    local _file
    install -d -m755 "${pkgdir}/usr/share"/{applications,{doc,licenses}/"$pkgname",mime/packages,pixmaps}
    for _file in vboxwebsrv VirtualBox{,VM} VBox{Manage,SDL,VRDP,Headless,Autostart,BalloonCtrl,BugReport,DTrace}
    do
        ln -s "../../${_installdir}/VBox.sh" "${pkgdir}/usr/bin/${_file}"
        [ "$_file" != 'vboxwebsrv' ] && ln -s "../../${_installdir}/VBox.sh" "${pkgdir}/usr/bin/${_file,,}"
    done
    ln -s "../../../${_installdir}/VBoxSysInfo.sh" "${pkgdir}/usr/share/virtualbox/VBoxSysInfo.sh"
    ln -s "../../../usr/src/vboxhost-${pkgver}_non_OSE" "${pkgdir}/${_installdir}/src/vboxhost"
    ln -s "../../../${_installdir}/VBox.png" "${pkgdir}/usr/share/pixmaps/VBox.png"
    ln -s "../../../${_installdir}/virtualbox.desktop" "${pkgdir}/usr/share/applications/virtualbox.desktop"
    ln -s "../../../../${_installdir}/virtualbox.xml" "${pkgdir}/usr/share/mime/packages/virtualbox.xml"
    ln -s "../../../../${_installdir}/UserManual.pdf" "${pkgdir}/usr/share/doc/${pkgname}/UserManual.pdf"
    ln -s "../../../../${_installdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    ## hicolor icons
    while read -r -d '' _file
    do
        if grep -Eq '/virtualbox\.(png|svg)$' <<< "$_file"
        then
            _dir="${_file%/*}/apps"
        else
            _dir="${_file%/*}/mimetypes"
        fi
        install -d -m755 "${pkgdir}/usr/share/icons/hicolor/${_dir}"
        ln -s "../../../../../../${_installdir}/icons/${_dir%/*}/${_file##*/}" \
            "${pkgdir}/usr/share/icons/hicolor/${_dir}/${_file##*/}"
    done < <(find "${pkgdir}/${_installdir}/icons" -type f -print0 | sed -z "s|${pkgdir}/${_installdir}/icons/||")
    ## workaround for unsupported $ORIGIN/.. in VBoxC.so
    for _file in VBox{RT,XPCOM}.so
    do
        ln -s "../${_file}" "${pkgdir}/${_installdir}/components/${_file}"
    done
    
    # [url]https://www.virtualbox.org/ticket/22193[/url]
    # [url]https://bbs.archlinux.org/viewtopic.php?pid=2199183#p2199183[/url]
    ln -s ../../usr/lib/libdl.so.2 "${pkgdir}/${_installdir}/libdl.so"
    ln -s ../../usr/lib/libpthread.so.0 "${pkgdir}/${_installdir}/libpthread.so"
    ln -sr /usr/lib/libdl.so.2 "${srcdir}/${pkgbase}-${pkgver}/VirtualBox-extracted/libdl.so"
    ln -sr /usr/lib/libpthread.so.0 "${srcdir}/${pkgbase}-${pkgver}/VirtualBox-extracted/libpthread.so"
}

package_virtualbox-bin-guest-iso() {
    pkgdesc='VirtualBox guest additions ISO image for use with virtualbox-bin package'
    arch=('any')
    provides=('virtualbox-guest-iso')
    
    install -D -m644 "${pkgbase}-${pkgver}/VirtualBox-extracted/additions/VBoxGuestAdditions.iso" \
        -t "${pkgdir}/opt/VirtualBox/additions"
}

package_virtualbox-bin-sdk() {
    pkgdesc='VirtualBox software developer kit for use with virtualbox-bin package'
    arch=('any')
    license=('LGPL-2.1-only' 'GPL-3.0-only' 'LicenseRef-Custom')
    depends=('python')
    optdepends=('java-runtime: for webservice java bindings')
    provides=('virtualbox-sdk')
    conflicts=('virtualbox-sdk')
    
    local _dir
    local _installdir='opt/VirtualBox'
    
    install -d -m755 "${pkgdir}/${_installdir}/sdk"
    while read -r -d '' _dir
    do
        cp -Pr --no-preserve='ownership' "$_dir" "${pkgdir}/${_installdir}/sdk"
    done < <(find "${pkgbase}-${pkgver}/sdk" -mindepth 1 -maxdepth 1 -type d ! -name 'installer' -print0)
    
    install -D -m644 "VBoxAuth-r${_rev}.h"    "${pkgdir}/${_installdir}/sdk/bindings/auth/include/VBoxAuth.h"
    install -D -m644 "VBoxAuthPAM-r${_rev}.c" "${pkgdir}/${_installdir}/sdk/bindings/auth/VBoxAuthPAM.cpp"
    install -D -m644 "VBoxAuthSimple-r${_rev}.cpp" "${pkgdir}/${_installdir}/sdk/bindings/auth/VBoxAuthSimple.cpp"
    install -D -m644 LICENSE.sdk "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    
    python -m installer --destdir="$pkgdir" "${pkgbase}-${pkgver}/sdk/installer/python/vboxapi/dist"/*.whl
    
    local _sitepkgs
    _sitepkgs="$(python -c 'import site; print(site.getsitepackages()[0])')"
    ln -s "../../../../${_installdir}/sdk/bindings/xpcom/python/xpcom" "${pkgdir}${_sitepkgs}/xpcom"
}

Last edited by szebenyib (2026-01-13 13:17:21)

Offline

Board footer

Powered by FluxBB