Guest Additions Installed, but not working

Discussions about using Linux guests in VirtualBox.
puterboy
Posts: 17
Joined: 29. Sep 2019, 02:46

Guest Additions Installed, but not working

Post by puterboy »

I am running Ubuntu 18.04 guest (with mainline kernel 5.15.10) on a Windows 10 host with an i7 with 32Gb.
I have VBox 6.1.30 with compatible 6.1.30 Extensions and Guest additions installed on the Ubuntu client.
However, I cant get cut-and-paste, drag-n-drop or screen resizing to work (though I can get file sharing to work by manually mounting the vboxsf drive).
This used to work before under earlier 6.1.x versions but I am not sure what changed other than upgrading.

I compiled guest additions as per the instructions by mounting the iso on the client and manually running 'VBoxLinuxAdditions.run' and restarting both the Ubuntu VM client (as well as the Windows host for good measure).
The /var/log/vboxadd-install.log seems to show a successful compilation:

Code: Select all

VirtualBox Guest Additions: Starting.
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: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel
5.15.10-051510-generic.
update-initramfs: Generating /boot/initrd.img-5.15.10-051510-generic
VirtualBox Guest Additions: Running kernel modules will not be replaced until
the system is restarted
Clicking Right-Ctl-N and looking under the runtime tab shows that I indeed have Guest Additions 6.1.30 r148432
Running 'lsmod' shows that 'vboxguest' is installed.

Similarly, my syslog shows:

Code: Select all

kernel: [    6.705269] vboxguest: loading out-of-tree module taints kernel.
kernel: [    6.705733] vboxguest: module verification failed: signature and/or required key missing - tainting kernel
kernel: [    6.708104] loop25: detected capacity change from 0 to 448512
kernel: [    6.722423] vgdrvHeartbeatInit: Setting up heartbeat to trigger every 2000 milliseconds
kernel: [    6.723024] input: Unspecified device as /devices/pci0000:00/0000:00:04.0/input/input7
kernel: [    6.730790] vboxguest: Successfully loaded version 6.1.30 r148432
kernel: [    6.730848] vboxguest: misc device minor 123, IRQ 20, I/O port c140, MMIO at 00000000e8000000 (size 0x400000)
kernel: [    6.730856] vboxguest: Successfully loaded version 6.1.30 r148432 (interface 0x00010004)
...
...
systemd[1]: Starting vboxadd.service...
...
vboxadd[1210]: VirtualBox Guest Additions: Starting.
vboxadd[1210]: VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel
vboxadd[1210]: modules.  This may take a while
vboxadd[1210]: VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
vboxadd[1210]: VirtualBox Guest Additions: or
vboxadd[1210]: VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
...
vboxadd[1210]: VirtualBox Guest Additions: Running kernel modules will not be replaced until
vboxadd[1210]: the system is restarted
systemd[1]: Started vboxadd.service.
The log files on the host show:

Code: Select all

00:00:37.603465 VMMDev: Guest Additions information report: Version 6.1.30 r148432 '6.1.30'
00:00:37.603599 VMMDev: Guest Additions information report: Interface = 0x00010004 osType = 0x00053100 (Linux >= 2.6, 64-bit)
00:00:37.604167 VMMDev: Guest Additions capability report: (0x0 -> 0x0) seamless: no, hostWindowMapping: no, graphics: no
00:00:37.604448 VMMDev: vmmDevReqHandler_HeartbeatConfigure: No change (fHeartbeatActive=false)
00:00:37.604570 VMMDev: Heartbeat flatline timer set to trigger after 4 000 000 000 ns
00:00:37.604835 VMMDev: Guest Log: vgdrvHeartbeatInit: Setting up heartbeat to trigger every 2000 milliseconds
00:00:37.607360 GUI: UISession::sltAdditionsChange: GA state really changed, notifying listeners
00:00:37.607406 GUI: UIMachineViewNormal::adjustGuestScreenSize: Adjust guest-screen size if necessary
00:00:37.607461 GUI: UISession::sltAdditionsChange: GA state change event came, notifying listeners
00:00:37.607489 GUI: UIMachineLogicNormal::sltCheckForRequestedVisualStateType: Requested-state=0, Machine-state=5
00:00:37.607529 GUI: UISession::sltAdditionsChange: GA state change event came, notifying listeners
00:00:37.607552 GUI: UIMachineLogicNormal::sltCheckForRequestedVisualStateType: Requested-state=0, Machine-state=5
00:00:37.607587 GUI: UISession::sltAdditionsChange: GA state change event came, notifying listeners
00:00:37.607614 GUI: UIMachineLogicNormal::sltCheckForRequestedVisualStateType: Requested-state=0, Machine-state=5
00:00:37.682023 VMMDev: Guest Additions capability report: (0x0 -> 0x0) seamless: no, hostWindowMapping: no, graphics: no
00:00:37.687912 GUI: UISession::sltAdditionsChange: GA state change event came, notifying listeners
00:00:37.687952 GUI: UIMachineLogicNormal::sltCheckForRequestedVisualStateType: Requested-state=0, Machine-state=5
00:00:37.745890 VMMDev: Guest Log: vboxguest: Successfully loaded version 6.1.30 r148432
00:00:37.745980 VMMDev: Guest Log: vboxguest: misc device minor 123, IRQ 20, I/O port c140, MMIO at 00000000e8000000 (size 0x400000)
00:00:38.000591 Enabling different vbva mode
I have tried multiple times rebuilding guest additions, rebooting, etc to no avail.

