Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 939878 - app-emulation/virtualbox-7.1.0 cannot start any vm: Failed to open "/dev/vboxdrvu", errno=13, rc=VERR_VM_DRIVER_NOT_ACCESSIBLE
Summary: app-emulation/virtualbox-7.1.0 cannot start any vm: Failed to open "/dev/vbox...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Viorel Munteanu
URL: https://www.virtualbox.org//ticket/22...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-20 01:33 UTC by Alex Barker
Modified: 2024-10-21 13:52 UTC (History)
1 user (show)

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


Attachments
VBoxSVC.log (VBoxSVC.log,8.00 KB, text/plain)
2024-09-20 01:35 UTC, Alex Barker
Details
emerge-info.txt (emerge-info.txt,7.60 KB, text/plain)
2024-10-09 04:19 UTC, Alex Barker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Barker 2024-09-20 01:33:32 UTC
After upgrading to Plasma 6, I can not longer use Virtualbox. I'm starting plsama via startx, which may or may not be part of the problem. I have attached VBoxSVC.log which is the only log created, no vm log is created before crash. I find it a bit interesting that none of the /dev/vboxdrv* devices have group permissions for vboxusers, not sure if that's related.

Reproducible: Always

Steps to Reproduce:
1. Upgrade to Plasma 6
2. Make sure you are using KVM in virutalbox
3. Try to start any virtual machine
Actual Results:  
Virtualbox crashes with an obscure error and outputs 'Failed to open "/dev/vboxdrvu", errno=13, rc=VERR_VM_DRIVER_NOT_ACCESSIBLE' in the logs.

Expected Results:  
I expect Virutalbox to continue working.
Comment 1 Alex Barker 2024-09-20 01:35:00 UTC
Created attachment 903399 [details]
VBoxSVC.log
Comment 2 Alex Barker 2024-09-20 02:08:03 UTC
I just downgraded to 6.1, and things are back to functioning normally.

emerge -av1 =app-emulation/virtualbox-6.1.50-r3 =app-emulation/virtualbox-additions-6.1.50 =app-emulation/virtualbox-extpack-oracle-6.1.50 =app-emulation/virtualbox-modules-6.1.50-r2
Comment 3 Alex Barker 2024-09-20 02:19:45 UTC
7.0.20 also works well, so this problem is isolated to the latest 7.1.0 release.
Comment 4 Viorel Munteanu gentoo-dev 2024-09-20 14:00:38 UTC
I haven't seen any related ticket or discussion on their forum.  It should have access, VirtualBoxVM is installed setuid root.  Can you check the correct modules are loaded?
Comment 5 Alex Barker 2024-09-20 14:35:09 UTC
The correct modules were indeed loaded. I am using 6.11.0 but I don't think there would be a regression between 7.0 and 7.1 for the new kernel. Let me know if you think of anything else to check. I am at a loss on this one.
Comment 6 Viorel Munteanu gentoo-dev 2024-10-03 04:48:29 UTC
Please post the output of `emerge --info virtualbox`
Comment 7 Alex Barker 2024-10-09 04:19:14 UTC
Created attachment 905120 [details]
emerge-info.txt

I just tested 7.1.2 and that has the same problem. I was comparing the VBoxSVC.log between 7.1.2 and 7.0.20 and noticed that both are reporting "Failed to open "/dev/vboxdrvu", errno=13, rc=VERR_VM_DRIVER_NOT_ACCESSIBLE" but only 7.1.2 has the following two errors:

00:00:00.008819 main     rtldrNativeLoad: dlopen('/usr/lib64/virtualbox/libpthread.so', RTLD_NOW | RTLD_LOCAL) failed: /usr/lib64/virtualbox/libpthread.so: cannot open shared object file: No such file or directory
00:00:00.008834 main     rtldrNativeLoad: dlopen('/usr/lib64/virtualbox/libdl.so', RTLD_NOW | RTLD_LOCAL) failed: /usr/lib64/virtualbox/libdl.so: cannot open shared object file: No such file or directory
Comment 8 Viorel Munteanu gentoo-dev 2024-10-12 07:41:31 UTC
I tried to build it with your CFLAGS and USE flags, still works for me with both KVM and Legacy.

I looked in the logs, that error message is a red herring, I also have it:

00:00:01.541690 DCon04   Failed to open "/dev/vboxdrvu", errno=13, rc=VERR_VM_DRIVER_NOT_ACCESSIBLE

