Shared Clipboard not working as expected

Discussions about using Linux guests in VirtualBox.
RonaldIsIT
Posts: 10
Joined: 2. Dec 2018, 20:41

Re: Shared Clipboard not working as expected

Post by RonaldIsIT »

I am having the same issue here.

Fedora 34 KDE Plasma spin
kernel 5.13.13-200
guest additions 6.1.26
  • Wayland: copy and paste - not working at all, screen resize - screen resolution not changed
    X11: bidirectional copy and paste - working, screen resize - screen resolution is adjusted automatically
Shared folders are working with both.

I have an Oracle Linux 8.3 Gnome with kernel 5.4.17-2102 and guest additions 6.1.18.
Here everything is working as expected on Wayland and X11.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Shared Clipboard not working as expected

Post by mpack »

A zipped VM log would be more useful than assertions.

Also a note, in each case, of what is being copied and pasted.
RonaldIsIT
Posts: 10
Joined: 2. Dec 2018, 20:41

Re: Shared Clipboard not working as expected

Post by RonaldIsIT »

Okay here we go.

Here is the description of what I did:
  • * logged in to the system (Wayland/X11)
    * opened a terminal window (Tilix)
    * copied the string "be nice to people" from the Windows 10 host (Firefox browser window)
    * pasted it into the guests Fedora Linux terminal window
On Wayland the paste command was not available. --> No pasting possible
On X11 the command was available and paste worked as expected. The screen resolution on X11 was also properly adjusted. The Wayland session was with default resolution.

The logfiles for both sessions are attached.

Is this sufficient now?
Please describe the required test cases if you want me to do some additional testing.
Attachments
Fedora 34 KDE X11-2021-09-03-20-11-12.zip
X11 log file
(34.4 KiB) Downloaded 12 times
Fedora 34 KDE Wayland-2021-09-03-20-07-36.zip
Wayland session log file
(34.1 KiB) Downloaded 9 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared Clipboard not working as expected

Post by scottgus1 »

In both cases, Guest Additions are very out of date:
VirtualBox VM 6.1.26 r145957 win.amd64 (Jul 28 2021 17:15:09) release log
...
VMMDev: Guest Additions information report: Version 6.0.0 r127566 '6.0.0'
Looks like the GAs were not successfully installed, despite:
RonaldIsIT wrote:Fedora 34 KDE Plasma spin
kernel 5.13.13-200
guest additions 6.1.26
Please update Guest Additions, then try the logs again. Note the prerequisites to GAs in a Linux VM, same as for Virtualbox on the host: https://www.virtualbox.org/manual/ch02. ... nux-prereq Please also note that the Devices menu "Insert Guest Additions CD Image" only inserts the Guest Additions CD image into the VM's CD drive, it does not install the GAs. You probably know that already, but there are a good number of Virtualbox users that seem to not to.
RonaldIsIT
Posts: 10
Joined: 2. Dec 2018, 20:41

Re: Shared Clipboard not working as expected

Post by RonaldIsIT »

scottgus1 wrote:In both cases, Guest Additions are very out of date:
VirtualBox VM 6.1.26 r145957 win.amd64 (Jul 28 2021 17:15:09) release log
...
VMMDev: Guest Additions information report: Version 6.0.0 r127566 '6.0.0'
Well the system was the same. I just logged in with different display servers (Wayland vs. X11).
Guest additions were the same for sure. How could you be able to compare it otherwise?

The guest addaitions are installed from the Fedora repositories:
virtualbox-guest-additions.x86_64 6.1.26-1.fc34

I can download the guest additions from https://www.virtualbox.org/wiki/Downloads.
I am pretty sure the results will be the same. I did that test yesterday already.

What is the version of guest additions that I should use?
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: Shared Clipboard not working as expected

Post by fth0 »

You should use the VirtualBox Guest Additions (GA) 6.1.26, as you think you're already doing. A bit of explanation:

I cannot speak for the GA package from the Fedora repositories, but when you install the GA from the Downloads page, they (try to) build the VirtualBox kernel modules from source during the installation procedure. The prerequisites described in the VirtualBox User Manual are Linux kernel headers and build tools, and if they are not available, the result of the installation is a combination of GA 6.1.26 programs and the GA 6.0.0 kernel modules pre-installed by some Fedora kernel module package.