Any thoughts on what might be wrong here?
puterboy
Posts: 17
Joined: 29. Sep 2019, 02:46

Re: Guest Additions Installed, but not working

Post by puterboy »

On the same Vbox instance, I went back to an old snapshot where I had kernel 5.11.0 and Guest Additions functionality all worked.
Could it be something about the 5.15.10 kernel that breaks Guest Additions?
(though the Guest Additions module seems to compile without issue as per above)
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Guest Additions Installed, but not working

Post by scottgus1 »

Probably best that we get a look at that log too.

Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.
puterboy wrote:I went back to an old snapshot where I had kernel 5.11.0 and Guest Additions functionality all worked.
If you installed the new GAs in this snapshot, then it could be the kernel difference. If you did not install or change the GAs, then the snapshot is still using its existing GAs, and them still working while running the snapshot is expected.
puterboy
Posts: 17
Joined: 29. Sep 2019, 02:46

Re: Guest Additions Installed, but not working

Post by puterboy »

Actually, it does *NOT* appear to be the kernel difference as I upgraded the kernel from the old working snapshot and it worked.
However, a later snapshot does not work -- and I can't see or recall any differences that would/should affect this.

I am attaching the log as requested
Attachments
VBox.log.gz
(29.36 KiB) Downloaded 11 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Guest Additions Installed, but not working

Post by scottgus1 »

The log is of a VM that is still running:
scottgus1 wrote:shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.
I see some attempts to change screen size, but the VM reverts to 1024 x 768. I did not see any attempted use of the shared clipboard or drag-n-drop.

Can you please try a test VM, install the latest kernel of your desired Linux OS, and try the GAs in that VM?
puterboy
Posts: 17
Joined: 29. Sep 2019, 02:46

Re: Guest Additions Installed, but not working

Post by puterboy »

scottgus1 wrote:The log is of a VM that is still running:
OK I will post another log
I see some attempts to change screen size, but the VM reverts to 1024 x 768. I did not see any attempted use of the shared clipboard or drag-n-drop.
I tried both screen size change and clipboard. I will do both again plus drag-n-drop in a new log (along with showing the machine shutdown)
Also, there are no differences in the display settings between the current snapshot that fails to resize the screen and the old one that does.
Can you please try a test VM, install the latest kernel of your desired Linux OS, and try the GAs in that VM?
I have already shown that it works with the same kernel by upgrading the kernel in an old snapshot so I don't think it's the kernel or my general installation (both snapshots are based on the same original installation but have diverged)

Note that cut/paste only cuts/paste what is in the clipboard on the Ubuntu guest and does not cut/paste what is in the clipboard from Windows.
Similarly drag-n-drop fails to work between guest & host.
Both the above do work on the old snapshot upgraded to 5.15.10.
But I can't figure out what is different about this new snapshot that is otherwise working fine and has the same kernel and same upgraded Ubuntu packages as the old snapshot.
Attachments
VBox.log.gz
(44.72 KiB) Downloaded 8 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Guest Additions Installed, but not working

Post by scottgus1 »

Scottgus1 wrote:Can you please try a test VM
The intent of this test is to try a completely fresh OS of the most recent kernel without all the changes that have been done in the VM, to clear away the possibility whether Virtualbox itself has the problem or the problem is from all the changes in a modified OS.

I will wait until you run the test.
puterboy
Posts: 17
Joined: 29. Sep 2019, 02:46

Re: Guest Additions Installed, but not working

Post by puterboy »

scottgus1 wrote:
Scottgus1 wrote:Can you please try a test VM
The intent of this test is to try a completely fresh OS of the most recent kernel without all the changes that have been done in the VM, to clear away the possibility whether Virtualbox itself has the problem or the problem is from all the changes in a modified OS.

