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

Discussions about using Linux guests in VirtualBox.
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 »

It doesn't appear that logging works even when VBoxClient is started when you log on. Like the VBoxClient instances that are running without you having to start them up from the command line.

I did some fiddling and intercepted VBoxClient when it started so that it'd have the environment variables we set up for when it was restarted. The logs are showing up but nothing is ever written to them.
agilis
Posts: 65
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: 16. Jun 2023, 04:29 It doesn't appear that logging works even when VBoxClient is started when you log on. Like the VBoxClient instances that are running without you having to start them up from the command line.

I did some fiddling and intercepted VBoxClient when it started so that it'd have the environment variables we set up for when it was restarted. The logs are showing up but nothing is ever written to them.
Wow you have done some extensive research! Nice job!! You seem to be more familiar with these types of operations than me so kudos!! I really wish a developer would chime in to analyze and comment on your observations. :( The issue I submitted to the bug tracker has no feedback as of today. :( I can only assume this is just another example of VirtualBoxs lack of Wayland support at this time.

In the mean time, I wish I could do something to help move the troubelshooting process further along. Have you at all tried the latest developer build of VirtualBox?
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 haven't grabbed the latest code out there. When I have time I've been looking at is the source code that I think is what were using and compiling VBoxClient. Hopefully when I have some spare time I can get a better look at what is going on. It took awhile to get the thing to compile! Then I found myself looking at the Darwin code.... arrghhh.

I did notice that VBoxClient --clipboard gets started by twice, by two different programs I think. I'm guessing that the 2nd one that gets started shuts down since that's what happens on the command line if VBoxClient is started more than once.
fth0
Volunteer
Posts: 5621
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

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

Post by fth0 »

ufguy wrote: 20. Jun 2023, 21:59 I did notice that VBoxClient --clipboard gets started by twice, by two different programs I think.
No, well, yes, but the first starts the second. ;) You can verify that by e.g. ps -elfH or by simply looking at the (parent) process IDs.

If you start the VBoxClient without "-d", do you see two processes again?
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 »

According to the info I have on hand it's this:

systemd(1)---lightdm(1220)---lightdm(1526)---lightdm-session(1559)---VBoxClient(1697)---pstree(1699)
--clipboard

systemd(1)---lightdm(1220)---lightdm(1526)---xfce4-session(1559)---VBoxClient-all(1951)---VBoxClient(1957)---pstree(1963)
--clipboard


The VBoxClient processes I see have IDs from 1703 to 1748 which are below the the id for VBoxClient-all(1951).
I am speculating that the xfce4-session is trying to start up VBoxClient but it gets shutdown.
fth0
Volunteer
Posts: 5621
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

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

Post by fth0 »

In a Linux Mint guest, I only have pairs of VBoxClient processes that are children of systemd(1), like in

Code: Select all

systemd(1)
|\
| VBoxClient --clipboard
| \
|  VBoxClient --clipboard
|\
| VBoxClient --seamless
| \
|  VBoxClient --seamless
 \
  VBoxClient --vmsvga
  \
   VBoxClient --vmsvga
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 »

That's what I see later after things boot up and I'm in the desktop. A parent VBoxClient and a child. The child looks like it's the one that's doing any work. I don't see the parent getting any processing time or any new memory. At least it appears that way for the VBoxClient's running with --clipboard.
agilis
Posts: 65
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: 21. Jun 2023, 00:34 In a Linux Mint guest, I only have pairs of VBoxClient processes that are children of systemd(1), like in

Code: Select all

systemd(1)
|\
| VBoxClient --clipboard
| \
|  VBoxClient --clipboard
|\
| VBoxClient --seamless
| \
|  VBoxClient --seamless
 \
  VBoxClient --vmsvga
  \
   VBoxClient --vmsvga
This is what I'm seeing when I execute the command in the Wayland Environment:

Code: Select all

/usr/bin/VBoxClient --clipboard
  /usr/bin/VBoxClient --clipboard
/usr/bin/VBoxClient --seamless
  /usr/bin/VBoxClient --seamless
/usr/bin/VBoxClient --draganddrop
  /usr/bin/VBoxClient --draganddrop
/usr/bin/VBoxClient --vmsvga-session
  /usr/bin/VBoxClient --vmsvga-session
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 »

Ok, I've been able to dig into the VBoxClient code some and build it. Adding stdlib code to the C++ files has proven to be a little tricky since it looks like the .cpp files are being built with gcc not g++. If you add any stdlib code it does not link.

There definitely is something going on in the clipboard code when pasting out of the VirtualBox. But I shifted focus onto logging. I found logging code that uses logging code. What that appears to be is logging code that outputs text when VBoxClient is starting up/shutting down. Xterm text. But, I think that is good since it's possible that the code that is supposed to manage our "clipboard.log" file may likely be using the same logger code. And that logger is at least functioning for the terminal.
agilis
Posts: 65
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: 26. Jun 2023, 02:09 Ok, I've been able to dig into the VBoxClient code some and build it. Adding stdlib code to the C++ files has proven to be a little tricky since it looks like the .cpp files are being built with gcc not g++. If you add any stdlib code it does not link.

There definitely is something going on in the clipboard code when pasting out of the VirtualBox. But I shifted focus onto logging. I found logging code that uses logging code. What that appears to be is logging code that outputs text when VBoxClient is starting up/shutting down. Xterm text. But, I think that is good since it's possible that the code that is supposed to manage our "clipboard.log" file may likely be using the same logger code. And that logger is at least functioning for the terminal.
Wow good work!! We need developers to look at this and your findings. You want to respond to my ticket? Can only help future progress on it.

https://www.virtualbox.org/ticket/21716
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'll take a look at it once I get past the logging issue. Be interesting to see if I can recreate the problem in it. Funny that we share some of the problems but not all of them! :D
agilis
Posts: 65
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: 26. Jun 2023, 22:23 I'll take a look at it once I get past the logging issue. Be interesting to see if I can recreate the problem in it.
My organization is strict and I cannot spend a lot of time on troubleshooting this. I wish I had as much knowledge as you did in order to assist you further. I can execute commands, report the output, etc. if you need me too.
ufguy wrote: 26. Jun 2023, 22:23 Funny that we share some of the problems but not all of them! :D
Oh I know. I just cannot carry out day-to-day operations in the Wayland environment. The copy and paste thing is a deal breaker. So when I have my team move to AlmaLinux, I have instructed them to use the X11 environment.
galitsyn
Posts: 82
Joined: 4. Jul 2012, 16:09

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

Post by galitsyn »

Hi guys,

Just duplicating a comment from https://www.virtualbox.org//ticket/21716#comment:3 if anyone interested to give it a try.

The latest "Development snapshots" build from Test Builds page (https://www.virtualbox.org/wiki/Testbuilds) has now experimental support for clipboard sharing with Wayland guest. Guests which are running Gnome on Wayland should now be able to exchange text, html and image clipboard content. Implementation for Plasma on Wayland is still in progress and is not stable now.

To make it work, both parts -- host package and Guest Additions -- need to be updated. If you wold like to give it a try and leave a feedback, that would be much appreciated.

Please note that Wayland host is not yet supported. DnD into Wayland guest is not yet supported either.
Post Reply