Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Discussions related to using the OSE version of VirtualBox.
Post Reply
Adam_Ullrich56
Posts: 9
Joined: 14. Mar 2020, 16:58

Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Post by Adam_Ullrich56 »

I just downloaded the VirtualBox source code and built it using these instructions: https://www.virtualbox.org/wiki/Linux%2 ... structions
I want to build the source code with debug information, so I execute this:

Code: Select all

kmk BUILD_TYPE=debug
I am using a fresh Ubuntu installation as host operating system, but I got this error when I finished:
Image
VirtualBox kernel driver not Installed. The vboxdrv kernel module was either not loaded, /dev/vboxdrv is not set up properly, or you are using EFI Secure Boot and the module is not signed in the right way for your system. If necessary, try setting up the kernel module again by executing '/sbin/vboxconfig' as root (VERR_VM_DRIVER_NOT_INSTALLED).


Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
ConsoleWrap
Interface:
IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
I tried executing /sbin/vboxconfig as root as the error message suggest, but when I do I get this as response:

Code: Select all

sudo: /sbin/vboxconfig: command not found
Some people suggest in some forums to execute this command:

Code: Select all

modprobe vboxdrv
but it throws me this error:

Code: Select all

modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/5.4.0-33-generic
What can I do?
Attachments
Screenshot from 2020-06-04 08-43-48.png
Screenshot from 2020-06-04 08-43-48.png (64.83 KiB) Viewed 37487 times
Adam_Ullrich56
Posts: 9
Joined: 14. Mar 2020, 16:58

Re: Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Post by Adam_Ullrich56 »

I just tried to compile VirtualBox without debug information (I need VirtualBox compiled with debug information, but I tried this just to see if I have any problems):

Code: Select all

source ./env.sh
kmk all
cd out/linux.amd64/release/bin/src/
make
sudo make install
cd ..
modprobe vboxdrv
sudo /sbin/vboxconfig
Now I get this error instead:
Image
Cannot access the kernel driver!

The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing

'/sbin/vboxconfig'

as root.

If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.
I tried executing '/sbin/vboxconfig' as root, but I get this error:

Code: Select all

sudo: /sbin/vboxconfig: command not found
Attachments
Screenshot from 2020-06-04 10-28-56.png
Screenshot from 2020-06-04 10-28-56.png (48.78 KiB) Viewed 37486 times
Adam_Ullrich56
Posts: 9
Joined: 14. Mar 2020, 16:58

Re: Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Post by Adam_Ullrich56 »

Fixed.

Basically I had to recompile the kernel with this:

Code: Select all

sudo ./vboxdrv.sh setup
Note: If you get an error like "UICommon.so not found" afterwards try changing current directory to the root folder of VirtualBox source code and execute this:

Code: Select all

sudo chmod -R 777 ./
Adam_Ullrich56
Posts: 9
Joined: 14. Mar 2020, 16:58

Re: Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Post by Adam_Ullrich56 »

I am going to paste here all commands in order that I had to execute in my Ubuntu 20.04 LTS 64 bits to make life of other developers easier:
Tip: copy and paste all the commands in a script.sh file, make it executable with chmod u+x script.sh and then execute it with sudo.
In total it takes around 1.5 hours to get everything compiled.

Code: Select all

wget https://download.virtualbox.org/virtualbox/6.1.8/VirtualBox-6.1.8.tar.bz2

tar -xvf VirtualBox-6.1.8.tar.bz2
rm VirtualBox-6.1.8.tar.bz2

sudo apt-get install -y acpica-tools chrpath doxygen g++-multilib libasound2-dev libcap-dev \
            libcurl4-openssl-dev libdevmapper-dev libidl-dev libopus-dev libpam0g-dev \
            libpulse-dev libqt5opengl5-dev libqt5x11extras5-dev libsdl1.2-dev libsdl-ttf2.0-dev \
            libssl-dev libvpx-dev libxcursor-dev libxinerama-dev libxml2-dev libxml2-utils \
            libxmu-dev libxrandr-dev make nasm python3-dev python-dev qttools5-dev-tools \
            texlive texlive-fonts-extra texlive-latex-extra unzip xsltproc \
            \
            default-jdk libstdc++5 libxslt1-dev linux-kernel-headers makeself \
            mesa-common-dev subversion yasm zlib1g-dev