I will wait until you run the test.
My point is that I think I have conclusively proved that it is not a VBox problem per se as I was able to take an older snapshot of the same original 18.04 Ubuntu installation, upgrade the kernel to the latest 5.15.10 and it WORKS.
But somehow the new snapshot which is a fork of the older snapshot but running the same latest kernel fails to work with GA.
I even ran apt update on the old snapshot to make sure that the packages are the same on the old working GA snapshot and the new non-working GA snapshot.

I am not aware of any changes to VM configs that should make GA fail on the newer snapshot fork.
I am indeed quite perplexed by this...
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Guest Additions Installed, but not working

Post by fth0 »

Let me throw in the name of a Software called Synergy. ;)

The VirtualBox hardening code rejects a DLL named synwinhk.dll, which tries to invade the address space of the VirtualBoxVM process. Synergy contains clipboard functionality, and the VirtualBox clipboard functionality has constantly changed during the 6.1.x release updates. How did/do you use Synergy in your setup(s)?
puterboy
Posts: 17
Joined: 29. Sep 2019, 02:46

Re: Guest Additions Installed, but not working

Post by puterboy »

I think I found the problem... though it's weird...
It seems that Guest Additions only works if ~/.Xauthority is owned by root.
I found this out by doing a binary search on comparing files between working and non-working instances.
If I change ownership to the user home, then GA fails, if I change it to root it works.

Now this is strange (to me) since under Ubuntu (or in my experience any X-based *nix GUI), /home/username/.Xauthority is usually owned by <username>.

Any ideas why GA only works if .Xauthority is owned by root?
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Guest Additions Installed, but not working

Post by fth0 »

There can be problems when using Wayland (google "Xwayland .Xauthority"). And if Wayland doesn't provide an X11 clipboard, the VirtualBox clipboard cannot work.
puterboy
Posts: 17
Joined: 29. Sep 2019, 02:46

Fails if-and-only if .Xauthority is writable by the user

Post by puterboy »

The issue on my Ubuntu 18.04 vm seems to be that Guest additions works if and only if .Xauthority is *not* writable by the user -- which explains why when .Xauthority is owned by root with perm 600, then GA works.
Note that if .Xauthority is writable by the user it gets replaced by a new .Xauthority owned by the user with perm 600 and GA fails

Specifically,
.Xauthority owned by user --> GA fails
.Xauthority missing --> GA fails
.Xauthority owned by root with perm 600 or even 644 --> GA succeeds
.Xauthority owned by root with perm 666 --> GA succeeds
.Xauthority with any random content set to root with perm 600 or even 644 --> GA succeeds

In particular, note that doing the following works

Code: Select all

rm .Xauthority
touch .Xauthority
chown root.root .Xauthority
Note that once GA fails, logging out and changing the ownership/perms on .Xauthority is not sufficient to get GA to work unless I reboot -- even if I restart gdm3.
puterboy
Posts: 17
Joined: 29. Sep 2019, 02:46

Re: Guest Additions Installed, but not working

Post by puterboy »

scottgus1 wrote:
Scottgus1 wrote:Can you please try a test VM
The intent of this test is to try a completely fresh OS of the most recent kernel without all the changes that have been done in the VM, to clear away the possibility whether Virtualbox itself has the problem or the problem is from all the changes in a modified OS.

I will wait until you run the test.
I created a fresh VM using a minimal new install of Ubuntu 18.04 followed by compiling GA from the 6.1.30 iso.
GA worked fine

Interestingly, there is no .Xauthority created by minimal install.

Note that both my old, full install VM and the new install use gdm3 + Wayland.
Not sure what is requiring/invoking .Xauthority in my old full install VM vs. the fresh install
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Guest Additions Installed, but not working

Post by scottgus1 »

Seeing that this looks more like a guest OS problem/configuration issue, I'll move this topic to Linux Guests.

@fth0, does this look to you like a problem that the devs should look at re Wayland, or a one-off that happened on puterboy's Linux OS?
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Guest Additions Installed, but not working

Post by fth0 »

Well, I gave some hints in two different possible directions (Synergy, Wayland), but got no reaction from puterboy regarding investigating them so far.

In general, the state of Wayland in Linux is a work in progress and highly distribution specific. It can provide a Wayland clipboard and/or an X11 clipboard, and VirtualBox only uses the latter. If Wayland doesn't provide an X11 clipboard in puterboy's Ubuntu guest, it's a Linux configuration problem and the VirtualBox devs will probably not be interested ...
Post Reply