Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 945135 - app-emulation/virtualbox-7.1.4 fails with Kernel 6.12 autoloading KVM
Summary: app-emulation/virtualbox-7.1.4 fails with Kernel 6.12 autoloading KVM
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Viorel Munteanu
URL:
Whiteboard:
Keywords:
: 950667 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-11-27 18:37 UTC by James
Modified: 2025-03-07 05:38 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James 2024-11-27 18:37:16 UTC
Upgraded to gentoo-sources-6.12.1 today, and rebuilt my drivers to match.  When I attempted to start a virtualBox machine, it failed, saying, "Virtualbox can't enable the AMD-V extension.  Please disable the KVM kernel extension, recompile your kernel and reboot"

This seems to be a problem known to archlinux because they have released version 7.1.4-2 to counteract it:
https://bbs.archlinux.org/viewtopic.php?id=301155

There is a patch available here:
https://gitlab.archlinux.org/archlinux/packaging/packages/virtualbox/-/commit/e99e49f8fa8b18791c42a4aafd7da76fb6772b04

I haven't worked out how to apply the patch yet, but will see if I can and if so, will upload it here.

Thank You for EVERYTHING you do for Gentoo!

# emerge --info app-emulation/virtualbox
Portage 3.0.66.1 (python 3.12.7-final-0, default/linux/amd64/23.0/split-usr/desktop/plasma, gcc-12, glibc-2.40-r5, 6.12.1-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.12.1-gentoo-x86_64-AMD_Ryzen_7_5800X_8-Core_Processor-with-glibc2.40
KiB Mem:    32801656 total,  20689912 free
KiB Swap:   50331640 total,  50331640 free
Timestamp of repository gentoo: Wed, 27 Nov 2024 13:00:00 +0000
Head commit of repository gentoo: cdb17942ba205df33793d3da83f3327c638e5a50
Head commit of repository brave-overlay: 1ed453730611099e54d7bbcb964a19b96469f179

sh bash 5.2_p37
ld GNU ld (Gentoo 2.43 p3) 2.43.1
app-misc/pax-utils:        1.3.8::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.72-r1::gentoo
dev-build/automake:        1.17-r1::gentoo
dev-build/cmake:           3.31.1::gentoo
dev-build/libtool:         2.5.4::gentoo
dev-build/make:            4.4.1-r100::gentoo
dev-build/meson:           1.6.0::gentoo
dev-java/java-config:      2.3.4::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.12.7_p1::gentoo, 3.13.0::gentoo
dev-lang/rust-bin:         1.82.0-r100::gentoo
sys-apps/baselayout:       2.17::gentoo
sys-apps/openrc:           0.55.1::gentoo
sys-apps/sandbox:          2.40::gentoo
sys-devel/binutils:        2.43-r2::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/clang:           19.1.4::gentoo
sys-devel/gcc:             12.4.1_p20241114::gentoo, 13.3.1_p20241115::gentoo, 14.2.1_p20241116::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/llvm:            19.1.4::gentoo
sys-kernel/linux-headers:  6.11::gentoo (virtual/os-headers)
sys-libs/glibc:            2.40-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

Home
    location: /usr/local/portage
    masters: gentoo
    priority: 0
    volatile: True

brave-overlay
    location: /var/db/repos/brave-overlay
    sync-type: git
    sync-uri: https://gitlab.com/jason.oliveira/brave-overlay.git
    masters: gentoo
    volatile: False

local
    location: /var/db/repos/local
    masters: gentoo
    volatile: False

crossdev
    location: /var/db/repos/portage-crossdev
    masters: gentoo
    priority: 10
    volatile: True

Binary Repositories:

binhost
    priority: 9999
    sync-uri: https://mirrors.gethosted.online/gentoo/releases/amd64/binpackages/23.0/x86-64

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* PUEL"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/mnt/nfs_portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --buildpkg-exclude "virtual/* sys-kernel/*-sources""
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -march=native -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=native -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/     http://gentoo-mirror.flux.utah.edu/     http://www.gtlib.gatech.edu/pub/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
LINGUAS="en en_US"
MAKEOPTS="-j16 -l6"
PKGDIR="/mnt/nfs_portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
RUSTFLAGS="-C target-cpu=native"
SHELL="/bin/bash"
USE="X a52 aac aacs acl acpi activities alsa amd64 audiofile bluetooth bluray branding bzip2 cairo cdda cddb cdio cdr cet crypt css cuda cups dbus declarative dri dts dv dvb dvd dvdnav dvdr dvdread elogind enca encode exif extras ffmpeg flac fontconfig gdbm gif gimp gpm gtk gui iconv icu iec61883 ieee1394 imagemagick ipv6 java jpeg json kde kf6compat kwallet ladspa lame lcms libnotify libtirpc live lm-sensors lv2 mad midi mjpeg mng mp2 mp3 mp4 mpeg mtp musepack ncurses networkmanager nls nptl nvenc nvidia ogg openal opengl openmp pam pango pcre pda pdf pipewire pipewire-alsa plasma png policykit ppds pulseaudio qemu qml qt5 qt6 readline redistributable scanner screencast script sdl seccomp semantic-desktop snmp sound speech spell split-usr srt ssl startup-notification stubby svg test-rust theora threads tiff tools truetype udev udisks unicode upower ups_drivers_usbhid-ups usb usbredir v4l vcd vim-syntax vorbis vulkan wayland webkit widgets wxwidgets x264 x265 xattr xcb xft xinerama xml xmp xv xvfb xvid zlib" ABI_X86="64" ADA_TARGET="gcc_12" ALSA_CARDS="hda_intel usb_audio" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64 pc" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en_US en-US la" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LIBREOFFICE_EXTENSIONS="pdfimport presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PERL_FEATURES="ithreads" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" QEMU_SOFTMMU_TARGETS="x86_64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby31" SANE_BACKENDS="hp" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

app-emulation/virtualbox-7.1.4::gentoo was built with the following:
USE="alsa dbus gui java nls opengl pam pulseaudio sdk sdl udev vmmraw -debug -doc -dtrace -lvm (-pch) -python -test -vboxwebsrv -vde -vnc" PYTHON_SINGLE_TARGET="-python3_10 -python3_11"
Comment 1 James 2024-11-27 18:51:44 UTC
Sorry, should have digested the patches better...
All of that patching just stops kvm from starting on kernel load.  

This can be done by adding the kernel boot parameter:

kvm.enable_virt_at_load=0

or if you have kvm as a module, creating a virtualbox.modprobe (or similar) blocking the automatic enabling of the kvm module:

options kvm enable_virt_at_load=0

Why can't we all just play nicely together?
Comment 2 Viorel Munteanu gentoo-dev 2024-11-28 07:03:16 UTC
Thank you for the report.

If you were using branch 7.0, you could try virtualbox-kvm (experimental, currently masked), maybe it works.  Unfortunately they haven't released a patch compatible to branch 7.1 yet.

I will add that entry to modprobe.d.
Comment 3 Larry the Git Cow gentoo-dev 2024-11-28 07:17:51 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c015f5b659b23e7d091f841f5cd60cd63bbe1665

commit c015f5b659b23e7d091f841f5cd60cd63bbe1665
Author:     Viorel Munteanu <ceamac@gentoo.org>
AuthorDate: 2024-11-28 07:15:38 +0000
Commit:     Viorel Munteanu <ceamac@gentoo.org>
CommitDate: 2024-11-28 07:17:40 +0000

    app-emulation/virtualbox-modules: disable kvm enable_virt_at_load
    
    Disable kvm enable_virt_at_load for kernel 6.12+
    
    Closes: https://bugs.gentoo.org/945135
    Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>

 ...s-7.0.22.ebuild => virtualbox-modules-7.0.22-r1.ebuild} | 14 ++++++++++++++
 ...les-7.1.4.ebuild => virtualbox-modules-7.1.4-r1.ebuild} | 14 ++++++++++++++
 2 files changed, 28 insertions(+)
Comment 4 Viorel Munteanu gentoo-dev 2025-03-07 05:38:36 UTC
*** Bug 950667 has been marked as a duplicate of this bug. ***