You can check the currently installed VirtualBox kernel module version with modinfo vboxguest, BTW.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared Clipboard not working as expected

Post by scottgus1 »

RonaldIsIT wrote: How could you be able to compare it otherwise?
Having the same in each case is important. Having something from almost three years ago, with considerable development since then?

Install the 6.1.26 GAs as requested for further help.
RonaldIsIT
Posts: 10
Joined: 2. Dec 2018, 20:41

Re: Shared Clipboard not working as expected

Post by RonaldIsIT »

scottgus1 wrote:
RonaldIsIT wrote: How could you be able to compare it otherwise?
Having the same in each case is important. Having something from almost three years ago, with considerable development since then?
No that is not the case.

You might have missed this one:
RonaldIsIT wrote: The guest addaitions are installed from the Fedora repositories:
virtualbox-guest-additions.x86_64 6.1.26-1.fc34
That is not 3 years old obviously.

Anyway.
I installed the 6.1.26 manually again after removing the pre-compiled Fedora versions.

Test case is the same as before.
I used the same virtual machine for both tests. I just logged in by using the mentioned display managers (Wayland vs. X11).
  • * logged in to the system (Wayland/X11)
    * opened a terminal window (Tilix)
    * copied the string "be nice to people" from the Windows 10 host (Firefox browser window)
    * pasted it into the guests Fedora Linux terminal window
The results were the same.
Paste option on Wayland not available. Screen resolution not adjusted.
Both is working on X11.


I still see this in the VB logs:

Code: Select all

00:00:32.973185 VMMDev: Guest Log: vboxguest: host-version: 6.1.26r145957 0x8000000f
00:00:32.973236 VMMDev: Guest Additions information report: Version 6.0.0 r127566 '6.0.0'
The guest additions build reported missing kernel headers.

/var/log/vboxadd-install.log

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: Kernel headers not found for target kernel
5.13.13-200.fc34.x86_64. Please install them and execute
  /sbin/rcvboxadd setup
ValueError: File context for /opt/VBoxGuestAdditions-6.1.26/other/mount.vboxsf already defined
VirtualBox Guest Additions: Running kernel modules will not be replaced until
the system is restarted
But headers are always installed together with the kernel:

Code: Select all

# dnf list "kernel*"
Last metadata expiration check: 0:39:25 ago on Sun 05 Sep 2021 10:06:27 AM CEST.
Installed Packages
kernel.x86_64                                                    5.11.12-300.fc34                              @anaconda
kernel.x86_64                                                    5.13.12-200.fc34                              @updates 
kernel.x86_64                                                    5.13.13-200.fc34                              @updates
kernel-core.x86_64                                               5.11.12-300.fc34                              @anaconda
kernel-core.x86_64                                               5.13.12-200.fc34                              @updates 
kernel-core.x86_64                                               5.13.13-200.fc34                              @updates 
kernel-headers.x86_64                                            5.13.3-200.fc34                               @updates 
kernel-modules.x86_64                                            5.11.12-300.fc34                              @anaconda
kernel-modules.x86_64                                            5.13.12-200.fc34                              @updates 
kernel-modules.x86_64                                            5.13.13-200.fc34                              @updates
kernel-modules-extra.x86_64                                      5.11.12-300.fc34                              @anaconda
kernel-modules-extra.x86_64                                      5.13.12-200.fc34                              @updates 
kernel-modules-extra.x86_64                                      5.13.13-200.fc34                              @updates 
Kernel used for testing is: 5.13.13-200.fc34.x86_64
# uname -a
Linux vmlinux 5.13.13-200.fc34.x86_64 #1 SMP Thu Aug 26 17:06:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Attachments
Fedora 34 KDE X11-2021-09-05-10-23-32.zip
VB log for X11 session
(34.49 KiB) Downloaded 9 times
Fedora 34 KDE Wayland-2021-09-05-10-19-39.zip
VB log for Wayland session
(33.76 KiB) Downloaded 8 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared Clipboard not working as expected

