Page 1 of 1

Virtual box in Kali Linux

Posted: 8. Mar 2017, 21:29
by placebo
Hi All,

I updated and upgraded today my KALI Linux operation systems, and now my VM's in VirtualBox doesn't turn on.
I have tried to reinstall the virtualbox version:
virtualbox-5.1_5.1.14-112924~Ubuntu~yakkety_amd64.deb

Code: Select all

root@Hedgehog-lpt:# dpkg -i virtualbox-5.1_5.1.14-112924~Ubuntu~yakkety_amd64.deb 
(Reading database ... 392486 files and directories currently installed.)
Preparing to unpack virtualbox-5.1_5.1.14-112924~Ubuntu~yakkety_amd64.deb ...
Unpacking virtualbox-5.1 (5.1.14-112924~Ubuntu~yakkety) ...
Setting up virtualbox-5.1 (5.1.14-112924~Ubuntu~yakkety) ...
addgroup: The group `vboxusers' already exists as a system group. Exiting.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxdrv.service → /lib/systemd/system/vboxdrv.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxballoonctrl-service.service → /lib/systemd/system/vboxballoonctrl-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxautostart-service.service → /lib/systemd/system/vboxautostart-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxweb-service.service → /lib/systemd/system/vboxweb-service.service.
vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.
Processing triggers for systemd (232-18) ...
Processing triggers for gnome-menus (3.13.3-8) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for hicolor-icon-theme (0.15-1) ...
Processing triggers for shared-mime-info (1.8-1) ...
Then I installed the
Oracle_VM_VirtualBox_Extension_Pack-5.1.14-112924.vbox-extpack

When I try to run a machine I get this error:
Failed to open a session for the virtual machine Reporting VM.

Code: Select all

The virtual machine 'Reporting VM' has terminated unexpectedly during startup with exit code 1 (0x1).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MachineWrap
Interface: IMachine {b2547866-a0a1-4391-8b86-6952d82efaa0}
I also get a pop-up that says I need to run the following command:
/sbin/vboxconfig
because it can't find the virtualbox drivers.

Code: Select all

root@Hedgehog-lpt:# /sbin/vboxconfig
Created symlink /etc/systemd/system/multi-user.target.wants/vboxdrv.service → /lib/systemd/system/vboxdrv.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxballoonctrl-service.service → /lib/systemd/system/vboxballoonctrl-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxautostart-service.service → /lib/systemd/system/vboxautostart-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxweb-service.service → /lib/systemd/system/vboxweb-service.service.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.
dmesg:

Code: Select all

[10775.537555] vboxdrv: disagrees about version of symbol module_layout
[10801.444673] vboxdrv: disagrees about version of symbol module_layout
I'm running Kali Linux 2 Rolling 64 bit, I attached the Virtual machine log as requisted.
Please let me know if I need to add any other information.

Thanks

Re: Virtual box in Kali Linux

Posted: 8. Mar 2017, 21:49
by Perryg
It appears you had the distro fork installed and then tried to install the official version over that install. You should have gotten a warning about that the first time you tried but in any case you need to remove what you have and reboot then install the new version again and that should take care of your issue. Be sure to watch for any error messages.

Re: Virtual box in Kali Linux

Posted: 8. Mar 2017, 22:41
by placebo
Thank you for replay.

Code: Select all

root@lpt:/usr/share/virtualbox# apt-get remove virtualbox-
virtualbox-5.1     virtualbox-source  

root@lpt:/usr/share/virtualbox# apt-get remove virtualbox-5.1 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  kbuild libgsoap10 libqt5x11extras5 libsdl1.2debian libvncserver1 module-assistant virtualbox-source
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  virtualbox-5.1
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 162 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 393266 files and directories currently installed.)
Removing virtualbox-5.1 (5.1.14-112924~Ubuntu~yakkety) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for shared-mime-info (1.8-1) ...
Processing triggers for gnome-menus (3.13.3-8) ...
Processing triggers for hicolor-icon-theme (0.15-1) ...

root@lpt:/usr/share/virtualbox# apt-get remove virtualbox-source 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  kbuild libgsoap10 libqt5x11extras5 libsdl1.2debian libvncserver1 module-assistant
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  virtualbox-source
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 838 kB disk space will be freed.
Do you want to continue? [Y/n] Y
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
(Reading database ... 392486 files and directories currently installed.)
Removing virtualbox-source (5.1.12-dfsg-2) ...
root@lpt:/usr/share/virtualbox# 
Reboot

Code: Select all

root@lpt:# sudo dpkg -i virtualbox-5.1_5.1.14-112924~Ubuntu~yakkety_amd64.deb 
Selecting previously unselected package virtualbox-5.1.
(Reading database ... 392481 files and directories currently installed.)
Preparing to unpack virtualbox-5.1_5.1.14-112924~Ubuntu~yakkety_amd64.deb ...
Unpacking virtualbox-5.1 (5.1.14-112924~Ubuntu~yakkety) ...
Setting up virtualbox-5.1 (5.1.14-112924~Ubuntu~yakkety) ...
addgroup: The group `vboxusers' already exists as a system group. Exiting.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxdrv.service → /lib/systemd/system/vboxdrv.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxballoonctrl-service.service → /lib/systemd/system/vboxballoonctrl-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxautostart-service.service → /lib/systemd/system/vboxautostart-service.service.
Created symlink /etc/systemd/system/multi-user.target.wants/vboxweb-service.service → /lib/systemd/system/vboxweb-service.service.
vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.
Processing triggers for systemd (232-18) ...
Processing triggers for gnome-menus (3.13.3-8) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for hicolor-icon-theme (0.15-1) ...
Processing triggers for shared-mime-info (1.8-1) ...
Same error.

