Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Virtualbox can't launch virtual machine
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
queen-D
n00b
n00b


Joined: 06 Feb 2024
Posts: 6

PostPosted: Sat Feb 17, 2024 10:37 pm    Post subject: [SOLVED] Virtualbox can't launch virtual machine Reply with quote

Hello Everyone

I am trying to launch a VM but I get all kinds of errors.

Code:
Kernel driver not installed (rc=-1908)

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.

where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.


I have the driver installed built in the kernel.

Running
Code:
 /sbin/vboxconfig
I get
Code:

* service vboxdrv added to runlevel default
 * service vboxballoonctrl-service added to runlevel default
 * service vboxautostart-service added to runlevel default
 * service vboxweb-service added to runlevel default
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: Look at /var/log/vbox-setup.log to find out what went wrong.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.  If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please s* service vboxdrv added to runlevel default
 * service vboxballoonctrl-service added to runlevel default
 * service vboxautostart-service added to runlevel default
 * service vboxweb-service added to runlevel default
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: Look at /var/log/vbox-setup.log to find out what went wrong.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.  If your system is using EFI Secure Boot you may 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.ee your Linux system's documentation for more information.


Code:
 
cat /var/log/vbox-setup.log
Building the main VirtualBox module.
Error building the module:
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/6.1.27-gentoo-r1-x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j8 modules
make[1]: warning: -j8 forced in submake: resetting jobserver mode.
make[1]: *** No rule to make target 'modules'.  Stop.
make: *** [/tmp/vbox.0/Makefile-footer.gmk:133: vboxdrv] Error 2


The options in the kernel are selected as needed (loadable module, virtualization) and described in the gentoo wiki.

I am using the binary version of VirtualBox 7.0.14. I ended up with the binary version because even with the sources, I had some problems.
The kernel version that I have is 6.1.27-gentoo-r1-x86_646.1.27-gentoo-r1-x86_64

Any help will be appreciated.
Queen


Last edited by queen-D on Mon Feb 26, 2024 3:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
Babiz
n00b
n00b


Joined: 18 Feb 2024
Posts: 26
Location: Dolomiti, Italy

PostPosted: Sun Feb 18, 2024 7:50 pm    Post subject: Reply with quote

Hello Queen, my guess is to follow step by step this https://wiki.gentoo.org/wiki/VirtualBox

Make sure before to revert your Virtualbox binary, then restart and take your time.
Good Luck! 8O
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54337
Location: 56N 3W

PostPosted: Sun Feb 18, 2024 8:18 pm    Post subject: Reply with quote

queen-D,

Welcome to Gentoo.

Code:
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/6.1.27-gentoo-r1-x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j8 modules
make[1]: warning: -j8 forced in submake: resetting jobserver mode.
make[1]: *** No rule to make target 'modules'.  Stop.
make: *** [/tmp/vbox.0/Makefile-footer.gmk:133: vboxdrv] Error 2


That says that virtualbox-modules is being built against kernel 6.1.27-gentoo-r1
but
Code:
make[1]: *** No rule to make target 'modules'.  Stop.
says than the makefile for 6.1.27-gentoo-r1 has gone.
Indeed, the 6.1.27-gentoo-r1 kernel has been removed from the ::gentoo repo.

Together, this suggests that you have a newer kernel in /usr/src and kernel 6.1.27-gentoo-r1 has been --depcleaned.

The way ahead is to update your installed kernel then build virtualbox-modules against the new kernel.
You will need to actually run the new kernel before virtualbox will start.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
queen-D
n00b
n00b


Joined: 06 Feb 2024
Posts: 6

PostPosted: Tue Feb 20, 2024 2:56 pm    Post subject: Reply with quote

NeddySeagoon wrote:
queen-D,

Welcome to Gentoo.

Code:
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/6.1.27-gentoo-r1-x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j8 modules
make[1]: warning: -j8 forced in submake: resetting jobserver mode.
make[1]: *** No rule to make target 'modules'.  Stop.
make: *** [/tmp/vbox.0/Makefile-footer.gmk:133: vboxdrv] Error 2


