Error occurred when running VirtualBox, some box popped out.

$ VirtualBox
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (2.6.24-21-386) or it failed to
         load. Please recompile the kernel module and install it by

           sudo /etc/init.d/vboxdrv setup

         You will not be able to start VMs until this problem is fixed.
WARNING: The compilation of the vboxdrv.ko kernel module failed during the
         installation for some reason. Starting a VM will not be possible.
         Please consult the User Manual for build instructions.

$ sudo /etc/init.d/vboxdrv setup
 * Stopping VirtualBox kernel module                                                                                                                                                   *  done.
 * Recompiling VirtualBox kernel module                                                                                                                                              
 * Look at /var/log/vbox-install.log to find out what went wrong

$ tail /var/log/vbox-install.log
Makefile:142: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again.  Stop.

$ sudo KERN_DIR=/usr/src/linux-source-2.6.24   /etc/init.d/vboxdrv setup
 * Stopping VirtualBox kernel module                                                                                                                                                   *  done.
 * Recompiling VirtualBox kernel module                                                                                                                                                *  done.
 * Starting VirtualBox kernel module                                                                                                                                                   *  done.

OK, it works.

$ dpkg -s virtualbox-2.0 | tail
Conflicts: virtualbox
Conffiles:
 /etc/init.d/vboxdrv 6e3cb8dd230d768740ce0c6e0ae6a86c
 /etc/init.d/vboxnet a3828b76a2fdfc0fb6908f2a76c86550
Description: Sun xVM VirtualBox
 VirtualBox is a powerful PC virtualization solution allowing you to run a
 wide range of PC operating systems on your Linux system. This includes
 Windows, Linux, FreeBSD, DOS, OpenBSD and others. VirtualBox comes with a broad
 feature set and excellent performance, making it the premier virtualization
 software solution on the market.

Advertisements

One thought on “

  1. But on a new install, kernel headers should be used.

    $ uname -a
    Linux zion 2.6.27-8-generic #1 SMP Thu Nov 6 17:33:54 UTC 2008 i686 GNU/Linux

    $ sudo apt-get install linux-source-2.6.27

    $ ln -sf linux-source-2.6.27 linux

    $ sudo /etc/init.d/vboxdrv setup
    * Stopping VirtualBox kernel module * done.
    * Recompiling VirtualBox kernel module
    * Look at /var/log/vbox-install.log to find out what went wrong

    $ tail /var/log/vbox-install.log
    /tmp/vbox.3/linux/SUPDrv-linux.c:956: warning: ‘cdecl’ attribute ignored
    /tmp/vbox.3/linux/SUPDrv-linux.c:966: warning: ‘cdecl’ attribute ignored
    /tmp/vbox.3/linux/SUPDrv-linux.c:992:5: warning: “LINUX_VERSION_CODE” is not defined
    /tmp/vbox.3/linux/SUPDrv-linux.c:992:27: warning: “KERNEL_VERSION” is not defined
    /tmp/vbox.3/linux/SUPDrv-linux.c:992:41: error: missing binary operator before token “(“
    /tmp/vbox.3/linux/SUPDrv-linux.c:995: error: expected ‘)’ before string constant
    make[2]: *** [/tmp/vbox.3/linux/SUPDrv-linux.o] Error 1
    make[1]: *** [_module_/tmp/vbox.3] Error 2
    make[1]: Leaving directory `/usr/src/linux-source-2.6.27'
    make: *** [vboxdrv] Error 2

    $ sudo apt-get install linux-headers-2.6.27-8-generic

    $ ls -l /lib/modules/2.6.27-8-generic/build
    lrwxrwxrwx 1 root root 39 2008-11-19 10:16 /lib/modules/2.6.27-8-generic/build -> /usr/src/linux-headers-2.6.27-8-generic

    19 November, 2008 10:22

    $ sudo /etc/init.d/vboxdrv setup
    * Stopping VirtualBox kernel module * done.
    * Recompiling VirtualBox kernel module * done.
    * Starting VirtualBox kernel module * done.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s