Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Discussions about using Linux guests in VirtualBox.
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: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by fth0 »

agilis wrote: 7. Jun 2023, 20:37 I tried executing the commands the way I believe they are supposed to be executed
Well, you were trying to be too clever! :D

The environment variables only work as expected when being on the same command line with the VBoxClient command. I'm not sure why that is the case, but it could have to do with the VBoxClient command spawning itself a second time (which is the reason for using pkill to kill both old processes). But what I am sure about is that using sudo does not work here (and I didn't tell you to do that ;)).
agilis wrote: 7. Jun 2023, 20:37 There was no file "clipboard.log" written to /tmp.
That's a consequence of separating the environment variables with sudo from the VBoxClient command.
agilis wrote: 7. Jun 2023, 20:52 I am willing to continue troubleshooting the Wayland side of things
You could try once more using the two commands exactly as I provided them, and I'd take another look.
agilis wrote: 7. Jun 2023, 21:03 This makes me think that VirtualBox handling of Wayland is not active because GAs does not detect Wayland.
VirtualBox doesn't really support Wayland yet (work in progress), only X11 (and XWayland providing X11 services), so problems are to be expected.

Regarding the end-of-line (EOL) conversion, VirtualBox does only add or remove <CR> characters before <LF> characters when converting between different clipboard text formats (UTF-8 to UCS-16 in the Linux to Windows case). If there was a bug doing the EOL conversion more than once, you could only end up with <CR>...<CR><LF>. The <CR><LF><CR><LF> in your screenshot seems to indicate that the initial <LF> gets doubled before VirtualBox applies the EOL conversion.
agilis
Posts: 70
Joined: 21. Dec 2015, 18:46

Re: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by agilis »

fth0 wrote: 7. Jun 2023, 23:08 Well, you were trying to be too clever! :D

The environment variables only work as expected when being on the same command line with the VBoxClient command. I'm not sure why that is the case, but it could have to do with the VBoxClient command spawning itself a second time (which is the reason for using pkill to kill both old processes). But what I am sure about is that using sudo does not work here (and I didn't tell you to do that ;)).

That's a consequence of separating the environment variables with sudo from the VBoxClient command.
I apologize for that. I did not fully understand how the commands were arranged. Thank you for being so light-hearted about it! :)
fth0 wrote: 7. Jun 2023, 23:08 You could try once more using the two commands exactly as I provided them, and I'd take another look.
I attempted to execute the commands like you originally asked of me and the commands executed successfully. However, nothing was logged to clipboard.log

I can stand by for further instruction.
agilis
Posts: 70
Joined: 21. Dec 2015, 18:46

Re: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by agilis »

scottgus1 wrote: 7. Jun 2023, 21:21 So, X11 has no problem, but Wayland does? If so, I'd post this on the Bugtracker with a summary and a link back here, and a set of zipped logs: one with X running and working clipboard, and another with Wayland running and failing clipboard.
Bug submitted: https://www.virtualbox.org/ticket/21716

Here's hoping someone will look at it :|
ufguy
Posts: 40
Joined: 4. Jun 2023, 16:43

Re: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by ufguy »

I found something from 2022 that sounds a little similar:

New lines when copy/paste from guest ubuntu
viewtopic.php?f=3&t=106862

Maybe it's the same thing but with slightly different outcomes?
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: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by fth0 »

agilis wrote: 7. Jun 2023, 23:51 I attempted to execute the commands like you originally asked of me and the commands executed successfully. However, nothing was logged to clipboard.log
Ok, that's strange. I tried the commands myself before posting them, and the log messages were simultaneously displayed in the terminal and written to the log file. Are you saying that you didn't get any response to the commands at all?
ufguy
Posts: 40
Joined: 4. Jun 2023, 16:43

Re: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by ufguy »

I tried this too, on xubuntu. clipboard.log showed up but nothing appears in it.
Tests:
Copy and paste into the same program
Copy and paste from the program to a program outside of virtualbox(to the host).

Nothing in the clipboard.log file.
agilis
Posts: 70
Joined: 21. Dec 2015, 18:46

Re: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by agilis »