To find out where yout virtualbox is crashing, you need to compile it with debug symbols (-ggdb3), with FEATURES=-nostrip or splitdebug, then run it as root, because setuid binaries do not dump core.  Set `ulimit -c unlimited`, then run it directly:

/usr/lib64/virtualbox/VirtualBoxVM --startvm yourvmname

After it crashes check it dumped core, and try to obtain a backtrace with

gdb /usr/lib64/virtualbox/VirtualBoxVM core

and open a ticket upstream with the backtrace.


What you can also test is if something coming from your "-march=native" breaks the build.  Try to compile it with -march=x86-64, see if that fixes the issue.
Comment 9 Alex Barker 2024-10-13 15:51:06 UTC
(gdb) r --startvm "Windows 10 (LTSB)"
Starting program: /usr/lib64/virtualbox/VirtualBoxVM --startvm "Windows 10 (LTSB)"
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fc69fe556c0 (LWP 30655)]
[New Thread 0x7fc69f6546c0 (LWP 30659)]
[Thread 0x7fc69f6546c0 (LWP 30659) exited]
[Thread 0x7fc69fe556c0 (LWP 30655) exited]

!!Assertion Failed!!
Expression: RT_SUCCESS(rc) || (fFlags & RTR3INIT_FLAGS_TRY_SUPLIB)
Location  : /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Runtime/r3/init.cpp(442) int rtR3InitBody(uint32_t, int, char***, const char*)
Stack     :
00007fc6a3186f55 VBoxRT.so!RTAssertMsg2V+0x11b (rva:0x1cef55)

Failed to initialize the support library, rc=VERR_VM_DRIVER_VERSION_MISMATCH!

Thread 1 "VirtualBoxVM" received signal SIGTRAP, Trace/breakpoint trap.
0x00007fc6a324e8c2 in rtR3InitBody (fFlags=327680, fFlags@entry=65536, cArgs=cArgs@entry=0, ppapszArgs=ppapszArgs@entry=0x0, pszProgramPath=pszProgramPath@entry=0x0)
    at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Runtime/r3/init.cpp:451
warning: 451    /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Runtime/r3/init.cpp: No such file or directory
(gdb) bt
#0  0x00007fc6a324e8c2 in rtR3InitBody (fFlags=327680, fFlags@entry=65536, cArgs=cArgs@entry=0, ppapszArgs=ppapszArgs@entry=0x0, pszProgramPath=pszProgramPath@entry=0x0)
    at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Runtime/r3/init.cpp:451
#1  0x00007fc6a324ec1b in rtR3Init (fFlags=65536, cArgs=0, ppapszArgs=0x0, pszProgramPath=0x0) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Runtime/r3/init.cpp:615
#2  0x00005564573c9148 in supR3HardenedMainInitRuntime (fFlags=fFlags@entry=2) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp:2377
#3  0x00005564573c99c8 in SUPR3HardenedMain (pszProgName=0x5564573d203f "VirtualBoxVM", fFlags=2, argc=3, argv=0x55647c9102a0, envp=0x7ffe1afb04d8)
    at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp:2685
#4  0x00007fc6a349b3ee in ?? () from /lib64/libc.so.6
#5  0x00007fc6a349b4a9 in __libc_start_main () from /lib64/libc.so.6
#6  0x00005564573c7625 in _start ()
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-13 15:58:07 UTC
I wonder what it's mismatched with. No random copy in /usr/local or something?
Comment 11 Alex Barker 2024-10-13 16:30:54 UTC
> No random copy in /usr/local or something?

Not that I could find. 

plutonium244 /home/kwhat # find /usr -name VBoxRT.so 
/usr/lib64/virtualbox/VBoxRT.so
/usr/lib64/virtualbox/components/VBoxRT.so

plutonium244 /home/kwhat # equery b /usr/lib64/virtualbox/VBoxRT.so
 * Searching for /usr/lib64/virtualbox/VBoxRT.so ... 
app-emulation/virtualbox-7.1.2 (/usr/lib64/virtualbox/VBoxRT.so)

plutonium244 /home/kwhat # equery b /usr/lib64/virtualbox/components/VBoxRT.so
 * Searching for /usr/lib64/virtualbox/components/VBoxRT.so ... 