That says that virtualbox-modules is being built against kernel 6.1.27-gentoo-r1
but
Code:
make[1]: *** No rule to make target 'modules'.  Stop.
says than the makefile for 6.1.27-gentoo-r1 has gone.
Indeed, the 6.1.27-gentoo-r1 kernel has been removed from the ::gentoo repo.

Together, this suggests that you have a newer kernel in /usr/src and kernel 6.1.27-gentoo-r1 has been --depcleaned.

The way ahead is to update your installed kernel then build virtualbox-modules against the new kernel.
You will need to actually run the new kernel before virtualbox will start.


Hello Neddy

Thanks a lot for the pointer. Indeed the /usr/src/linux points to
Code:
  /usr/src/linux -> linux-6.1.67-gentoo

I uninstalled and reinstalled Virtualbox.run

However
Code:
uname -a
Linux mynet 6.1.27-gentoo-r1-x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 16 00:50:30 IDT 2023 x86_64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz GenuineIntel GNU/Linux
.

I think that the installation of Virtualbox.run takes the info from the uname -a parameter.

I installed virtualbox-modules and it looks that in this case it took the newer kernel version.
Still the problem exist and I can't launch a vm.

How do I go from here?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54337
Location: 56N 3W

PostPosted: Tue Feb 20, 2024 3:56 pm    Post subject: Reply with quote

queen-D,

Code:
/usr/src/linux -> linux-6.1.67-gentoo
is the kernel that all external kernel modules build against.
The actual name of the kernel can and does change but the /usr/src/linux link name is constant.

You are building for 6.1.67.

Code:
uname -a
tells about the actual kernel you have booted into, here 6.1.27.

Its not an error to build one kernel and its (external) modules while you run another. It can be a good thing.
Building external modules for 6.1.67 and trying to load them into 6.1.27 will fail for lots of reasons.

What we need to look at is why are you not booting into 6.1.67 ?

What does
Code:
ls -l /boot
tell ?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
queen-D
n00b
n00b


Joined: 06 Feb 2024
Posts: 6

PostPosted: Sat Feb 24, 2024 2:29 pm    Post subject: Reply with quote

NeddySeagoon wrote:
queen-D,

Code:
/usr/src/linux -> linux-6.1.67-gentoo
is the kernel that all external kernel modules build against.
The actual name of the kernel can and does change but the /usr/src/linux link name is constant.

You are building for 6.1.67.

Code:
uname -a
tells about the actual kernel you have booted into, here 6.1.27.

Its not an error to build one kernel and its (external) modules while you run another. It can be a good thing.
Building external modules for 6.1.67 and trying to load them into 6.1.27 will fail for lots of reasons.

What we need to look at is why are you not booting into 6.1.67 ?

What does
Code:
ls -l /boot
tell ?


Code:
ls -l /boot
total 193178
-rw-r--r-- 1 root root   249521 Dec 19 03:04 config-6.1.67-gentoo-dist
-rw-r--r-- 1 root root   265538 Feb  8 19:06 config-6.6.13-gentoo-dist
drwxr-xr-x 6 root root     1024 May 16  2023 grub
-rw-r--r-- 1 root root 11034504 May 16  2023 initramfs-6.1.27-gentoo-r1-x86_64.img
-rw-r--r-- 1 root root 11020252 May 16  2023 initramfs-6.1.27-gentoo-r1-x86_64.img.old
-rw-r--r-- 1 root root 32206285 Dec 19 03:04 initramfs-6.1.67-gentoo-dist.img
-rw-r--r-- 1 root root  7101260 Feb  6 16:55 initramfs-6.1.67-gentoo-x86_64.img
-rw------- 1 root root  5357568 Dec 19 22:34 initramfs-6.1.67-gentoo-x86_64.img.old
-rw-r--r-- 1 root root 33771903 Feb  8 19:06 initramfs-6.6.13-gentoo-dist.img
drwx------ 2 root root    12288 May 15  2023 lost+found
-rw-r--r-- 1 root root  4043299 May 16  2023 System.map-6.1.27-gentoo-r1-x86_64
-rw-r--r-- 1 root root  4043299 May 15  2023 System.map-6.1.27-gentoo-r1-x86_64.old
-rw-r--r-- 1 root root  6295956 Dec 19 03:04 System.map-6.1.67-gentoo-dist
-rw-r--r-- 1 root root  5215406 Feb  6 16:29 System.map-6.1.67-gentoo-x86_64
-rw-r--r-- 1 root root  4999937 Dec 19 22:03 System.map-6.1.67-gentoo-x86_64.old
-rw-r--r-- 1 root root  9451520 Feb  8 19:06 System.map-6.6.13-gentoo-dist
-rw-r--r-- 1 root root 10242240 May 16  2023 vmlinuz-6.1.27-gentoo-r1-x86_64
-rw-r--r-- 1 root root 10242272 May 15  2023 vmlinuz-6.1.27-gentoo-r1-x86_64.old
-rw-r--r-- 1 root root 13059520 Dec 19 03:04 vmlinuz-6.1.67-gentoo-dist
-rw-r--r-- 1 root root 13533312 Feb  6 16:30 vmlinuz-6.1.67-gentoo-x86_64
-rw------- 1 root root        0 Feb  6 15:29 vmlinuz-6.1.67-gentoo-x86_64.old
-rw-r--r-- 1 root root 15656896 Feb  8 19:06 vmlinuz-6.6.13-gentoo-dist