sudo apt-get install -y lib32z1 libc6-dev-i386 lib32gcc1 lib32stdc++6

sudo ln -s libX11.so.6    /usr/lib32/libX11.so 
sudo ln -s libXTrap.so.6  /usr/lib32/libXTrap.so 
sudo ln -s libXt.so.6     /usr/lib32/libXt.so 
sudo ln -s libXtst.so.6   /usr/lib32/libXtst.so
sudo ln -s libXmu.so.6    /usr/lib32/libXmu.so
sudo ln -s libXext.so.6   /usr/lib32/libXext.so

cd VirtualBox-6.1.8/
./configure --disable-hardening
source ./env.sh
kmk BUILD_TYPE=debug
cd out/linux.amd64/debug/bin/src/
make
sudo make install
cd ..
sudo ./vboxdrv.sh setup
sudo modprobe vboxdrv
cd ../../../../
sudo chmod -R 777 VirtualBox-6.1.8/
biggydanny
Posts: 4
Joined: 3. Aug 2020, 20:01

Re: Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Post by biggydanny »

hello , i ran the script on my newly upgraded distro but got modprobe: ERROR: could not insert 'vboxdrv': Exec format error
chmod: cannot access 'VirtualBox-6.1.8/': No such file or directory
I am still trying to find my feet with linux as am such a newbie, been trying to fix all this but i have failed and i dont wanna give up, please point me in the right direction step by step with a little visuals, am so lost i need your help
biggydanny
Posts: 4
Joined: 3. Aug 2020, 20:01

Re: Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Post by biggydanny »

please help
towo2099
Volunteer
Posts: 362
Joined: 18. Aug 2014, 21:53
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Android, Linux

Re: Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Post by towo2099 »

biggydanny wrote:please help
How we should?
You don't told your used Distro, that would be the 1st important info!
Then you use an old VBox version! Why?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Post by scottgus1 »

biggydanny, please don't bump a thread 10 minutes after you posted in it. This is a volunteer forum and no one is paid to monitor it, neither have you paid for support.

A bump after a week for a couple weeks might be OK, but not more often, as it would get obstreperous.
biggydanny
Posts: 4
Joined: 3. Aug 2020, 20:01

Re: Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Post by biggydanny »

Ok, this all happened after i upgraded my distro from Uuntu 18.04 to Ubuntu 20.04, after the upgrade, I needed to use VBox as i run some virtual machines and some software with it but was unable to use it because of the mentioned error above, I have tried everything mentioned as I also tried running the script above but in the end i still got the error message as in my last post, i hope that i have explained my self
multiOS
Volunteer
Posts: 800
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: Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Post by multiOS »

IME upgrading (as opposed to updating) any Host OS often results in disrupting software installations that inject 'drivers' etc. into the OS, i.e. the OS upgrade process might not have carried forward those essential parts of the original VirtualBox installation, resulting the error message you now get. Have you tried completely reinstalling/repairing the VirtualBox installation? There should be no impact on existing Virtual Machines, 'though you might have to re-register them if they do not reappear in the VirtualBox GUI automatically, but make sure you take full backups just in case.
biggydanny
Posts: 4
Joined: 3. Aug 2020, 20:01

Re: Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Post by biggydanny »

i did reinstall and repair virtualbox but am still getting the same error
multiOS
Volunteer
Posts: 800
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: Building VirtualBox 6.1.8 on Linux: VERR_VM_DRIVER_NOT_INSTALLED

Post by multiOS »

What response do you get to the command: sudo modprobe vboxdrv

If you get: "Could not insert 'vboxdrv': Operation not permitted" that suggests that EFI Secure Boot is possibly enabled and is blocking the installation.

After that, I'm stuck for further possibilities and someone with greater linux expertise is probably needed as I only use Linux distros as Guests. Ubuntu Forums might be a better source as it's most probably a Linux permissions issue.

EDIT: Have just searched and there is a message thread that has reached the same stage here with what seems to be the same situation: https://askubuntu.com/questions/1262515 ... ed-rc-1908
Post Reply