app-emulation/virtualbox-7.1.2 (/usr/lib64/virtualbox/components/VBoxRT.so -> ../VBoxRT.so)
app-emulation/virtualbox-7.1.2 (/usr/lib64/virtualbox/VBoxRT.so)

I did also try with -march=x86-64 just to make sure and that didn't fix it.
Comment 12 Viorel Munteanu gentoo-dev 2024-10-13 17:22:24 UTC
Yes, looks like a botched installation.  And that SIGTRAP is suspicious.  I can't figure out what's wrong.
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-13 17:30:24 UTC
I would depclean all virtualbox packages and then scan your system for anything referencing it.
Comment 14 Alex Barker 2024-10-14 10:19:11 UTC
Dep cleaned, verified everything was gone. Only installed virtualbox and the modules on 6.11.3 and now I get a different segfault in libc.

Thread 1 "VirtualBoxVM" received signal SIGSEGV, Segmentation fault.
0x00007f743d5b449d in ?? () from /lib64/libc.so.6
(gdb) bt
#0  0x00007f743d5b449d in ??? () at /lib64/libc.so.6
#1  0x00007f743d2843f2 in RTStrCopy (pszDst=0x7ffefee64e38 "", cbDst=3072, pszSrc=0x0) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Runtime/common/string/RTStrCopy.cpp:49
#2  0x00007f743d1edf93 in RTErrInfoSet (pErrInfo=0x7ffefee64e10, rc=-102, pszMsg=<optimized out>) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Runtime/common/err/errinfo.cpp:55
#3  RTErrInfoSet (pErrInfo=0x7ffefee64e10, rc=-102, pszMsg=<optimized out>) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Runtime/common/err/errinfo.cpp:48
#4  0x00007f743d32ddf4 in rtldrNativeLoad (pszFilename=0x55994fa70db8 "/usr/lib64/virtualbox/libpthread.so", phHandle=0x55994fa6d318, fFlags=<optimized out>, pErrInfo=0x7ffefee64e10)
    at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp:100
#5  0x00007f743d23c214 in RTLdrLoadEx (pszFilename=0x55994fa70db8 "/usr/lib64/virtualbox/libpthread.so", phLdrMod=0x7ffefee64df0, fFlags=0, pErrInfo=0x7ffefee64e10)
    at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Runtime/common/ldr/ldrNative.cpp:154
#6  0x00007f7438c50ad0 in nsDll::Load (this=this@entry=0x55994fd24d40) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/libs/xpcom18a4/xpcom/components/xcDll.cpp:212
#7  0x00007f7438c52748 in nsNativeComponentLoader::GetFactory (this=0x55994f854600, aCID=..., aLocation=<optimized out>, aType=<optimized out>, _retval=0x7ffefee65f08)
    at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/libs/xpcom18a4/xpcom/components/nsNativeComponentLoader.cpp:114
#8  0x00007f7438c5848e in nsFactoryEntry::GetFactory (this=0x55994fe63930, aFactory=0x7ffefee65f08, mgr=0x55994f6ac7a0) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/libs/xpcom18a4/xpcom/components/nsComponentManager.h:287
#9  nsComponentManagerImpl::CreateInstanceByContractID (this=0x55994f6ac7a0, aContractID=0x55994f6ac7a0 "\3401\3128t\177", aDelegate=0x0, aIID=..., aResult=0x7ffefee65f88)
    at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp:1941
#10 nsComponentManagerImpl::CreateInstanceByContractID (this=this@entry=0x55994f6ac7a0, aContractID=aContractID@entry=0x55994fe44940 "@mozilla.org/ipc/dconnect-service;1", aDelegate=aDelegate@entry=0x0, aIID=..., aResult=0x7ffefee65f88)
    at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp:1898
#11 0x00007f7438c55d84 in nsComponentManagerImpl::GetServiceByContractID (this=0x55994f6ac7a0, aContractID=0x55994fe44940 "@mozilla.org/ipc/dconnect-service;1", aIID=..., result=0x7ffefee66040)
    at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp:2361
