Subject: Bug#581: VirtualBox Clipboard Sharing does not work when accessing the host over X2Go

From: Michael DePaulo <[email-masked]>
Date: Sun, 24 Aug 2014 22:57:57 -0400

Package: nx-libs
Version: 3.5.0.27
Severity: normal

If you run a VirtualBox VM with its display running under X2Go, the
VM's clipboard sharing fails to work in either direction.

You cannot copy and paste text between the VM and an app running under
X2Go server, nor can you copy and paste text between the VM and an app
running on the X2Go Client system.

(I believe VirtualBox VMs use SDL to interact with the X server, which
in this case is nxagent. This differs from the VirtualBox GUI, which
is written in QT.)

Specifically, when the X sesssion starts on the guest, a
VirtualBox-provided script for X calls "VBoxClient --clipboard" to
start the clipboard service. The service runs as the user logged into
the guest. However, this service fails to stay running, and thus the
clipboard sharing does not work.

If you launch the VirtualBox VM on the local X.org X server, the
guest's clipboard service stays running and clipboard sharing works.
You can also launch the VM in RDP headless mode from x2go (so the VM
does not render its display to any nxagent). In this use case, the
clipboard service stays running and clipboard sharing works.

The strange part is that the configuration of the host affects the
behavior of the guest. It makes sense though because it's a bug in the
guest's code to integrate with the host.

Also, when you do call  "VBoxClient --clipboard", it returns 0. And if
you call it after the X11 session has already started, the problem
still occurs.

In x2goclient, I tried turning on and off the following setting, but
it had no effect:
Options -> Settings -> X-Server settings -> do not use primary clipboard

My theory is that this is a bug in nx-libs, and that the bug is
probably related to nx-libs being forked from such an old X.org
codebase. It is worth looking into whether other SDL apps have
clipboard trouble with X2Go on Ubuntu 14.04. (It's also worth testing
an older release of Ubuntu as the host OS, since it would have an
older release of SDL.)

Host system:

OS: Ubuntu 14.04.1 64-bit with latest bugfix & security updates
nxagent: 2:3.5.0.27-0~446~ubuntu14.04.1
x2goserver: 4.0.1.15-0~847~ubuntu14.04.1
x2goserver-xsession: 4.0.1.15-0~847~ubuntu14.04.1
VirtualBox 4.3.14 (from download.virtualbox.org)

"Shared Clipboard" is set to "Bidirectional" for the VM

$ cat /etc/x2go/x2goagent.options | grep -v '^#' | grep -v '^$'
X2GO_NXAGENT_DEFAULT_OPTIONS=""
X2GO_NXAGENT_DEFAULT_OPTIONS+=" -extension XFIXES"
X2GO_NXAGENT_DEFAULT_OPTIONS+=" -nolisten tcp"

Guest OS:

Ubuntu 12.04.5 64-bit with precise HWE stack, the virtual kernel, and
all the latest bugfix & security updates
OS-provided XFCE
virtualbox-guest-dkms: 4.1.12-dfsg-2ubuntu0.6
virtualbox-guest-utils:  4.1.12-dfsg-2ubuntu0.6
virtualbox-guest-x11: 4.1.12-dfsg-2ubuntu0.6
Configured according to:
https://github.com/mikedep333/duckpan-vagrant/tree/duckduckhack-vm
The aforementioned script is: /etc/X11/Xsession.d/98vboxadd-xclient
(I'm sure a different script would be used for distros like CentOS
which lack the /etc/X11/Xsession.d/ folder).

Client system:

Windows 8.1 64-bit with Update 1 and all the minor/monthly updates available
X2GoClient 4.0.2.1+hotfix1+build3

---

From: John Roberts <[email-masked]>
Date: Fri, 18 Jun 2021 16:29:09 +0000

Hello,

After the Virtualbox update from the version 5 to version 6 series:

  *   Invoking copy/paste operations when shared clipboard is turned on causes the guest machine to immediately abort
  *   Even with shared clipboard turned off in Virtualbox settings, guest machines generate an Abort status in Virtualbox during a normal shutdown
  *   /var/log/messages indicates a segmentation fault in Virtualbox shclipboard application
  *   These aborts do not occur when running Virtualbox over a ssh-X tunnel

I'm wondering if this is related to the older nx-libs problem with shared clipboard submitted by mikedep333.

x2go client: v 4.1.2.2 (Qt 5.15.2) running on Fedora 33

x2go server: : 4.1.0.3, nxproxy 3.5.99.26

John.