fth0 wrote: 8. Jun 2023, 15:30
agilis wrote: 7. Jun 2023, 23:51 I attempted to execute the commands like you originally asked of me and the commands executed successfully. However, nothing was logged to clipboard.log
Ok, that's strange. I tried the commands myself before posting them, and the log messages were simultaneously displayed in the terminal and written to the log file. Are you saying that you didn't get any response to the commands at all?
Hi and yes. I did not get any response to the commands at all when I copied and pasted. I tailed the clipboard.log and watched the terminal where the commands were entered. Absolutely no reponse.
agilis
Posts: 70
Joined: 21. Dec 2015, 18:46

Re: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by agilis »

ufguy wrote: 8. Jun 2023, 16:56 I tried this too, on xubuntu. clipboard.log showed up but nothing appears in it.
Tests:
Copy and paste into the same program
Copy and paste from the program to a program outside of virtualbox(to the host).

Nothing in the clipboard.log file.
Thank you for your input! That is the same behavior that I am observing.
agilis
Posts: 70
Joined: 21. Dec 2015, 18:46

Re: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by agilis »

ufguy wrote: 8. Jun 2023, 02:01 I found something from 2022 that sounds a little similar:

New lines when copy/paste from guest ubuntu
viewtopic.php?f=3&t=106862

Maybe it's the same thing but with slightly different outcomes?
I came across this thread as well. However, I was unable to change the line endings in Notepad++ with the issue I am experiencing. Switching the line endings to Microsoft, Windows, Mac both before and after the pasting of text had absolutely no effect. And I assume that's because it's not a difference between the type of line endings to use but rather extra line endings being added for absolutely no reason.
ufguy
Posts: 40
Joined: 4. Jun 2023, 16:43

Re: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by ufguy »

I tried a few more tests and the only thing that happened was this was output by the VBoxClient when it was running as a sytem service:

SHCLX11 Shared Clipboard: Converting VBox formats 'UNICODETEXT' to 'INVALID' for X11 (idxFmtX11=0, fmtX11=0, atomTarget='GTK_TEXT_BUFFER_CONTENTS') failed, rc=VERR_NOT_SUPPORTED
-----
This was from the Host to the Guest. Nothing in the log. Tried copying from 2 different programs in the Guest and nothing in the log.
agilis
Posts: 70
Joined: 21. Dec 2015, 18:46

Re: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by agilis »

That's interesting :o Would you be so kind and detail the steps on how you got that output? I'd like to recreate the same thing in order to hopefully generate the same output. Thanks!
ufguy
Posts: 40
Joined: 4. Jun 2023, 16:43

Re: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by ufguy »

All I did was monitor the terminal that has the VBoxClient running with the "-d --clipboard" switches.

Then I copied some text from outside the VirtualBox sotware, like from a text editor, and pasted it into mousepad(I think) which is running in Linux/VirtualBox.
The paste worked, the text showed up in mousepad. In the terminal that data(not the copy/pasted text) was output. I wonder if that was supposed to show up in the clipboard.log file?
agilis
Posts: 70
Joined: 21. Dec 2015, 18:46

Re: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by agilis »

Thank you! I got the same output as you:

Code: Select all

18:51:00.929733 SHCLX11   Shared Clipboard: Converting VBox formats 'UNICODETEXT, HTML' to 'INVALID' for X11 (idxFmtX11=0, fmtX11=0, atomTarget='GTK_TEXT_BUFFER_CONTENTS') failed, rc=VERR_NOT_SUPPORTED
18:52:00.889619 SHCLX11   Shared Clipboard: Converting VBox formats 'UNICODETEXT' to 'INVALID' for X11 (idxFmtX11=0, fmtX11=0, atomTarget='GTK_TEXT_BUFFER_CONTENTS') failed, rc=VERR_NOT_SUPPORTED
I am logged into Standard (X11 display server) at the moment. But when I get a chance I will try the same thing with while using Wayland.
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: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by fth0 »