#12 0x00007f7438c759a5 in nsGetServiceByContractID::operator() (this=0x7ffefee66130, aIID=..., aInstancePtr=0x7ffefee66040) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/libs/xpcom18a4/xpcom/glue/nsComponentManagerUtils.cpp:121
#13 0x00007f7438c75c0c in nsCOMPtr_base::assign_from_helper (this=this@entry=0x7ffefee66100, helper=..., iid=...) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/libs/xpcom18a4/xpcom/glue/nsCOMPtr.cpp:114
#14 0x00007f7438c5f20a in nsCOMPtr<nsISupports>::nsCOMPtr (this=0x7ffefee66100, helper=...) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/out/linux.amd64/release/bin/sdk/bindings/xpcom/include/xpcom/nsISupportsUtils.h:209
#15 NS_CreateServicesFromCategory (category=category@entry=0x7f7438c787bc "xpcom-startup", origin=origin@entry=0x0, observerTopic=observerTopic@entry=0x7f7438c787bc "xpcom-startup")
    at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/libs/xpcom18a4/xpcom/components/nsCategoryManager.cpp:793
#16 0x00007f7438c77210 in VBoxNsxpNS_InitXPCOM2 (result=<optimized out>, binDirectory=<optimized out>, appFileLocationProvider=0x55994f691440) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/libs/xpcom18a4/xpcom/build/nsXPComInit.cpp:628
#17 0x00007f74329fdaed in com::Initialize (fInitFlags=fInitFlags@entry=3) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Main/glue/initterm.cpp:743
#18 0x00007f743258780e in COMBase::InitializeCOM (fGui=fGui@entry=true) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.cpp:98
#19 0x00007f7432610a04 in UIGlobalSession::prepare (this=0x55994fa268c0) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Frontends/VirtualBox/src/globals/UIGlobalSession.cpp:79
#20 0x00007f74325f1749 in UICommon::prepare (this=0x55994f69d770) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Frontends/VirtualBox/src/globals/UIGlobalSession.h:62
#21 0x00007f74325f33dd in UICommon::create (enmType=enmType@entry=UIType_RuntimeUI) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp:123
#22 0x00007f7438e76519 in TrustedMain (argc=<optimized out>, argv=<optimized out>) at /var/tmp/portage/app-emulation/virtualbox-7.1.2/work/VirtualBox-7.1.2/src/VBox/Frontends/VirtualBox/src/main.cpp:560
#23 0x00007f743d4813ee in ??? () at /lib64/libc.so.6
#24 0x00007f743d4814a9 in __libc_start_main () at /lib64/libc.so.6
#25 0x000055992bb4e605 in _start ()
Comment 15 Viorel Munteanu gentoo-dev 2024-10-18 14:24:30 UTC
(In reply to Alex Barker from comment #9)
> 
> Failed to initialize the support library, rc=VERR_VM_DRIVER_VERSION_MISMATCH!
> 

You get VERR_VM_DRIVER_VERSION_MISMATCH when the kernel modules do not match.  It is a different message from VERR_VM_DRIVER_NOT_ACCESSIBLE and it is fixable with a simple reboot.  I usually run this after updating:

rmmod vboxnetadp; rmmod vboxnetflt; rmmod vboxdrv; modprobe vboxdrv; modprobe vboxnetflt; modprobe vboxnetadp

As for VERR_VM_DRIVER_NOT_ACCESSIBLE, I don't know what could cause it other than a permission problem, which should happen as long as you are in the vboxusers, because VirtualBoxVM is setuid root.

If you get this crash consistently, you should update your upstream ticket, because what you uploaded there is the run with the mismatching kernel modules.

Also, do you also get the crash if you run `VirtualBoxHeadless --startvm yourvmname` instead of `VirtualBoxVM`?  Sometimes it writes more info this way.
Comment 16 Viorel Munteanu gentoo-dev 2024-10-18 14:26:49 UTC
Also please check the bug linked by Sam, maybe it's the same issue.
Comment 17 Alex Barker 2024-10-21 13:09:36 UTC
Same problem, different paths:

ln -s /lib64/libdl.so.2 /usr/lib64/virtualbox/libdl.so
ln -s /lib64/libpthread.so.0 /usr/lib64/virtualbox/libpthread.so
Comment 18 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-21 13:11:12 UTC
(In reply to Alex Barker from comment #17)
> Same problem, different paths:
> 
> ln -s /lib64/libdl.so.2 /usr/lib64/virtualbox/libdl.so
> ln -s /lib64/libpthread.so.0 /usr/lib64/virtualbox/libpthread.so

I think your issue is certainly bug 941622.
Comment 19 Alex Barker 2024-10-21 13:52:34 UTC
Definitely, the synlinks resolved the issue. I am leaving the computer for 7 days. If you figure out what caused this feel free to close. If you need me to test/check stuff, I can respond when I am back.