Post by scottgus1 »

RonaldIsIT wrote: You might have missed this one:
RonaldIsIT wrote: The guest addaitions are installed from the Fedora repositories:
virtualbox-guest-additions.x86_64 6.1.26-1.fc34
That is not 3 years old obviously.
Thanks for the info! However:
Fedora 34 KDE X11-2021-09-03-20-11-12.log wrote:00:00:31.079250 VMMDev: Guest Additions information report: Version 6.0.0 r127566 '6.0.0'
Fedora 34 KDE Wayland-2021-09-03-20-07-36.log wrote:00:00:34.781108 VMMDev: Guest Additions information report: Version 6.0.0 r127566 '6.0.0'
So the old logs showed old GAs. The log is the defining piece of data for our troubleshooting efforts. And the new logs:
Fedora 34 KDE X11-2021-09-05-10-23-32.log wrote:00:00:29.062355 VMMDev: Guest Additions information report: Version 6.0.0 r127566 '6.0.0'
Fedora 34 KDE Wayland-2021-09-05-10-19-39.log wrote:00:00:32.973236 VMMDev: Guest Additions information report: Version 6.0.0 r127566 '6.0.0'
also show the three-year-old GAs still in place. Probably because of:
RonaldIsIT wrote:VirtualBox Guest Additions: Kernel headers not found for target kernel
I am not certain of this:
RonaldIsIT wrote:But headers are always installed together with the kernel
Sure could be, I'm no Linux guru. But the prerequisites would not require a special step of installing them if they were always what was needed. I have had a fresh Linux VM where the headers reported being already in place when I ran the prerequisites, and another fresh Linux VM where they were not in place and had to be updated. I don't think the devs are whistling Dixie when they write that a special step is required.

In some fashion your GAs are still not being updated. Did you run the prerequisites' command 'uname -r' and explicitly run the install command for the headers reported by 'uname -r'?

Please note fth0's post above: viewtopic.php?f=3&t=103768#p505287 "When fth0 speaks, people listen." :lol:
RonaldIsIT wrote:The guest addaitions are installed from the Fedora repositories:
After running the prerequisites, please use the GAs ISO bundled with your official Virtualbox installation instead of the Linux distro's repositories: use the VM window's Devices menu, "Insert Guest Additions CD Image" to insert the Guest Additions CD image into the VM's CD drive, then run the Linux GAs installer in the VM's CD drive.

To test if GAs actually got installed, search the VM's log for the last occurrence of the words:

Guest Additions information report: Version

As in the quotes above, the words will show the version of GAs running at the time.

Wayland support is newer and will, I surmise, require newer GAs than older, if not completely up-to-date. Once we get up-to-date GAs running, we can start checking the Wayland-boot shared clipboard failure.
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: Shared Clipboard not working as expected

Post by fth0 »

In the output of the dns list command in your previous post, search for the kernel-headers line and look very closely at the version number. ;)
PantherZA
Posts: 1
Joined: 5. Sep 2021, 23:03

Re: Shared Clipboard not working as expected

Post by PantherZA »

I also had problems with shared clipboard and resolution changes with everything installed as it should be.

I took a wild chance (windows 10 host) and set virtualbox compatibility settings to run as admin.

Everything solved.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared Clipboard not working as expected

Post by scottgus1 »

Thanks, Panther, for the info. I am not certain how running Virtualbox as admin would fix shared clipboard problems in the VM. Sounds like your host PC may have had deeper problems. If you'd like to investigate, please start a new topic with the run-as-admin turned off and post a zipped vbox.log using the forum's Upload Attachment tab.

Running Virtualbox as admin on Windows is dangerous and should be very carefully considered, especially regarding any host malware present.
RonaldIsIT
Posts: 10
Joined: 2. Dec 2018, 20:41

Re: Shared Clipboard not working as expected

Post by RonaldIsIT »

fth0 wrote:In the output of the dns list command in your previous post, search for the kernel-headers line and look very closely at the version number. ;)
Good catch.

Code: Select all

# uname -r
5.13.13-200.fc34.x86_64