Re: Virtual box in Kali Linux

Posted: 8. Mar 2017, 22:59
by Perryg
There must be something left that is causing this problem for you. One other thing that concerns me. kali used to be a ubuntu fork but now if memory serves me it is debian based and that could cause an issue.

Re: Virtual box in Kali Linux

Posted: 8. Mar 2017, 23:05
by placebo
I think from my past attemnts to install, it's something related to the linux-headers,
But I don't know what else I can do.. the problems started when I did full upgrade to the system (dist-upgrade and upgrade)

Re: Virtual box in Kali Linux

Posted: 8. Mar 2017, 23:33
by Perryg
Then you can post the /var/log/vbox-install.log ( as an attachment ) and it should tell us if there is a header issue.

Re: Virtual box in Kali Linux

Posted: 9. Mar 2017, 10:53
by placebo
I have attached the last 140 lines from the file (that's what fit in 128Kib)
Thanks.

[Mod edit: removed partial, text log]

Re: Virtual box in Kali Linux

Posted: 9. Mar 2017, 14:35
by socratis
ZIP it first. Partial logs are not that useful. I've removed the text attachment so that you can add the proper one.

Re: Virtual box in Kali Linux

Posted: 9. Mar 2017, 15:24
by placebo
I attached the full vbox-install.log compressed to zip.
Thanks for the help.

Re: Virtual box in Kali Linux

Posted: 9. Mar 2017, 16:04
by Perryg
We don't see this issue too often but from the looks of it you probably do have a kernel/header/gcc issue on the host.
"uname -r" will tell you the running kernel and you can "ls -al /usr/src | grep $(uname -r)" to see if the headers match.
It could also be that the OS used the previous headers to build instead of compiling them properly and that would cause the "disagrees about version of symbol module_layout" if you still see it.

Note: this is a host issue IMHO and you would have this problem with any 3rd party package that needed to compile kernel mode drivers.

Re: Virtual box in Kali Linux

Posted: 9. Mar 2017, 16:17
by placebo
The headers match

Code: Select all

root@lpt:$ uname -r
4.9.0-kali2-amd64
root@lpt:$ ls -al /usr/src | grep $(uname -r)
drwxr-xr-x  4 root root     4096 Mar  3 08:01 linux-headers-4.9.0-kali2-amd64
And I don't have problems with different 3rd party addons :/

Any other ideas?

Re: Virtual box in Kali Linux

Posted: 9. Mar 2017, 16:28
by Perryg
And I don't have problems with different 3rd party addons
I didn't say all 3rd party applications. I said 3rd party applications that need to compile kernel mode drivers. Big difference.

Anyway the only thing that you can do AFAIK is to make sure that everything VirtualBox is purged, reboot, and try again. If anything is left over due to installing, removing, or deleting improperly it will fail. The OSE part is more of a concern to you at this point. The official version can not tell what needs to be removed or over written because it was built differently and with different configurations. If you can get a totally clean purge it should install fine. You might also want to consider simply reverting back to the distros OSE version and see if it will install and get you up and running again.