Page 1 of 1

[Solved] Can't install guest additons in Kali Linux 2018.4

Posted: 17. Jan 2019, 14:03
by Nota
I am using VirtualBox 6.0.2 on Windows host. When I execute the install script, it returns:

Code: Select all

nota@kali:~$ sudo ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.0.2 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.0.2 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: Running kernel modules will not be replaced until the system is restarted
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: modprobe vboxsf failed
That makes it impossible for me to share directories. What should I do? Thanks.

Re: Can't install guest additons in Kali Linux 2018.4

Posted: 17. Jan 2019, 18:42
by JeanR
As a first step I'd suggest you post the (zipped) contents of your /var/log/vboxadd-setup.log
also the output of 'lsmod vboxsf', 'modprobe vboxsf' or 'dmesg |grep vboxsf' might be of interest

Re: Can't install guest additons in Kali Linux 2018.4

Posted: 17. Jan 2019, 20:14
by socratis
The "modprobe vboxsf failed" is most of the times (if not always) a red herring, a no-error. Unless you have other specific issues, you can safely ignore it.
Nota wrote:That makes it impossible for me to share directories
That *is* indeed a more specific issue. What do you see? What's the error that you're getting?

Re: Can't install guest additons in Kali Linux 2018.4

Posted: 18. Jan 2019, 15:07
by Nota
JeanR wrote:As a first step I'd suggest you post the (zipped) contents of your /var/log/vboxadd-setup.log
also the output of 'lsmod vboxsf', 'modprobe vboxsf' or 'dmesg |grep vboxsf' might be of interest
The content of /var/log/vboxadd-setup.log is only

Code: Select all

Building the main Guest Additions module for kernel 4.19.0-kali1-amd64.
Building the shared folder support module.
Building the graphics driver module.
(Why did it build for kernel 4.19? My kernel version is 4.18.0)

Both "lsmod |grep vboxsf" and "dmesg |grep vboxsf" returns nothing. And "modprobe vboxsf" says

Code: Select all

modprobe: FATAL: Module vboxsf not found in directory /lib/modules/4.18.0-kali2-amd64

Re: Can't install guest additons in Kali Linux 2018.4

Posted: 18. Jan 2019, 15:20
by Nota
socratis wrote:That *is* indeed a more specific issue. What do you see? What's the error that you're getting?
There's a directory located at /media/sf_vbox_share_dir, which is empty. (that directory is not empty indeed)
When I execute "mount -t vboxsf /media/sf_vbox_share_dir/ /root/vbox_share_dir/" it says

Code: Select all

/sbin/mount.vboxsf: mounting failed with the error: No such device

Re: Can't install guest additons in Kali Linux 2018.4

Posted: 18. Jan 2019, 16:39
by JeanR
This is not the error socratis was asking for. The fact is, you have no kernel module yet for Shared Folders (vboxsf) so any attempts to use it will fail with an errorcode nobody is interested in.

What matters are the error messages during module compilation, which we haven't seen yet. Your problem can be anything from:
  1. not having a C-Compiler (I think we can rule that one out)
  2. not having the kernel-header (and in some cases the kernel-devel) packages for your distro and current kernel
    (in fact this was the root cause in my case, on fedora the latter package is now required to build vboxsf)
    IMHO the package name for kali seems to be linux-headers-4.19.0-kali1-amd64.deb and linux-image-dbg-4.19.0-kali1-amd64.deb respectively
    (use version 4.18.0 instead if uname -a reports you're still on 4.18)
  3. not using the correct image for the GA's, use the Devices -> insert Guest Additions CD image from the Hosts Vbox menu as described in viewtopic.php?f=29&t=15679
What I don't understand however, is that you don't see any errormessages on dmesg or in the logs that indicate the failure. Have you run the 'dmesg|grep vbox' cmd right after trying to build the GA's (i.e. not after a subsequent reboot)

As a workaround in the meantime you might try to copy files to/from your host with scp or any variant thereof (midnight-commander fishfs, sshfs over fuse, etc.)

Re: Can't install guest additons in Kali Linux 2018.4

Posted: 19. Jan 2019, 05:49
by Nota
JeanR wrote: 2) not having the kernel-header (and in some cases the kernel-devel) packages for your distro and current kernel
(in fact this was the root cause in my case, on fedora the latter package is now required to build vboxsf)
You inspired me that my kernel-header version (4.19) does not match my kernel version. After I upgrade the kernel it builds successfully! And now the directory sharing works well. Thanks!

Re: Can't install guest additons in Kali Linux 2018.4

Posted: 19. Jan 2019, 07:19
by socratis
Glad you got it going, marking as [Solved].

Re: [Solved] Can't install guest additons in Kali Linux 2018.4

Posted: 23. Jan 2019, 14:45
by virtualboxnewbie
Dear Sir/Mdm,

I'm not too sure whether i should continue this post or start a new post.

as It is only 6 days old, I believe it may still be applicable.

while i was upgrading vbox guest addition from 5.2.14 to 5.2.24,
it did not upgrade.

Code: Select all

Uncompressing VirtualBox 5.2.24 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 5.2.20 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: Running kernel modules will not be replaced until the system is restarted
VirtualBox Guest Additions: Starting

guest addition still old one

Code: Select all

modinfo vboxguest

filename:       /lib/modules/4.1.12-112.16.4.el7uek.x86_64/weak-updates/vboxguest/vboxguest.ko
version:        5.2.14 r123301
license:        GPL
description:    Oracle VM VirtualBox Guest Additions for Linux Module
author:         Oracle Corporation
srcversion:     87A2347C02617B1A8239C8B
alias:          pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
depends:
vermagic:       4.1.12-94.3.4.el7uek.x86_64 SMP mod_unload modversions

kernel header is as follow

Code: Select all

[root@ol75-12201-se-client ~]# rpm -qa | grep kernel
kernel-uek-firmware-4.1.12-112.16.4.el7uek.noarch
abrt-addon-kerneloops-2.1.11-50.0.1.el7.x86_64
kernel-devel-3.10.0-862.11.6.el7.x86_64
kernel-3.10.0-862.el7.x86_64
kernel-headers-3.10.0-957.1.3.el7.x86_64
kernel-uek-4.1.12-112.16.4.el7uek.x86_64
kernel-tools-libs-3.10.0-862.el7.x86_64
kernel-tools-3.10.0-862.el7.x86_64
kernel-uek-devel-4.1.12-124.19.1.el7uek.x86_64

so is there any reason why I can't upgrade my vboox guest addition?

thanks a lot!

Re: [Solved] Can't install guest additons in Kali Linux 2018.4

Posted: 23. Jan 2019, 19:01
by toracat
Looks like your running kernel is kernel-uek-4.1.12-112.16.4.el7uek. Then you need a -devel package that matches it. It will be kernel-uek-devel-4.1.12-112.16.4.el7uek. Either that or update the kernel to the one that matches kernel-uek-devel-4.1.12-124.19.1.el7uek.

Re: [Solved] Can't install guest additons in Kali Linux 2018.4

Posted: 7. Feb 2019, 07:53
by umoon13
I have the same problem
Kali Linux 64 Bit 2018.4 guest system in VirtualBox 6.0.4 r 128413 (Qt5.6.2). Host Windows 10
after installing kernel version 18

solved the problem like this:
updated the system, updated the kernel to version Linux Kali 4.19.0, and then just like in debian:
sudo apt full-upgrade
reboot
sudo apt-get install build-essential module-assistant
sudo m-a prepare
mount /media/cdrom
sudo sh /media/cdrom/VBoxLinuxAdditions.run
reboot