This is what /boot shows me. There was no more space in /boot so things were messed up.
Now I also see that I have installed also gentoo-sources version 6.6.13

Code:
eix gentoo-sources
[?] sys-kernel/gentoo-sources
     Available versions: 
     (4.14.309) [M]4.14.309^bs [M]4.14.309^bs[1]
     (4.14.312) [M]~4.14.312^bs [M]~4.14.312^bs[1]
     (4.14.313) [M]~4.14.313^bs [M]~4.14.313^bs[1]
     (4.14.314) [M]~4.14.314^bs [M]~4.14.314^bs[1]
     (4.19.282-r1) [M]4.19.282-r1^bs [M]4.19.282-r1^bs[1]
     (5.4.242-r1) [M]5.4.242-r1^bs [M]5.4.242-r1^bs[1]
     (5.10.179-r1) 5.10.179-r1^bs 5.10.179-r1^bs[1]
     (5.15.110-r1) 5.15.110-r1^bs 5.15.110-r1^bs[1]
     (5.15.111) ~5.15.111^bs ~5.15.111^bs[1]
     (6.1.27-r1) 6.1.27-r1^bs 6.1.27-r1^bs[1]
     (6.1.28) ~6.1.28^bs ~6.1.28^bs[1]
     (6.2.14-r1) ~6.2.14-r1^bs ~6.2.14-r1^bs[1]
     (6.2.15) ~6.2.15^bs ~6.2.15^bs[1]
     (6.3.1-r1) ~6.3.1-r1^bs ~6.3.1-r1^bs[1]
     (6.3.2) ~6.3.2^bs ~6.3.2^bs[1]
       {build experimental symlink}
     Installed versions:  6.1.67(6.1.67)^bs(03:47:31 PM 12/18/2023)(-build -experimental -symlink) 6.6.13(6.6.13)^bs(03:49:18 PM 02/06/2024)(-build -experimental -symlink)
     Homepage:            https://dev.gentoo.org/~mpagano/genpatches
     Description:         Full sources including the Gentoo patchset for the 6.3 kernel tree


I think I will switch to 6.6.13 kernel.
Code:
 eselect kernel list
Available kernel symlink targets:
  [1]   linux-6.1.67-gentoo *
  [2]   linux-6.1.67-gentoo-dist
  [3]   linux-6.6.13-gentoo
  [4]   linux-6.6.13-gentoo-dist
.

My plan is to remove and backup all the vmlinuz, system.map and initramfs in /boot, switch to kernel 6.6.13 and build everything against it. After that build again virtualbox-modules and virtualbox .
What do you say?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54337
Location: 56N 3W

PostPosted: Sat Feb 24, 2024 5:48 pm    Post subject: Reply with quote

queen-D,

If you BIOS boot, that looks OK.

