[Debian] /etc/init.d/virtualbox-ose setup fails

Discussions related to using the OSE version of VirtualBox.
Post Reply
mafiltenborg
Posts: 3
Joined: 19. Mar 2009, 09:16

[Debian] /etc/init.d/virtualbox-ose setup fails

Post by mafiltenborg »

Just upgraded to virtualbox 2.1.4 on a Debian Lenny system. Now the module fails to load.

So I issued '/etc/init.d/virtualbox-ose setup' as root and got this reply:
Stopping VirtualBox kernel module...done.
Recompiling VirtualBox kernel module...failed.

Checking /var/log/vbox-install.log yielded:
/etc/init.d/virtualbox-ose: line 283: /usr/lib/virtualbox/src/vboxdrv/build_in_tmp: No such file or directory

Hmmm... I've poked around for possible solutions, but no threads relating exactly to this problem seem to exist. No one but me succeeds in making the setup-script fail in line 283 :(
I've tried manually creating the directory path mode 777 - no luck.

Kernel is 2.6.26-1-686, relevant kernel headers have been installed, the virtualbox-ose-source package has been loaded and m-a prepare + m-a auto-install have been executed, all to no avail.

An so, I've run out of bright ideas. Thus I'll turn to you guys for assistance.

NB: The problem has been replicated on a similar system, running kernel 2.6.26-1-amd64.

//mA
mafiltenborg
Posts: 3
Joined: 19. Mar 2009, 09:16

Re: [Debian] /etc/init.d/virtualbox-ose setup fails

Post by mafiltenborg »

dmesg | grep vboxdrv: No banana, since my dmesg is huge. Virtualbox initialization is not present in part of init saved. virtualbox-ose tries loading, but doesn't succeed.

No, it's not built from source. Binary's merely been pulled from testing repo.

m-a prepare virtualbox-ose: OK
m-a build virtualbox-ose: Done OK
m-a install virtualbox-ose: dpkg warns me for downgrading the virtualbox-ose package, but otherwise works OK. Replaces virtualbox-ose-modules-2.6.26-1-amd64.
Everything according to plan :|

/etc/init.d/virtualbox-ose start executes silently, but doesn't install the module, causing GUI to fail... Message is

Virtual machine 'Win7' has terminated unexpectedly during startup.

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Machine
Interface: IMachine {ea6fb7ea-1993-4642-b113-f29eb39e0df0}

plus (in the nest msgbox):

VERR_VM_DRIVER_NOT_INSTALLED (rc=-1908)

I'm suggested to run /etc(init.d/virtualbox-ose setup.

Doing so returns
---
Stopping VirtualBox kernel module...done.
Removing old VirtualBox netflt kernel module...done.
Removing old VirtualBox kernel module...done.
Recompiling VirtualBox kernel module...failed.
---

Define 'stock kernel'? I'm running the 'stock' kernel found in repo. 2.6.26-1-amd64. Or -686. Matching headers. virtualbox-ose compiles/installs ok, using m-a...

Other repos? Yup - various, but most likely none that would bother m-a. No backports.

And again; on several machines!

'Win7' - and several other machines, including a DOS floppy-image, have run previously and are unmodified.
EagleFlyFree
Posts: 1
Joined: 26. Apr 2009, 01:46
Primary OS: Ubuntu 8.10
VBox Version: PUEL
Guest OSses: Linux

Re: [Debian] /etc/init.d/virtualbox-ose setup fails

Post by EagleFlyFree »

The error in the log is because build_in_tmp is not located there, possibly due to wrong paths in Debian's packages.

I solved the problem doing this:

1. installed virtualbox-ose-source and extracted /usr/src/virtualbox-ose.tar.bz2

2. edited /etc/init.d/virtualbox-ose to fix the paths:

Code: Select all

40,48c40,52
< if [ -n "$INSTALL_DIR" ]; then
<     VBOXMANAGE="$INSTALL_DIR/VBoxManage"
<     BUILDVBOXDRV="$INSTALL_DIR/src/vboxdrv/build_in_tmp"
<     BUILDVBOXNETFLT="$INSTALL_DIR/src/vboxnetflt/build_in_tmp"
< else
<     VBOXMANAGE="/usr/lib/virtualbox/VBoxManage"
<     BUILDVBOXDRV="/usr/share/virtualbox/src/vboxdrv/build_in_tmp"
<     BUILDVBOXNETFLT="/usr/share/virtualbox/src/vboxnetflt/build_in_tmp"
< fi
---
> VBOXMANAGE="/usr/bin/VBoxManage"
> BUILDVBOXDRV="/usr/src/modules/virtualbox-ose/vboxdrv/build_in_tmp"
> BUILDVBOXNETFLT="/usr/src/modules/virtualbox-ose/vboxnetflt/build_in_tmp"
> 
> #if [ -n "$INSTALL_DIR" ]; then
> #    VBOXMANAGE="$INSTALL_DIR/VBoxManage"
> #    BUILDVBOXDRV="$INSTALL_DIR/src/vboxdrv/build_in_tmp"
> #    BUILDVBOXNETFLT="$INSTALL_DIR/src/vboxnetflt/build_in_tmp"
> #else
> #    VBOXMANAGE="/usr/lib/virtualbox/VBoxManage"
> #    BUILDVBOXDRV="/usr/share/virtualbox/src/vboxdrv/build_in_tmp"
> #    BUILDVBOXNETFLT="/usr/share/virtualbox/src/vboxnetflt/build_in_tmp"
> #fi
3. build_in_tmp was failing because it copies /usr/share/virtualbox/src/vboxdrv and /usr/share/virtualbox/src/vboxnetflt to /tmp, but those dirs have some links with relative paths that were no longer valid inside /tmp.
I had to make them absolute with this:

