Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Discussions related to using VirtualBox on Linux hosts.
palytoxin
Posts: 8
Joined: 18. Aug 2023, 09:47

Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by palytoxin »

Hello VBox Support Team,


host:

Code: Select all

~ » inxi                                                                                                                                                                                                                                                                            15:49:46
CPU: quad core Intel Core i5-8259U (-MT MCP-) speed/min/max: 1862/400/3800 MHz
Kernel: 6.1.44-1-MANJARO x86_64 Up: 52m Mem: 7.29/31.09 GiB (23.4%)
Storage: 715.41 GiB (25.4% used) Procs: 286 Shell: fish inxi: 3.3.29
```
guest:

Code: Select all

windows 10 bussiness / win10 pro ... etc. / win8 any version
VirtualBox version:

Code: Select all

VirtualBox Graphical User Interface Version 7.0.10 r158379
Oracle_VM_VirtualBox_Extension_Pack-7.0.10.vbox-extpack

I trust this message finds you well. I am writing to bring to your attention an issue I've been encountering while using VirtualBox. My setup involves a Linux host system and a Windows guest system running within VirtualBox. The issue I am facing revolves around the bi-directional copy-paste functionality of the clipboard.

I have ensured that the bi-directional clipboard feature is enabled in the VirtualBox settings for the Windows guest machine. However, I consistently encounter difficulties with the copy-paste functionality between the host and guest systems. Specifically, I often encounter situations where copying content from the host and pasting it into the guest (and vice versa) does not perform as expected.

I'd like to provide additional context about this issue. During the guest's runtime, the bi-directional copy-paste feature works initially, but sometimes when attempting to copy images or text, I receive errors like

Code: Select all

Shared Clipboard: Converting VBox formats 'UNICODETEXT' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT.
00:55:23.488611 VMMDev: Guest Log: VBOXNP: DLL unloaded.
00:55:47.068990 Shared Clipboard: Error reading host clipboard data from X11, rc=VERR_TIMEOUT
00:55:47.069040 Shared Clipboard: Reading host clipboard data failed with VERR_TIMEOUT
00:55:47.069111 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:55:47.069145 Shared Clipboard: Converting VBox formats 'UNICODETEXT' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:55:47.069157 Shared Clipboard: Converting X11 format 'UTF8_STRING' (idxFmtX11=1) to VBox format 0x1 failed, rc=VERR_NO_DATA
00:55:47.069713 Shared Clipboard: Signalling host about guest clipboard data failed with VERR_NOT_FOUND
00:56:17.070679 Shared Clipboard: Error reading host clipboard data from X11, rc=VERR_TIMEOUT
00:56:17.070712 Shared Clipboard: Reading host clipboard data failed with VERR_TIMEOUT
00:56:17.070859 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:56:17.070881 Shared Clipboard: Converting VBox formats 'UNICODETEXT' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:56:17.070894 Shared Clipboard: Converting X11 format 'UTF8_STRING' (idxFmtX11=1) to VBox format 0x1 failed, rc=VERR_NO_DATA
00:56:17.071103 Shared Clipboard: Signalling host about guest clipboard data failed with VERR_NOT_FOUND
00:56:47.071552 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:56:47.071588 Shared Clipboard: Converting VBox formats 'UNICODETEXT' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:57:03.761143 Shared Clipboard: Mode: Off
00:57:17.072050 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:57:17.072102 Shared Clipboard: Converting VBox formats 'UNICODETEXT' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:57:47.072479 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:57:47.072517 Shared Clipboard: Converting VBox formats 'UNICODETEXT' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:58:17.072910 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:58:17.072951 Shared Clipboard: Converting VBox formats 'UNICODETEXT' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:58:47.073262 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:58:47.073303 Shared Clipboard: Converting VBox formats 'UNICODETEXT' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:59:17.073801 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:59:17.073860 Shared Clipboard: Converting VBox formats 'UNICODETEXT' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:59:17.073878 Shared Clipboard: Converting X11 format 'UTF8_STRING' (idxFmtX11=1) to VBox format 0x1 failed, rc=VERR_NO_DATA
00:59:17.073915 Shared Clipboard: Error reading host clipboard data from X11, rc=VERR_TIMEOUT
00:59:17.073930 Shared Clipboard: Reading host clipboard data failed with VERR_TIMEOUT

I have verified that both the guest additions and the VirtualBox extension pack are properly installed in the Windows guest machine. Additionally, I have attempted to restart the guest machine and the host system to see if the issue would resolve itself, but unfortunately, the problem persists.

As a software developer/user, efficient copy-paste functionality between the host and guest systems is crucial for my workflow, and this issue has been causing a notable disruption.

Could you please provide assistance in diagnosing and resolving this matter? I would greatly appreciate any guidance or troubleshooting steps you can offer. If there are any logs or diagnostic information that would be helpful for your investigation, please let me know how I can provide them.

Thank you for your attention to this matter. I look forward to your prompt response and resolution.

Best regards
Attachments
VBox.log.tgz
(22.48 KiB) Downloaded 66 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by scottgus1 »

The VM looks set up correctly, and the 7.0.10 Guest Additions started properly.

Though there is some form of image support in shared clipboard, text is supposed to work.

Do you run X or Wayland on your host? If Wayland, do you have Xwayland installed? Virtualbox has trouble with Wayland sometimes.

What source app are you copying from? Rich-text-like word processing, web bowsers, or strictly-text gedit-like sources?
palytoxin
Posts: 8
Joined: 18. Aug 2023, 09:47

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by palytoxin »

My host is running X(i3wm, without Gnome/ KDE), and Wayland is not installed. I'm experiencing this bug when trying to copy images from Flameshot, a screenshot tool on Linux, to the guest system. Additionally, copying images from Skype or WeChat within the guest system to linux host also triggers this issue. I hope this information helps you better understand the problem.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by mpack »

00:01:26.714758 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:01:26.714797 Shared Clipboard: Converting VBox formats 'UNICODETEXT, HTML' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:01:56.715305 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:01:56.715342 Shared Clipboard: Converting VBox formats 'UNICODETEXT, HTML' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:02:26.715799 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:02:26.715839 Shared Clipboard: Converting VBox formats 'UNICODETEXT, HTML' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:02:26.716934 Shared Clipboard: Signalling host about guest clipboard data failed with VERR_NOT_FOUND
00:02:26.717413 Shared Clipboard: Signalling host about guest clipboard data failed with VERR_NOT_FOUND
00:02:26.717791 Shared Clipboard: Signalling host about guest clipboard data failed with VERR_NOT_FOUND
00:02:26.718871 Shared Clipboard: Converting VBox formats 'UNICODETEXT, HTML' to 'INVALID' for X11 (idxFmtX11=0, fmtX11=0, atomTarget='COMPOUND_TEXT') failed, rc=VERR_NOT_SUPPORTED
I have no experience of the i3 Window Manager. However I suggest that you try to avoid unicode text given the above logged error messages.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by scottgus1 »

palytoxin wrote: 19. Aug 2023, 17:19 trying to copy images
I've seen in the manual where shared clipboard only works with a limited set of image types. I cannot find the reference, however, so it could be hiding on me or no longer valid.

Does shared clipboard work with text?
palytoxin
Posts: 8
Joined: 18. Aug 2023, 09:47

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by palytoxin »

Regarding your question about text, after the image copy fails, all clipboard functionality (including both text and images) becomes disabled. Even restarting the guest system doesn't restore the functionality. Only after restarting the Linux host, the clipboard starts working normally again.

As a workaround, I've switched to using the headless mode and connecting through FreeRDP. Interestingly, all clipboard functions work flawlessly within FreeRDP. This has allowed me to maintain the clipboard functionality I need. If there are any further insights or solutions to address the issue, I would greatly appreciate your guidance."
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by scottgus1 »

palytoxin wrote: 20. Aug 2023, 11:12 Regarding your question about text
My question about text was regarding when the shared clipboard is still working, before attempting to copy an image. Does text copy before an image copy work well?

The RDP method is not using Virtualbox's shared clipboard, so it could work differently.

I have had shared clipboard issues when I have multiple apps trying to share the clipboard at the same time, like Virtualbox and UltraVNC. While you're trying to copy images using the Virtualbox method (not RDP), do you have other clipboard-sharing apps running?

And to reiterate, while the Virtualbox shared clipboard is still working, does text copy correctly?
palytoxin
Posts: 8
Joined: 18. Aug 2023, 09:47

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by palytoxin »

Yes, when Virtualbox shared clipboard is still working, text copy correctly, its works fine.
And, when the Virtualbox clipboard coping, the RDP not runing.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by scottgus1 »

Thanks for the information. We will need to know precisely what type of image you're attempting when Virtualbox shared clipboard locks up: jpg, png, webm, etc.

And some knowing forum guru will have to remind us what image formats the shared clipboard is designed to handle, if they'd please.

Maybe there's a correlation.
palytoxin
Posts: 8
Joined: 18. Aug 2023, 09:47

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by palytoxin »

I apologize for the confusion in my previous inquiries. I've identified a method that reliably reproduces the issue, but unfortunately, it involves using a Chinese IM software (WeChat for Enterprise).

Please refer to the attached image. Everything works fine when using VBox initially.

However, the error occurs when I attempt to copy an image within the Enterprise WeChat application. After copying, the copying function within the guest remains functional, but the clipboard between the host and the guest won't work properly until a restart is performed.

error messages:

Code: Select all

00:21:27.990818 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:21:27.990869 Shared Clipboard: Converting VBox formats 'UNICODETEXT, BITMAP, HTML' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:21:28.869850 GUI: UIMediumEnumerator: Medium-enumeration finished!
00:21:57.992804 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:21:57.992872 Shared Clipboard: Converting VBox formats 'UNICODETEXT, BITMAP, HTML' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:22:27.993657 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:22:27.993719 Shared Clipboard: Converting VBox formats 'UNICODETEXT, BITMAP, HTML' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:22:57.994094 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:22:57.994141 Shared Clipboard: Converting VBox formats 'UNICODETEXT, BITMAP, HTML' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:23:27.994423 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:23:27.994478 Shared Clipboard: Converting VBox formats 'UNICODETEXT, BITMAP, HTML' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:23:57.995136 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:23:57.995188 Shared Clipboard: Converting VBox formats 'UNICODETEXT, BITMAP, HTML' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:24:24.156845 VMMDev: Guest Log: VBOXNP: DLL loaded.
00:24:27.995878 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:24:27.995921 Shared Clipboard: Converting VBox formats 'UNICODETEXT, BITMAP, HTML' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:24:57.996470 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:24:57.996511 Shared Clipboard: Converting VBox formats 'UNICODETEXT, BITMAP, HTML' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
00:25:24.124612 VMMDev: Guest Log: VBOXNP: DLL unloaded.
00:25:27.996807 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:25:27.996834 Shared Clipboard: Converting VBox formats 'UNICODETEXT, BITMAP, HTML' to 'STRING' for X11 (idxFmtX11=4, fmtX11=2, atomTarget='STRING') failed, rc=VERR_TIMEOUT
00:25:27.997062 Shared Clipboard: Converting VBox formats 'NONE' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_NOT_SUPPORTED
00:25:27.997457 Shared Clipboard: Converting VBox formats 'NONE' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_NOT_SUPPORTED
00:25:27.997526 Shared Clipboard: Converting VBox formats 'NONE' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_NOT_SUPPORTED
00:25:27.997700 Shared Clipboard: Converting VBox formats 'NONE' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_NOT_SUPPORTED
00:25:27.997771 Shared Clipboard: Converting VBox formats 'NONE' to 'text/plain;charset=utf-8' for X11 (idxFmtX11=3, fmtX11=3, atomTarget='text/plain;charset=utf-8') failed, rc=VERR_NOT_SUPPORTED
00:25:27.998088 Shared Clipboard: Converting VBox formats 'NONE' to 'INVALID' for X11 (idxFmtX11=0, fmtX11=0, atomTarget='COMPOUND_TEXT') failed, rc=VERR_NOT_SUPPORTED
00:25:27.998147 Shared Clipboard: Converting VBox formats 'NONE' to 'INVALID' for X11 (idxFmtX11=0, fmtX11=0, atomTarget='COMPOUND_TEXT') failed, rc=VERR_NOT_SUPPORTED
00:25:27.998207 Shared Clipboard: Converting VBox formats 'NONE' to 'INVALID' for X11 (idxFmtX11=0, fmtX11=0, atomTarget='COMPOUND_TEXT') failed, rc=VERR_NOT_SUPPORTED
00:25:27.998268 Shared Clipboard: Converting VBox formats 'NONE' to 'INVALID' for X11 (idxFmtX11=0, fmtX11=0, atomTarget='COMPOUND_TEXT') failed, rc=VERR_NOT_SUPPORTED
00:25:27.998828 Shared Clipboard: Signalling host about guest clipboard data failed with VERR_NOT_FOUND
00:25:27.999027 Shared Clipboard: Signalling host about guest clipboard data failed with VERR_NOT_FOUND
Attachments
error messages in vBox.log
error messages in vBox.log
3.png (44.14 KiB) Viewed 3533 times
after copy, guest work fine
after copy, guest work fine
2.png (53.28 KiB) Viewed 3533 times
chat UI, '复制' means Copy
chat UI, '复制' means Copy
1.png (83.14 KiB) Viewed 3533 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by mpack »

The error messages still talk about text. Are you sure that the Chinese characters are being copied as an image, and not as Unicode text?

I don't actually know if Unicode is supported, but I would expect so, and I would also not expect Unicode->Unicode to be a problem. The problem as I see it would come when you try to paste Chinese Unicode characters into a target expecting 8-bit UTF.
palytoxin
Posts: 8
Joined: 18. Aug 2023, 09:47

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by palytoxin »

I'm sorry, my background doesn't make me understand what 'Unicode->Unicode' issue is.

I'm quite certain the error arises when copying images, not text.

For this error, copying text works fine, but when copying images, VBox shows Unicode-related errors. It could indeed be an issue with the implementation of this chat software's code. If it would be helpful, I'd be glad to provide more information to assist further.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by scottgus1 »

It appears that you are right-clicking an image and choosing Copy from the pop-up menu. If so, if you chose to save the image, what kind of image would it save as?
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by fth0 »

FWIW, the VirtualBox Shared Clipboard currently handles three clipboard data formats: UNICODETEXT, BITMAP and HTML. Note that clipboard data formats are not file formats. UNICODETEXT typically is UTF-16 with CRLF on Windows and UTF-8 with LF on Linux, and VirtualBox does the necessary conversion. BITMAP is DIB on Windows and BMP on Linux. HTML is, well, HTML. ;)

Code: Select all

00:21:27.990818 Shared Clipboard: Requesting data in format 0x1 for X11 host failed with VERR_TIMEOUT
00:21:27.990869 Shared Clipboard: Converting VBox formats 'UNICODETEXT, BITMAP, HTML' to 'UTF8_STRING' for X11 (idxFmtX11=1, fmtX11=3, atomTarget='UTF8_STRING') failed, rc=VERR_TIMEOUT
The log messages above indicate that the Windows clipboard had contents in all three formats and VirtualBox failed to convert the UNICODETEXT format to UTF-8 because of a timeout.

I'd suggest to create a ticket in the Bugtracker.
palytoxin
Posts: 8
Joined: 18. Aug 2023, 09:47

Re: Clipboard Bi-Directional Copy-Paste Issue in Linux Host and Windows Guest

Post by palytoxin »

scottgus1 wrote: 21. Aug 2023, 16:43 It appears that you are right-clicking an image and choosing Copy from the pop-up menu. If so, if you chose to save the image, what kind of image would it save as?
save as will save a PNG image file. I have a feeling this might be an issue with the chat software.
Post Reply