# dnf list "kernel-headers*"
Last metadata expiration check: 0:00:52 ago on Tue 07 Sep 2021 07:46:57 PM CEST.
Installed Packages
kernel-headers.x86_64                                      5.13.3-200.fc34   

# dnf list "kernel.*"
Last metadata expiration check: 0:05:47 ago on Tue 07 Sep 2021 07:46:57 PM CEST.
Installed Packages
kernel.x86_64                                         5.11.12-300.fc34                                         @anaconda
kernel.x86_64                                         5.13.12-200.fc34                                         @updates 
kernel.x86_64                                         5.13.13-200.fc34                                         @updates 
Current kernel is 5.13.13-200 and headers are only available for 5.13.3-200.
Found this Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1986132
Last comment there is:
More specifically, you do not need matching kernel-headers packages to build a kernel module, the kernel-headers package has nothing to do with building kernel modules. The kernel headers used to build kernel modules are in the kernel-devel package, which is built with every kernel. The "kernel-headers" package is the userspace API headers used to build userspace software. Fore more background on this, see: https://www.labbott.name/blog/2019/11/1 ... ge-anyway/ and http://thorstenl.blogspot.com/2021/01/p ... s-too.html
Does this assumption break the GA build?

Let's try to workaround it...
So I did a rebuild on the package to get the proper version number.

Code: Select all

# rpm -qa "kernel*" | grep "5.13.13" | sort
kernel-5.13.13-200.fc34.x86_64
kernel-core-5.13.13-200.fc34.x86_64
kernel-headers-5.13.13-200.fc34.x86_64
kernel-modules-5.13.13-200.fc34.x86_64
kernel-modules-extra-5.13.13-200.fc34.x86_64

# dnf list "kernel*" 
Last metadata expiration check: 0:26:18 ago on Tue 07 Sep 2021 07:46:57 PM CEST.
Installed Packages
kernel.x86_64                                                    5.11.12-300.fc34                              @anaconda
kernel.x86_64                                                    5.13.12-200.fc34                              @updates 
kernel.x86_64                                                    5.13.13-200.fc34                              @updates 
kernel-core.x86_64                                               5.11.12-300.fc34                              @anaconda
kernel-core.x86_64                                               5.13.12-200.fc34                              @updates 
kernel-core.x86_64                                               5.13.13-200.fc34                              @updates 
kernel-headers.x86_64                                            5.13.13-200.fc34                              @System  
kernel-modules.x86_64                                            5.11.12-300.fc34                              @anaconda
kernel-modules.x86_64                                            5.13.12-200.fc34                              @updates 
kernel-modules.x86_64                                            5.13.13-200.fc34                              @updates 
kernel-modules-extra.x86_64                                      5.11.12-300.fc34                              @anaconda
kernel-modules-extra.x86_64                                      5.13.12-200.fc34                              @updates 
kernel-modules-extra.x86_64                                      5.13.13-200.fc34                              @updates 
kernel-srpm-macros.noarch                                        1.0-4.fc34                                    @fedora
All good even looking very, very closely on the version numbers 8)
The source is System instead of any of the official repositories.

Now still the GA build script gives me the error: Kernel headers not found for target kernel 5.13.13-200.fc34.x86_64.
# ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.26 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.1.26 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
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: Kernel headers not found for target kernel
5.13.13-200.fc34.x86_64. Please install them and execute
/sbin/rcvboxadd setup
ValueError: File context for /opt/VBoxGuestAdditions-6.1.26/other/mount.vboxsf already defined
VirtualBox Guest Additions: Running kernel modules will not be replaced until
the system is restarted
Any idea on how I can fix this one?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared Clipboard not working as expected

Post by scottgus1 »

On an Ubuntu-based VM where I installed GAs, after I ran 'uname -r' and got the string of text representing the headers needed, I then ran, if I remember correctly, something like:

sudo apt-get install linux-headers-{string of header characters}

Did you run RedHat's version of that install command with what your run of 'uname -r' reported?
Martin
Volunteer
Posts: 2560
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Shared Clipboard not working as expected

Post by Martin »

The kernel headers used to build kernel modules are in the kernel-devel package, which is built with every kernel.
I don't see the kernel-devel package in your list of installed packages?
Post Reply