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 »

RonaldIsIT wrote:Any idea on how I can fix this one?
Answering this question myself: Install kernel-devel.x86_64 as the Bugzilla pointed out :oops:
I installed that package and run the GA build again.
# ./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: Building the modules for kernel
5.13.13-200.fc34.x86_64.
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
All good with building the GA now.

Now I get:

Code: Select all

00:00:15.457785 VMMDev: Guest Additions information report: Version 6.1.26 r145957 '6.1.26'
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.

Version info looks good now.
Wayland support still broken.

Any ideas?
Attachments
Fedora 34 KDE X11-2021-09-07-21-06-17.zip
X11 logs
(34.27 KiB) Downloaded 8 times
Fedora 34 KDE Wayland-2021-09-07-20-57-34.zip
Wayland logs
(33.68 KiB) Downloaded 8 times
RonaldIsIT
Posts: 10
Joined: 2. Dec 2018, 20:41

Re: Shared Clipboard not working as expected

Post by RonaldIsIT »

Sorry posted the latest logs multiple times. Removed the the duplicate posts.
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 »

A few ideas come to mind:

On the Windows 10 host, use a text editor as a copy & paste source/destination. Does copying in either direction work?

For further logging, you can use the following (or similar) commands in a shell in the Fedora guest:

Code: Select all

sudo pkill -fx "/usr/bin/VBoxClient --clipboard"
VBOX_RELEASE_LOG_FLAGS="time tid thread" VBOX_RELEASE_LOG="all.e.l.l2.l3.f" VBoxClient -d --clipboard
RonaldIsIT
Posts: 10
Joined: 2. Dec 2018, 20:41

Re: Shared Clipboard not working as expected

Post by RonaldIsIT »

fth0 wrote:A few ideas come to mind:

On the Windows 10 host, use a text editor as a copy & paste source/destination. Does copying in either direction work?
No change.
Still the same results result.
I used Notepad++ as a text editor and tried to copy&paste a string ("this is just another funny string") via clipboard from host to guest and vice versa.
No paste possible on the Linux guest.
The copied string does not make its way into the host clipboard.
fth0 wrote:For further logging, you can use the following (or similar) commands in a shell in the Fedora guest:

Code: Select all

sudo pkill -fx "/usr/bin/VBoxClient --clipboard"
VBOX_RELEASE_LOG_FLAGS="time tid thread" VBOX_RELEASE_LOG="all.e.l.l2.l3.f" VBoxClient -d --clipboard
I run the above as root.
I got the following output.
The paste worked inside the vm. It pasted the previous VBOX_RELEASE_LOG_FLAGS I copied from your comment inside my Linux.
The string I copied from Notepad++ did not update the guests clipboard.

Code: Select all

[root@vmlinux ~]#  pkill -fx "/usr/bin/VBoxClient --clipboard"
[root@vmlinux ~]# VBOX_RELEASE_LOG_FLAGS="time tid thread" VBOX_RELEASE_LOG="all.e.l.l2.l3.f" VBoxClient -d --clipboard
06:09:52.170246 00007fc20dcf2780 main     vboxClientSetSignalHandlers: ENTER
06:09:52.170328 00007fc20dcf2780 main     vboxClientSetSignalHandlers: LEAVE
06:09:52.170379 00007fc20dcf2780 main     Shared Clipboard: Starting X11 event thread ...
06:09:52.176267 00007fc20dcf2780 main     Shared Clipboard: X11 event thread started
06:09:52.180829 00007fc20dcf2780 main     Shared Clipboard: Guest features: 0x1 - Host features: 0x1
06:09:52.181006 00007fc20dcf2780 main     Worker loop running
BOX_RELEASE_LOG_FLAGS="time tid thread" VBOX_RELEASE_LOG="all.e.l.l2.l3.f" VBoxClient -d --clipboard
I am not sure if the log message is just ambiguous.
I am not logged in into a X11 session but is starting some X11 event thread.
Would that thread thingy work with other desktop managers like Wayland?
Maybe somebody from development is checking this here?

Not sure if somebody needs the vm log.
Attachments
Fedora 34 KDE Wayland-2021-09-08-08-14-47.zip
Wayland log
(35.12 KiB) Downloaded 7 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:All good with building the GA now.