Code: Select all

for dir in vboxdrv vboxnetflt; do
    cd /usr/share/virtualbox/src/$dir
    find . -type l | while read link; do sudo ln -Tfs `realpath $link` $link; done
done
Requires the realpath utility from the debian package with the same name, or some other way to get an absolute path from a relative one

4. ran /etc/init.d/virtualbox-ose setup, which succeeded.



This is a wild hack that begs for proper handling; while I research the proper places to report this as a bug, I thought I'd post this to help people in the meantime.
Hope to help.
mafiltenborg
Posts: 3
Joined: 19. Mar 2009, 09:16

Re: [Debian] /etc/init.d/virtualbox-ose setup fails

Post by mafiltenborg »

Cool :)

Copied your procedure up and including step 2, but after installing (using m-a in interactive mode) the module and modprobing it, the remaining steps were unneccesary. I'm not entirely sure why, but at least virtualbox runs now.

My procedure:
apt-get purge virtualbox-ose (remove any traces to start fresh)
apt-get install virtualbox-ose-modules-2.6.26-2-686 (See note)
apt-get install virtualbox-ose. This creates /etc/init.d/virtualbox-ose
Modify /etc/init.d/virtualbox-ose as directed by you
m-a. (get the virtualbox-source, build it, install it)
modprobe vboxdrv
Run the GUI, start a vbox. Success.

Reporting this bug would seem to be a very good idea, but i haven't been able to figure out who maintains the virtualbox packages at debian.org. Perhaps IRC on freenode (#debian) can help?

Anyways... Thanks a bundle, you provided just the right info to make things work :)


Note: Installing virtualbox-ose metapackage causes synaptic to preselect an entire linux-image-2.6.2-26-486 and accompanying headers, although i'm running on a -686 kernel + headers. I'd like it to stay on -686. Doing things in this sequence fixes the problem.
klor
Posts: 3
Joined: 22. Dec 2009, 13:54
Primary OS: MS Windows XP
VBox Version: OSE Debian
Guest OSses: Ubuntu

Re: [Debian] /etc/init.d/virtualbox-ose setup fails

Post by klor »

I have the same problem, but I can not figure how to fix it.
Could you explain for a beginner what and where should I change in /etc/init.d/virtualbox-ose ?
klor
Posts: 3
Joined: 22. Dec 2009, 13:54
Primary OS: MS Windows XP
VBox Version: OSE Debian
Guest OSses: Ubuntu

Re: [Debian] /etc/init.d/virtualbox-ose setup fails

Post by klor »

Finally solved the problem:
1) root@ubuntu:~# uname -r
2.6.28-17-server

2) apt-get install linux-headers
linux-headers-2.6.28-17-server 2.6.28-17.58
linux-headers-2.6.28-17-generic 2.6.28-17.58
linux-headers-2.6.28-17 2.6.28-17.58
linux-headers-2.6.28-16-server 2.6.28-16.57
linux-headers-2.6.28-16-generic 2.6.28-16.57
linux-headers-2.6.28-16 2.6.28-16.57
linux-headers-2.6.28-15-server 2.6.28-15.52
linux-headers-2.6.28-15-generic 2.6.28-15.52
linux-headers-2.6.28-15 2.6.28-15.52
linux-headers-2.6.28-14-server 2.6.28-14.47
linux-headers-2.6.28-14-generic 2.6.28-14.47
linux-headers-2.6.28-14 2.6.28-14.47
linux-headers-2.6.28-13-server 2.6.28-13.45
linux-headers-2.6.28-13-generic 2.6.28-13.45
linux-headers-2.6.28-13 2.6.28-13.45
linux-headers-2.6.28-3-rt 2.6.28-3.12
linux-ports-headers-2.6.28-6 2.6.28-6.20
linux-headers-2.6.28-11-server 2.6.28-11.42
linux-headers-2.6.28-11-generic 2.6.28-11.42
linux-headers-2.6.28-11 2.6.28-11.42

3) I selected my version, and installed linux-headers for it:
apt-get install linux-headers-2.6.28-17-server

4) Removed virtualbox:
apt-get purge virtualbox-ose

5) Installed virtualbox again:
apt-get install virtualbox-ose

* Starting VirtualBox kernel module... [ OK ]

SUCCESS!
Post Reply