thalium / icebox

Virtual Machine Introspection, Tracing & Debugging
MIT License
567 stars 86 forks source link

Failed to build kernel modules: build_in_tmp not found #16

Closed Wenzel closed 5 years ago

Wenzel commented 5 years ago

Hi,

I tried to follow the build procedure described in BUILD

And after unpacking the tarball, I have the following content: Capture d’écran de 2019-08-23 20-05-48

However, when I tried to load the kernel modules with sudo ./vboxdrv.sh start, it fails at the build stage: Capture d’écran de 2019-08-23 20-07-00

The directory linux.amd64.bin/src/build_in_tmp is not found.

Did i miss a step ? I am using Vagrant and Ansible to setup Icebox, you can review the virtualbox main task responsible for building Virtualbox here: https://github.com/Wenzel/vagrant-icebox/blob/master/ansible/roles/virtualbox/tasks/main.yml

Best regards, Mathieu

Wenzel commented 5 years ago

Adding -x to the shebang for debugging reveals that it's supposed to be a script, not a directory as I first thought:

+ echo Building the main VirtualBox module.
+ /vagrant/icebox/third_party/virtualbox/linux.amd64.bin/src/build_in_tmp --save-module-symvers /tmp/vboxdrv-Module.symvers --module-source /vagrant/icebox/third_party/virtualbox/linux.amd64.bin/src/vboxdrv --no-print-directory install
+ myerr=./vboxdrv.sh: 1: ./vboxdrv.sh: /vagrant/icebox/third_party/virtualbox/linux.amd64.bin/src/build_in_tmp: not found

Side question: is it possible to do a system-wide installation of Virtualbox ? Since i'm running inside a trashable Vagrant box, I don't mind installing it system-wide, in /usr/local

Thanks.

Fimbure commented 5 years ago

Hi,

We did not reproduce your bug but it seems to be related to this issue: https://www.virtualbox.org/ticket/1613 (maybe check if you have this "/etc/vbox/vbox.cfg" file)

Wenzel commented 5 years ago

hi @Fimbure ,

i checked my setup and I don't have a /etc/vbox/vbox.cfg on my system.

So i looked again at the problem, and found out that there was also a virtualbox installation in the out directory.

Building the kernel modules from this folder seems to work better:

vagrant@debian10:/vagrant/icebox/third_party/virtualbox/out/linux.amd64/release/bin$ sudo ./vboxdrv.sh restart
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: failed: Cannot change group vboxusers for device /dev/vboxdrv.
vagrant@debian10:/vagrant/icebox/third_party/virtualbox/out/linux.amd64/release/bin$ 

I'm now blocked by this issue, but at least i can build and load the modules.

Am I supposed to use:

Thanks

Wenzel commented 5 years ago

Ok, so i created manually the vboxusers group, added vagrant to it, and the modules are now loaded.

vagrant@debian10:/vagrant/icebox/third_party/virtualbox/out/linux.amd64/release/bin$ sudo ./vboxdrv.sh restart
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vagrant@debian10:/vagrant/icebox/third_party/virtualbox/out/linux.amd64/release/bin$ lsmod | grep vbox
vboxpci                28672  0
vboxnetadp             28672  0
vboxnetflt             32768  0
vboxdrv               479232  3 vboxpci,vboxnetadp,vboxnetflt
Fimbure commented 5 years ago

Ok fine ! Yes it's mentioned in the installation instructions here