Page 1 of 2

modules: distro's vs guest addition's

Posted: 17. Sep 2016, 02:15
by kpreslan
I'm running Ubuntu Xenial in VBox 5.1.6 on three different hosts (two Mac and one Windows). Xenial's linux-image-4.4.0-*-generic and linux-image-extra-4.4.0-36-generic packages include 5.0.18 versions of vboxguest.ko, vboxsf.ko, and vboxvideo.ko. When I install the guest additions from "Devices"->"Insert Guest Additions CD Image...", VBox installs its own 5.1.16 versions of those modules. Those are the ones I want to run. On two of my hosts (one Mac and one Windows), it always insmods the 5.1.16 versions. On the other Mac, it keeps running the 5.0.18 versions of the modules.

Is it just random which version gets run? Do the guest additions try to control it somehow? What script/binary does it? How?

Thanks!

Re: modules: distro's vs guest addition's

Posted: 17. Sep 2016, 09:11
by socratis
kpreslan wrote:Is it just random which version gets run? Do the guest additions try to control it somehow? What script/binary does it? How?
Nothing is random in software (unless you use a random number generator ;) ). I believe that the problematic installation is running with the distro's GAs, because the VirtualBox GAs fail to install (due to the presence of the distro's GAs). The proper procedure would be to purge the distro GAs and then install the VirtualBox GAs.

Re: modules: distro's vs guest addition's

Posted: 17. Sep 2016, 21:46
by kpreslan
socratis wrote:I believe that the problematic installation is running with the distro's GAs, because the VirtualBox GAs fail to install (due to the presence of the distro's GAs). The proper procedure would be to purge the distro GAs and then install the VirtualBox GAs.
The distro's version of the kernel modules are part of the kernel's debs -- linux-image-4.4.0-36-generic and linux-image-extra-4.4.0-36-generic. I can't remove the modules in question through the package manager without removing the whole kernel as well. I do *not* have any virtualbox-specific debs installed.

I can go in and manually unlink the modules from /lib/modules/4.4.0-whatever and that fixes my problem. However, I'd have to redo that step every time I upgrade to a new kernel release.

Is that really what the VirtualBox authors intend us to do?

Re: modules: distro's vs guest addition's

Posted: 17. Sep 2016, 23:37
by Perryg
After reading this I can say that none of it makes sense. OS kernels do not have anything included from VirtualBox. The only thing I can think of is you have/had the distro fork of the GAs installed and tries to update the distro packages ( which will always be older ). Remove them and install the official version from VirtualBox package and it should sort this all out.

Re: modules: distro's vs guest addition's

Posted: 18. Sep 2016, 05:32
by kpreslan
I appreciate your help and I hate to keep arguing with you. However:

Go to the Ubuntu page that describes their latest Xenial kernel: http://packages.ubuntu.com/xenial-updat ... 36-generic

Part way down the page, there is a link called "list of files" for the amd64 architecture. Click on the link. It's http://packages.ubuntu.com/xenial-updat ... c/filelist. Search the resulting page for "vbox" and you get these two lines:

/lib/modules/4.4.0-36-generic/kernel/ubuntu/vbox/vboxguest/vboxguest.ko
/lib/modules/4.4.0-36-generic/kernel/ubuntu/vbox/vboxsf/vboxsf.ko

So, indeed, the vbox kernel modules do come as part of the standard Xenial kernel deb.

You can repeat the exercise with the linux-image-extras-4.4.0-36-generic package and find the vboxvideo.ko file.

Re: modules: distro's vs guest addition's

Posted: 18. Sep 2016, 09:03
by socratis
Ah, but that's not the kernel, is it? Those are packages included with the default distribution alongside the kernel. You can most certainly remove the custom VirtualBox packages and install the official ones. That's where I believe that Perryg had a problem with your statement and so do I : " I can't remove the modules in question through the package manager without removing the whole kernel as well."

Re: modules: distro's vs guest addition's

Posted: 18. Sep 2016, 17:21
by AALLeeXX
socratis wrote:The proper procedure would be to purge the distro GAs and then install the VirtualBox GAs.
Could you please explain how to purge the distros GA ? And how to differentiate the distro one from the official one ?
Just deleting all "*vobx*" files and folders when no GA is installed would be safe ?

Re: modules: distro's vs guest addition's

Posted: 18. Sep 2016, 17:38
by socratis
A new Wiki page was just written that might be of help for your situation: https://www.virtualbox.org/wiki/LinuxAdditionsDebug

Re: modules: distro's vs guest addition's

Posted: 18. Sep 2016, 19:27
by socratis
AALLeeXX wrote:Could you please explain how to purge the distros GA ?
I believe that in Ubuntu it would be:

Code: Select all

sudo apt-get purge virtualbox*
AALLeeXX wrote:And how to differentiate the distro one from the official one ?
The distro ones you install with your package manager from the distro's repository. The official ones you install via the "Devices"->"Insert Guest Additions CD Image...".
AALLeeXX wrote:Just deleting all "*vobx*" files and folders when no GA is installed would be safe ?
Nope, that would be a bad idea. You'll leave all sorts of trails behind that will need to be cleaned up.

Re: modules: distro's vs guest addition's

Posted: 20. Sep 2016, 02:02
by kpreslan
socratis wrote:Ah, but that's not the kernel, is it?
I'm sorry, but that's *exactly* the kernel. The fourth line in the "filelist" link from above is the kernel itself: /boot/vmlinuz-4.4.0-36-generic.

Or you can ask dpkg which package owns the kernel and vboxguest.ko. Both are owned by the same package, linux-image-4.4.0-36-generic.
# dpkg --search /boot/vmlinuz-4.4.0-36-generic /lib/modules/4.4.0-36-generic/kernel/ubuntu/vbox/vboxguest/vboxguest.ko
linux-image-4.4.0-36-generic: /boot/vmlinuz-4.4.0-36-generic
linux-image-4.4.0-36-generic: /lib/modules/4.4.0-36-generic/kernel/ubuntu/vbox/vboxguest/vboxguest.ko

The suggestion of "sudo apt-get purge virtualbox*" doesn't remove the modules because they aren't owned by any package with a name including the string "virtualbox". (They are owned by the kernel deb.) Maybe they are owned by virtualbox-something-or-other in releases prior to Xenial (16.04), but they are part of the kernel the the most-recent release.

Re: modules: distro's vs guest addition's

Posted: 20. Sep 2016, 02:17
by Perryg
Stop worrying about the kernel. It has nothing to do with VirtualBox.

If nothing else install synaptic and search for virtualbox. Remove anything there and install the official version.

Re: modules: distro's vs guest addition's

Posted: 20. Sep 2016, 07:57
by socratis
kpreslan wrote:they are part of the kernel the the most-recent release.
No, they are not. Not only that, but they are not even installed with the default installation.

You had me download and install 16.04 last night, just to be 100% sure, because I thought I was losing it. The default installation does not include any VirtualBox kernel modules (do you understand the difference between "kernel" and "kernel module"?), so installing the official VirtualBox GAs was no problem, no conflicts. Of course they are not listed as packages after the installation, so you cannot use 'apt-get' or Synaptic to act on them (add/update/remove).

Of course at the same time I was able to add/remove the Ubuntu GAs at will, either using 'Synaptic' or 'apt-get'. And of course not in parallel with the official GAs.

Re: modules: distro's vs guest addition's

Posted: 20. Sep 2016, 15:26
by kpreslan
I appreciate you guys taking the time to answer my questions. Thank you.

Re: modules: distro's vs guest addition's

Posted: 22. Sep 2016, 09:08
by AALLeeXX
Socratis wrote:The distro ones you install with your package manager from the distro's repository. The official ones you install via the "Devices"->"Insert Guest Additions CD Image...".
Sure but about the files found in the file system, just wanted to find out which of the files was part of which installation... but will try the apt purge should clean some stuff already.
Socratis wrote:
AALLeeXX wrote:Just deleting all "*vobx*" files and folders when no GA is installed would be safe ?
Nope, that would be a bad idea. You'll leave all sorts of trails behind that will need to be cleaned up.
Sure, thus is why I asked ;)

Well, thank you very much for the details. I ll try this soon...

Re: modules: distro's vs guest addition's

Posted: 24. Sep 2016, 05:17
by AALLeeXX
Mmm, untill now I installed the GA manually but since I got so many troubles, I'd like to check the simple one with the famous "Devices" menu.

I might be blind, but on Mac, I cannot find such a menu as well as the "Insert GA CD image".
When I select my VM running Ubuntu, the single menus entries I have are "VirtualBox VM" and "Input", and there, no option to install the GA or even mount the CD.

I usually monut an iso image either with the storage manager in the VM settings or through a shared folder with manual mount...
Is there any real difference between the "Devices"->"Insert Guest Additions CD Image..." you propose and the manual mounting and install ?