As others have complained about, the feature of shared clipboard in Virtualbox was broken in the latest Whonix version.
@arraybolt3 mentioned ( How to enable Shared Clipboard & Drag-and-Drop features inside VirtualBox with Whonix-LXQt-18.0.8.7 ? - #2 by arraybolt3 ) that is because of the switch to Wayland. A Wayland guest OS can’t use the shared clipboard feature in Virtualbox.
opened 07:01AM - 09 Jun 25 UTC
Host: Windows 10
Guest: EndeavourOS (Arch based) with Plasma 6
Virtualbox versio… n: 7.1.10
Guest additions version: 7.1.10
### Problem description
Pasting from host to guest (wayland) -> works
Pasting from guest (x11) to host -> works
Pasting from guest (wayland) to host -> doesn't work
### Pinpointing the problem
I did some debugging and the problem is that this check is always false:
https://github.com/VirtualBox/virtualbox/blob/ecf221fc944207a749ec5c1e3fb3071e175c54ef/src/VBox/Additions/x11/VBoxClient/wayland-helper-dcp.cpp#L831
Small description of the codeflow:
1. `vbcl_wayland_hlp_dcp_gh_clip_report_cb()` waits on `g_DcpCtx.Session.clip.uFmt` and, if successful, it sets `Session.clip.pvClipboardBuf` and `Session.clip.cbClipboardBuf` (via a call to `vbcl_wayland_hlp_dcp_receive_offer()`)
2. `vbcl_wayland_hlp_dcp_gh_clip_read_join_cb()` sets `g_DcpCtx.Session.clip.uFmt` and waits on `Session.clip.pvClipboardBuf` and `Session.clip.cbClipboardBuf`
3. `vbcl_wayland_hlp_dcp_gh_clip_read_join_cb()` is called after `vbcl_wayland_hlp_dcp_gh_clip_report_cb()`
This is a cyclic dependency that results in all those values being empty (defaulted) when read.
I think there is a logic problem here. `vbcl_wayland_hlp_dcp_gh_clip_report_cb()` does 2 actions that are meant to be distinct. It both reports to the host that clipboard data is available AND copies the clipboard data to internal buffers. The latter fails because it doesn't know which format the host expects at this point.
The data should be copied only after the host requests them.
I want to contribute to Whonix by fixing this issue upstream. I’m asking for support to any experienced (systems) programmer who could give me a helping hand with this by giving me some pointers. I know how to program and I will figure it out, but the right pointers by an experienced programmer could save me hours on the job. Thanks in advance.
2 Likes
The linked bug report has a pretty decent breakdown of the issue in the code itself. I don’t know how accurate it is, but it looks hopeful. You may have already seen this, and unfortunately I haven’t worked inside the VirtualBox codebase enough to give more than general C/C++ advice.
2 Likes
See:
Broken for all Linux distributions based on Wayland. Hence, unspecific to Whonix.