It has
Code:
drwx------ 2 root root    12288 May 15  2023 lost+found
drwxr-xr-x 6 root root     1024 May 16  2023 grub

so it is the top level of a filesystem and it contains grub.

If you UEFI boot, I have some doubts.
UEFI booting starts from the EFI/ directory on the ESP.
That boot cannot be an ESP as EFI/ is missing and it has to be VFAT, whicd does not use lost+found.

Clear out some of the rubbish. When partitions fill up horrible things happen.

There is no need to
Quote:
build everything against it
Things that build against the kernel use kernel-headers, not the random kernel pointed to by /usr/src.
The exception being out of tree kernel modules.

Update your kernel,
Make sure the /usr/src/linux symlink points to the new kernel.
Run
Code:
emerge @module-rebuild
to build your out of tree kernel modules against /usr/src/linux
Reboot into the new kernel to test.

Run
Code:
uname -a
and check the running kernel build time, as its always good to be sure that you are running the kernel you think you are.

You may need to update app-emulation/virtualbox as virtualbox and virtualbox-modules must match.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Babiz
n00b
n00b


Joined: 18 Feb 2024
Posts: 26
Location: Dolomiti, Italy

PostPosted: Sat Feb 24, 2024 6:10 pm    Post subject: Reply with quote

Tip: install app-admin/eclean-kernel remove all kernels with it and follow direction of NeddySeagoon. above.

maybe you need to follow some handbook manual to ensure you set up right grub...
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader
Back to top
View user's profile Send private message
NichtDerHans
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jan 2023
Posts: 134

PostPosted: Sun Feb 25, 2024 7:29 am    Post subject: Reply with quote

There is a new "virtualbox-kvm": https://packages.gentoo.org/packages/app-emulation/virtualbox-kvm

It doesnt need the vbox modules :)


Its just a pity that the network configuration doesnt work completely like in the original. :(
Back to top
View user's profile Send private message
queen-D
n00b
n00b


Joined: 06 Feb 2024
Posts: 6

PostPosted: Mon Feb 26, 2024 1:37 pm    Post subject: Reply with quote

I managed to solve the problem. Now Virtualbox runs ok. I booted into the new kernel too. One of the problems was grub.cfg wasn't updated. I cleaned all the unneeded initramfs, vmlinuz and system.map.

However virtualbox-modules doesn't compile. Still Virtualbox runs OK. I think because I use the binary version from virtualbox.org site. Correct?

BTW, what should be the size of /boot? I realized that my size appears to be small ~256MB and in my case, pretty fast i ran out of space with a bunch of files.


Last edited by queen-D on Mon Feb 26, 2024 1:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
queen-D
n00b
n00b


Joined: 06 Feb 2024
Posts: 6

PostPosted: Mon Feb 26, 2024 1:38 pm    Post subject: Reply with quote

NichtDerHans wrote:
There is a new "virtualbox-kvm": https://packages.gentoo.org/packages/app-emulation/virtualbox-kvm

It doesnt need the vbox modules :)


Its just a pity that the network configuration doesnt work completely like in the original. :(


Yes, that's a pity. Otherwise it looks a very nice project. Once they will improve the network part, I will consider it.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54337
Location: 56N 3W

PostPosted: Mon Feb 26, 2024 3:06 pm    Post subject: Reply with quote

queen-D,

You need three sets of kernel files.

The set your are testing
The set you have been using,
The set you were using before that.
Plus space for your bootloader, if you have one.

Some spare space is good as kernel get ever bigger.
My 64MB is a bit cramped.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
queen-D
n00b
n00b


Joined: 06 Feb 2024
Posts: 6

PostPosted: Mon Feb 26, 2024 3:21 pm    Post subject: Reply with quote

NeddySeagoon wrote:
queen-D,

You need three sets of kernel files.

The set your are testing
The set you have been using,
The set you were using before that.
Plus space for your bootloader, if you have one.

Some spare space is good as kernel get ever bigger.
My 64MB is a bit cramped.


Thanks. I have right now 2 sets. 256MB and it wasn't enough (when I had 3 sets). The kernel didn't compile because there wasn't enough space. I had to move to an external HD
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum