Virtualbox 7.x wrong Guest Additions info at Runtime Information

Discussions about using Linux guests in VirtualBox.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Virtualbox 7.x wrong Guest Additions info at Runtime Information

Post by fth0 »

Thanks for the good wishes! :)
scottgus1 wrote:Am I missing something?
Good that you're asking, because you seem to be slightly wrong still (could be a consequence of my wording, of course ;)):
scottgus1 wrote:To clarify my understanding of mixed GAs installs in Linux VMs, I gather that #4 above says a mix of Linux-distro-preinstalled GAs and official ISO-based Virtualbox GAs isn't a problem, because the ISO's files override the preinstalled files.
Yes. You don't have to remove the Linux-distro-provided GA kernel modules, because the VirtualBox-provided GA kernel modules take precedence, but only if they have been installed successfully. BUT:
scottgus1 wrote:The mixup will show in the log and in "guestproperty" and "--version" outputs, but does not interfere with GAs operation.
No. The mix-up indicates that the installation of the VirtualBox-provided GA kernel modules failed, so that the older Linux-distro-provided GA kernel modules will still be used, in combination with the newer VirtualBox-provided GA applications, and this can lead to unexpected consequences.
scottgus1 wrote:I seem to remember some topics where folks had the mix-up and were having trouble, and a purge/reinstall from the ISO fixed things.
Yes. Users should avoid the mix-up by reinstalling the VirtualBox-provided GA kernel modules after ensuring the necessary pre-requisites (gcc, make, linux kernel headers).
nippur
Posts: 22
Joined: 16. May 2012, 19:00

Re: Virtualbox 7.x wrong Guest Additions info at Runtime Information

Post by nippur »

fth0 wrote:You cannot even spend a week on vacation here. :lol:
:D
fth0 wrote:To explain a few details apparently missing in this thread:

1) The VirtualBox Guest Additions (GA) for Linux consist of kernel modules (e.g. vboxguest.ko, vboxsf.ko) and applications (e.g. VBoxService, VBoxClient). While the applications are delivered and installed as binaries, the kernel modules are delivered as sources and get build during the GA installation. The necessary prerequisites are documented in Guest Additions for Linux, and a text console window displays success and error messages during the GA installation. In the case of errors, the Linux system admin often ends up with a partial GA installation (GA applications only).
agree
fth0 wrote:2) Many Linux distributions pre-install an older version (e.g. 6.0.0) of the VirtualBox kernel modules (e.g. vboxguest.ko) as part of their Linux kernel module packages (e.g. linux-modules-extra-*), as a default fallback. This can also be considered a partial GA installation (GA kernel modules only).
In itself not untrue. But i am talking about starting up a LIveDVD of Fedora. A live dvd wil boot your lap/pc from DVD/USB-stick to show you the OS - and only that. FedoraLive starts with GA 6.0.0 active *before installing anything*. You will be able to explore Fedora without installing anything.
If you like what you see, you can choose to install it to a hard drive- in my case a VirtuaBox VM hard drive which isn't even there yet. It will install the GA version packed on DVD, not the version used for booting and seizing an installation screen.
In my case it installed (fresh) GA 6.1.38 of repo Fedora 37 (latest). So GA 6.0.0. was never on my hard drive, it always run from DVD only. There is no need to install a kernel with a pre-made obsolete version of a GA module to the hard drive first (if that is what you mean) and at the same time install a newer version, since the newer version module is the only one used while booting the hard disk for the very first time. There is no need for a pre-made one, so why bother.
After the first boot of the VM, my *system* tells me GA 6.1.38 is (as expected) active. I can test that (see screenshots above) - my system doesn't lie. However, RI still reports GA 6.0.0 is active. Hence my problem.
fth0 wrote:3) If the Linux system admin ignores the error messages in 1) above, they end up with the combination of the correct GA applications from 1) and the obsolete GA kernel modules from 2). A log message reporting vboxguest in version 6.0.0 is a telltale sign of such a mixed installation of the GA.
what kind of sysadmin would ignore *that*
fth0 wrote:4) It's not necessary to get rid of the obsolete GA kernel modules from 2), because they are automatically overridden by correctly installed current versions. If the Linux system admin wants to do that nonetheless, they cannot simply uninstall the whole Linux kernel module package (because it contains lots of different kernel modules), but only by selectively blacklisting the VirtualBox-related ones.
true
fth0 wrote:Does this help you to answer the 60.000 dollar question? ;) Feel free to ask otherwise.
So actually - it doesn't - sorry
nippur
Posts: 22
Joined: 16. May 2012, 19:00

Re: Virtualbox 7.x wrong Guest Additions info at Runtime Information

Post by nippur »

What puzzles me the most:
how is it possible that Runtime Information says there is no GA active when i blacklist 'vboxguest', but when i whitelist that module again RI reports GA 6.0.0 is active while output of "VBoxControl guestproperty enumerate" and "/usr/sbin/VBoxService --version" tells me GA 6.1.38 is active? All three probe the same vboxguest module, so ...
2 agains 1
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Virtualbox 7.x wrong Guest Additions info at Runtime Information

Post by fth0 »

nippur wrote:what kind of sysadmin would ignore *that*
Judging from the hundreds of VBox.log files that I've seen in the last years, I'd say many, but not too many. But one could argue that the presentation of the errors by VirtualBox could use some enhancement: If the sysadmin only reads the first and last lines of the 20+ lines of text, they won't notice.

Regarding your main question, let's try and find out:
nippur wrote:There is no need to install a kernel with a pre-made obsolete version of a GA module to the hard drive first (if that is what you mean) and at the same time install a newer version, since the newer version module is the only one used while booting the hard disk for the very first time.
You're overlooking the fact that the kernel module package from my explanation 2) contains the obsolete VirtualBox kernel modules in addition to a lot of other (often needed) kernel modules, so it's all or nothing.

On a Debian/Ubuntu/Mint host, I'd use modinfo $(find /lib/modules -name "vboxguest*") to check for all installed versions of the VirtualBox kernel module vboxguest. Try this or a similar command in your installed Fedora 37 guest.
nippur wrote:All three probe the same vboxguest module
I'd beg to differ. ;) vboxguest has a version, and VBoxService has a version, too. And if those versions are not the same, ...
nippur
Posts: 22
Joined: 16. May 2012, 19:00

Re: Virtualbox 7.x wrong Guest Additions info at Runtime Information

Post by nippur »

Thanks for your ansewere, i ll do a fresh VM install and will look into it again. I thougt that all modules/binairies were compiled when all dependicies are met, or non if they were not (all or none). So they all would have had the same version.
Can't explain why Fedora ships an incompatible update of that module, though. They know that update will fail. Doesn't make sense, does it?
nippur
Posts: 22
Joined: 16. May 2012, 19:00

Re: Virtualbox 7.x wrong Guest Additions info at Runtime Information

Post by nippur »

Attached is the situation just after first boot. Output of modinfo $(find /lib/modules -name "vboxguest*"), uname -r, /usr/sbin/VBoxService --version, VBoxControl guestproperty enumerate, lsmod | grep vboxguest, locate vboxguest, modinfo $(find /usr/lib/modules -name "vboxguest*") -search from /usr/- and modinfo vboxguest. No version numbers to tie to active vboxguest module, RI reports 6.0.0. - active version is 6.1.38. What do you make of it?
Attachments
Situation-after-fresh-install.zip
(2.44 KiB) Downloaded 5 times
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Virtualbox 7.x wrong Guest Additions info at Runtime Information

Post by fth0 »

nippur wrote:What do you make of it?
Challenge accepted! ;)

Ah, compressed kernel modules. To find the real version number, try something like

Code: Select all

xzcat /lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/virt/vboxguest/vboxguest.ko.xz | strings | grep "version=6"
nippur
Posts: 22
Joined: 16. May 2012, 19:00

Re: Virtualbox 7.x wrong Guest Additions info at Runtime Information

Post by nippur »

ty for your efforts, very kind

The output was empty helas
Output of 'xzcat /lib/modules/6.0.7-301.fc37.x86_64/kernel/drivers/virt/vboxguest/vboxguest.ko.xz | strings | grep "version"' gave:
(/lib is symlink to /usr/lib on this system btw)
-----------------------

vbg_query_host_version
vboxguest: Bogus VMMDev memory; version=%08x (expected %08x) size=%d (expected <= %d)
vboxguest: host-version: %s %#x
host_version
host_version
host_version_show
req_version
min_version
session_version
vbg_ioctl_driver_version_info
vmmdev_host_version
dev_attr_host_version
host_version_show

----------------------------

Some other queries didn't reveal version number(s) also
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Virtualbox 7.x wrong Guest Additions info at Runtime Information

Post by fth0 »

Hmm, then the compressed kernel modules somehow work differently. To give you an example from a Linux Mint 20 (Ubuntu-derived) VM:

Code: Select all

$ find /lib/modules -name "vboxguest*"
/lib/modules/5.4.0-137-generic/misc/vboxguest.ko
/lib/modules/5.4.0-137-generic/kernel/virtualbox-guest/vboxguest.ko

$ strings $(find /lib/modules -name "vboxguest.ko") | grep "version=6"
version=6.1.42 r155177
version=6.1.38_Ubuntu r153438

$ modinfo $(find /lib/modules -name "vboxguest.ko")
filename:       /lib/modules/5.4.0-137-generic/misc/vboxguest.ko
version:        6.1.42 r155177
license:        GPL
description:    Oracle VM VirtualBox Guest Additions for Linux Module
author:         Oracle Corporation
srcversion:     FF3AA1D31371ED0480AFF7B
alias:          pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
depends:        
retpoline:      Y
name:           vboxguest
vermagic:       5.4.0-137-generic SMP mod_unload modversions 

filename:       /lib/modules/5.4.0-137-generic/kernel/virtualbox-guest/vboxguest.ko
version:        6.1.38_Ubuntu r153438
license:        GPL
description:    Oracle VM VirtualBox Guest Additions for Linux Module
author:         Oracle Corporation
srcversion:     2FDFA0C237EBF17ABD7B3E9
alias:          pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
depends:        
retpoline:      Y
name:           vboxguest
vermagic:       5.4.0-137-generic SMP mod_unload modversions
sig_id:         PKCS#7
signer:         Build time autogenerated kernel key
sig_key:        72:66:8D:80:49:29:E7:F7:A4:1E:1A:57:BA:B3:0E:5C:D3:3E:79:B4
sig_hashalgo:   sha512
signature:      4C:[...]
You can see that the Ubuntu-provided vboxguest.ko is signed, whereas the VirtualBox-provided vboxguest.ko is not (obviously, since it was built during its installation inside my VM). In your case, the compressed vboxguest.ko.xz is signed, indicating a pre-installed version.

Anyway, I checked in the VirtualBox sources that the Runtime Information dialog shows the version number returned by the currently running vboxguest kernel module. This version number is created in binary form at compile-time, so it doesn't matter if it's additionally available in text form for the modinfo command.
nippur
Posts: 22
Joined: 16. May 2012, 19:00

Re: Virtualbox 7.x wrong Guest Additions info at Runtime Information

Post by nippur »

Anyway, I checked in the VirtualBox sources that the Runtime Information dialog shows the version number returned by the currently running vboxguest kernel module. This version number is created in binary form at compile-time, so it doesn't matter if it's additionally available in text form for the modinfo command.
This explains a lot, though, very nice to know.

I've filed a bugreport against virtualbox-guest-additions at fedora.bugzilla.
Again, tyvm for your time
Post Reply