Just FYI: The following is example output of the VirtualBox Guest Additions 6.1.44 running in a Linux Mint guest with X11. At 19:47:19 I executed the second command, at 19:47:34 I copied a few characters from another terminal, and at 19:47:44 I pasted a few characters into the other terminal:

Code: Select all

$ sudo pkill -fx "/usr/bin/VBoxClient --clipboard"
$ VBOX_RELEASE_LOG_DEST="file=/tmp/clipboard.log" VBOX_RELEASE_LOG_FLAGS="time tid thread" VBOX_RELEASE_LOG="all.e.l.l2.l3.f" VBoxClient -d --clipboard
19:47:19.531400 00007f55b8097680 main     vboxClientSetSignalHandlers: ENTER
19:47:19.531444 00007f55b8097680 main     vboxClientSetSignalHandlers: LEAVE
19:47:19.531463 00007f55b8097680 main     Shared Clipboard: Starting X11 event thread ...
19:47:19.537289 00007f55b8097680 main     Shared Clipboard: X11 event thread started
19:47:19.537690 00007f55b8097680 main     Shared Clipboard: Guest features: 0x1 - Host features: 0x1
19:47:19.537765 00007f55b8097680 main     Worker loop running
19:47:34.680875 00007f55b7247700 SHCLX11  Shared Clipboard: 10 formats were found
19:47:34.680932 00007f55b7247700 SHCLX11  Shared Clipboard: Found target 'TIMESTAMP'
19:47:34.680940 00007f55b7247700 SHCLX11  Shared Clipboard: Found target 'TARGETS'
19:47:34.680945 00007f55b7247700 SHCLX11  Shared Clipboard: Found target 'MULTIPLE'
19:47:34.681449 00007f55b7247700 SHCLX11  Shared Clipboard: Found target 'SAVE_TARGETS'
19:47:34.681608 00007f55b7247700 SHCLX11  Shared Clipboard: Found target 'UTF8_STRING'
19:47:34.681707 00007f55b7247700 SHCLX11  Shared Clipboard: Found target 'COMPOUND_TEXT'
19:47:34.681812 00007f55b7247700 SHCLX11  Shared Clipboard: Found target 'TEXT'
19:47:34.681950 00007f55b7247700 SHCLX11  Shared Clipboard: Found target 'STRING'
19:47:34.682075 00007f55b7247700 SHCLX11  Shared Clipboard: Found target 'text/plain;charset=utf-8'
19:47:34.682198 00007f55b7247700 SHCLX11  Shared Clipboard: Found target 'text/plain'
19:47:34.682946 00007f55b7247700 SHCLX11  Shared Clipboard: Reporting format 'UTF8_STRING'
19:47:34.682996 00007f55b7247700 SHCLX11  Shared Clipboard: Reporting format 'TEXT'
19:47:34.683004 00007f55b7247700 SHCLX11  Shared Clipboard: Reporting format 'STRING'
19:47:34.683009 00007f55b7247700 SHCLX11  Shared Clipboard: Reporting format 'text/plain;charset=utf-8'
19:47:34.683024 00007f55b7247700 SHCLX11  Shared Clipboard: Reporting format 'text/plain'
19:47:34.683065 00007f55b7247700 SHCLX11  Shared Clipboard: X11 reported available VBox formats: 0x1
19:47:34.684282 00007f55b7247700 SHCLX11  Shared Clipboard: Converting X11 format 'UTF8_STRING' to VBox format 0x1
19:47:44.518255 00007f55b7247700 SHCLX11  Shared Clipboard: Converting VBox formats 0x5 to 'text/plain;charset=utf-8' for X11
In VirtualBox 7.0.x, the clipboard source code has additional log messages, especially for error conditions, so I expected even more output. But I currently don't have a test setup with VirtualBox 7.0.8 to see for myself.
agilis
Posts: 70
Joined: 21. Dec 2015, 18:46

Re: Wayland Env: Issue with copying text from Terminal & pasting results in extra lines

Post by agilis »

Okay the output you provided is nothing close to what I am seeing on my end. I'd be willing to work and investigate this some more with both your input and help.

Update:

I tried recreating your steps here and no output is produced. I also do not have a clipboard.log file in /tmp.
Post Reply