# Kernel modules [Solved]

## Nomad-71

I am trying to launch Virtual Box, but when the virtual system starts i got the error:

```
VERR_VM_DRIVER_NOT_INSTALLED (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Re-setup the kernel module by executing

'/etc/init.d/vboxdrv setup'

as root. Users of Ubuntu or Fedora should install the DKMS package at first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.
```

 When i tried to execute '/etc/init.d/vboxdrv setup'

I have got the following error:

```
 * Stopping VirtualBox kernel module ...                                  [ ok ]

 * Recompiling VirtualBox kernel module ...

 * Look at /var/log/vbox-install.log to find out what went wrong

```

and the log is:

```
make KBUILD_VERBOSE=1 -C /lib/modules/2.6.25-gentoo-r7/build SUBDIRS=/tmp/vbox.1 SRCROOT=/tmp/vbox.1 modules

make[1]: Entering directory `/usr/src/linux-2.6.25-gentoo-r7'

make[1]: *** No rule to make target `modules'.  Stop.

make[1]: Leaving directory `/usr/src/linux-2.6.25-gentoo-r7'

make: *** [vboxdrv] Error 2
```

How to make it?

----------

## szczerb

Hmmm....do you have support for modules in your kernel?

----------

## Nomad-71

 *szczerb wrote:*   

> Hmmm....do you have support for modules in your kernel?

 

Yes, of course. 

executing /sbin/lsmod i can see modules which is currently loaded this is part of them

```

Module                  Size  Used by

ipv6                  238212  14 

snd_pcm_oss            45600  0 

snd_mixer_oss          22912  1 snd_pcm_oss

snd_seq_dummy          11780  0 

snd_seq_oss            36608  0 

snd_seq_midi_event     14976  1 snd_seq_oss

snd_seq                53744  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event

snd_seq_device         15628  3 snd_seq_dummy,snd_seq_oss,snd_seq

```

----------

## szczerb

Well then, sorry - I can't think of anything else.

BTW why do you have all that stuff built as modules?

That's my lsmod:

```
nomad szczerb # lsmod

Module                  Size  Used by

fuse                   57280  7 

vboxdrv              1638656  0 

snd_hda_intel         321228  1 

iwl3945                98424  0 
```

- fuse must be a module for fusesmb to work

- vboxdrv obviously can only be a module

- snd_hda_intel because I have to pass a model="lenovo" parameter

- iwl3945 because I sometimes need to reload it after hibernation

BTW2 Which version of VBox are you using? I have 2.0.4 and it works fine.

Also I didn't even know that there is an init script for VBox. I have the module added to autoload and to rebuild for a new kernel I use 'module-rebuild rebuild'

----------

## Nomad-71

 *szczerb wrote:*   

> Well then, sorry - I can't think of anything else.
> 
> BTW why do you have all that stuff built as modules?
> 
> That's my lsmod:
> ...

 

Reply to BTW: Really don't know - haven't remember that i built them.

Reply to BTW2: I am using 2.0.4 too, but before i have downloaded it from http://www.virtualbox.org i tried to emerge it.

----------

## szczerb

I just emerged it (first the OSE edition, but then bin because I wanted usb support - which I can't get working...) - never tried the "normal" version (actually I haven't installed anything manualy yet - just portage tree and overlays). If you'd like anything of my config to compare ask away.

----------

## Nomad-71

 *szczerb wrote:*   

> I just emerged it (first the OSE edition, but then bin because I wanted usb support - which I can't get working...) - never tried the "normal" version (actually I haven't installed anything manualy yet - just portage tree and overlays). If you'd like anything of my config to compare ask away.

 

When i tried to emerge OSE edition I have got the following message:

```
emerge: there are no ebuilds to satisfy "virtualbox".
```

When i tryed to emerge bin version i have got following error:

 *Quote:*   

> * Could not find a Makefile in the kernel source directory.
> 
>  * Please ensure that /usr/src/linux points to a complete set of Linux sources
> 
>  * 
> ...

 

----------

## KarlisRepsons

Just a quick idea: can virtualbox access compiled kernel tree (is there a correct link to /usr/src/linux)?

----------

## Nomad-71

 *KarlisRepsons wrote:*   

> Just a quick idea: can virtualbox access compiled kernel tree (is there a correct link to /usr/src/linux)?

 

Sorry, but where i can look that?

----------

## KarlisRepsons

ls -la /usr/src

How did you compile your kernel?

----------

## szczerb

You should get something similar:

```
szczerb@nomad ~ $ ls -l /usr/src/linux

lrwxrwxrwx 1 root root 16 XI 12 02:26 /usr/src/linux -> linux-2.6.28-rc4
```

If not then use 'eselect kernel list' to see the list of kernels and then 'eselect kernel set number_of_your_current_kernel_form_the_list'

----------

## Nomad-71

 *KarlisRepsons wrote:*   

> ls -la /usr/src
> 
> How did you compile your kernel?

 

I type ls -la /usr/src and got:

```
ls -la /usr/src

total 104

drwxrwxrwx  6 root root  4096 2008-11-14 18:26 .

drwxrwxrwx 17 root root  4096 2008-11-11 16:56 ..

drwxr-xr-x  2 root root  4096 2008-10-12 16:09 ati

-rwxrwxrwx  1 root root     0 2008-06-11 21:44 .keep

lrwxrwxrwx  1 root root    22 2008-11-14 16:33 linux -> linux-2.6.25-gentoo-r9

drwxrwxrwx 19 root root  4096 2008-10-11 22:19 linux-2.6.25-gentoo-r7

drwxr-xr-x 22 root root  4096 2008-11-14 17:18 linux-2.6.25-gentoo-r9

drwxr-xr-x  4  500  500  4096 2004-02-27 01:54 submount-0.9

-rw-r--r--  1 root root 75476 2008-10-14 19:32 submount-0.9.tar.gz

lrwxrwxrwx  1 root root    25 2008-11-13 21:43 vboxdrv-2.0.4 -> /opt/VirtualBox-2.0.4/src

```

ls -l /usr/src/linux

```
lrwxrwxrwx 1 root root 22 2008-11-14 16:33 /usr/src/linux -> linux-2.6.25-gentoo-r7
```

----------

## KarlisRepsons

Perhaps it doesn't take all that much, but a safe bet would be: rebuild your kernel, reboot, compile and configure virtualbox(-module(?s)). You should get first that far, so you can 

modprobe vboxdrv

and see it in lsmod! Is all I can help, it takes some reading to do.

----------

## Nomad-71

 *KarlisRepsons wrote:*   

> Perhaps it doesn't take all that much, but a safe bet would be: rebuild your kernel, reboot, compile and configure virtualbox(-module(?s)). You should get first that far, so you can 
> 
> modprobe vboxdrv
> 
> and see it in lsmod! Is all I can help, it takes some reading to do.

 

I rebuild my kernel and now virtualbox works fine. Thank you all for your help!

----------

## KarlisRepsons

You are welcome  :Smile: 

----------