Now I get:
CODE: SELECT ALL   EXPAND VIEW
00:00:15.457785 VMMDev: Guest Additions information report: Version 6.1.26 r145957 '6.1.26'
That was a long slog, wasn't it? :D

Glad you're up and running!
RonaldIsIT wrote:Answering this question myself:
Great that you found the solution! But it's always a good idea to go back to your previous post in the topic and read what others have posted since then. For example, you'll find that forum guru Martin pointed out the need for 'kernel-devel' headers before your post.
RonaldIsIT wrote:kernel-devel.x86_64 as the Bugzilla pointed out
Interestingly enough, so does the prerequisites link:
On Fedora, Red Hat, ... it is usually kernel-devel.
I also looked through your newer logs, could not see anything wrong (or right, fwiw, it's beyond me now). Will have to back out of this one and leave the gurus to it.

Glad you got those GA's installed!
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 »

RonaldIsIT wrote:I am not sure if the log message is just ambiguous.
I am not logged in into a X11 session but is starting some X11 event thread.
Would that thread thingy work with other desktop managers like Wayland?
That's the key question, and the Solomonic answer would be "It depends.":

The Wayland clipboard and the X11 clipboard are two different things, and VirtualBox only supports the X11 clipboard. Wayland installations can provide an X11 clipboard, but it depends on their configuration. Look for components like KWayland or XWayland, and investigate if your guest OS has a running X11 clipboard (and not "only" a running Wayland clipboard). Additionally, check if VBoxClient --clipboard is automatically running after booting the guest OS, because in some setups Wayland doesn't start some X11 scripts. Please let us know what you discover ...

In Fedora 34 KDE Wayland-2021-09-08-08-14-47.log, the VBoxService is started twice again (00:00:22 and 00:00:38). This time it's the same version twice, but I'm not sure what problems can stem from that.
RonaldIsIT
Posts: 10
Joined: 2. Dec 2018, 20:41

Re: Shared Clipboard not working as expected

Post by RonaldIsIT »

fth0 wrote: The Wayland clipboard and the X11 clipboard are two different things, and VirtualBox only supports the X11 clipboard. Wayland installations can provide an X11 clipboard, but it depends on their configuration. Look for components like KWayland or XWayland, and investigate if your guest OS has a running X11 clipboard (and not "only" a running Wayland clipboard). Additionally, check if VBoxClient --clipboard is automatically running after booting the guest OS, because in some setups Wayland doesn't start some X11 scripts. Please let us know what you discover ...
I read different posts about the topic Wayland/X11 clipboard synchronization.
It looks like that will take some time to test that stuff.
I would appreciate any work that can be done on the VB side as well. X11 is not considered to be the future of Linux desktops in the future...

Will keep you posted...
fth0 wrote:
In Fedora 34 KDE Wayland-2021-09-08-08-14-47.log, the VBoxService is started twice again (00:00:22 and 00:00:38). This time it's the same version twice, but I'm not sure what problems can stem from that.
There is nothing that I can do here, correct?
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 »

RonaldIsIT wrote:Will keep you posted...
Thanks for that, appreciated. :)
RonaldIsIT wrote:There is nothing that I can do here, correct?
It could be the case that you have to do something about VBoxService being started twice, because the second instance possibly disables the first instance, too, which could lead to unexpected consequences. My educated guess is that something, which was part of the Ubuntu-provided GA version, is still active, and now tries to start the Oracle-provided VBoxService. I've never seen this situation in the past, so I have no ready-made solution for it. The task would be to find the two scripts starting VBoxService, and to eliminate the wrong one. What you can do, depends a little bit on your capabilities. ;)
plarkinjr
Posts: 2
Joined: 24. Mar 2016, 23:37

Re: Shared Clipboard not working as expected

Post by plarkinjr »

I'm facing similar issue: Fedora 34, VBox GA 6.1.30 ... Bidirectional copy/paste between Fedora guest and Win10 host fails if running plasma wayland, but works with plasma X11.


$ tail /var/log/vboxadd-install.log
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.12-100.fc34.x86_64.
ValueError: File context for /opt/VBoxGuestAdditions-6.1.30/other/mount.vboxsf already defined
VirtualBox Guest Additions: Running kernel modules will not be replaced until
the system is restarted

Workaround: login with Plasma on X11
Post Reply