Clipboard sharing in VirtualBox is unfortunately broken in Whonix 18. See:
Instructions for using VirtualBox Guest Additions in Kicksecure. Includes Clipboard Sharing, Shared Folder, Mouse Integration, Graphics Performance, and more.
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.
Drag-n-Drop hasn’t been known to work historically. If it did work previously, it’s probably also broken by the switch to Wayland.
Shared folders can be used as an alternative for both features. This does work in Whonix 18 and is likely not as breakage-prone as clipboard sharing and drag-n-drop. See:
Instructions for using VirtualBox Guest Additions in Kicksecure. Includes Clipboard Sharing, Shared Folder, Mouse Integration, Graphics Performance, and more.
Note: Whonix is based on Kicksecure.
1 Like