Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Discussions about using Linux guests in VirtualBox.
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by fencekicker »

Hi,

I've recently upgraded my VirtualBox Linux VM (running on a Windows 10 host) from Ubuntu 20.04 (focal) to 22.04 (jammy). My trouble is, I'm seeing some copy/paste issues that aren't new, but seem to have become more frequent. Copy/paste mostly works if booting and then starting the VM fresh. After a certain amount of time, and some VM suspend (Save the machine state) and resume operations, I'm getting to a state where I can copy from Linux, but when I try to paste in Slack or Firefox or Notepad in Windows will hang the destination app. This is very annoying when I'm trying to talk to co-workers while debugging, and I need to copy/paste data from the VM. I try to paste, Slack hangs, then I have to either wait some time until the app becomes responsive, or close the VM (after which the app becomes responsive right away). Powering down the VM and closing the VirtualBox window seems to make this go away, but it's far from ideal most of the time.

I have VirtualBox 6.1.40 on Win 10 Enterprise 21H2. I did a reinstall of the Guest Additions on Linux after the upgrade.

Any ideas on what (better) workarounds I could try? Any logs I can check to pinpoint the problem?
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by fencekicker »

Attaching VBox log saved from VirtualBox Log viewer, I noticed people tend to ask for this. Is this topic more appropriate for the Linux guests forum?
Attachments
ubuntu-64bit-dev-vm-2023-01-16-13-40-55.zip
VBox log (zipped)
(41.71 KiB) Downloaded 19 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by mpack »

There is no indication in the provided log that the Guest Additions are installed at all, which means that it cannot have a shared clipboard.

Also, this is not a question about the host OS. Topic moved to "Linux Guests".
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by fencekicker »

mpack wrote:There is no indication in the provided log that the Guest Additions are installed at all, which means that it cannot have a shared clipboard.
I did a quick search for "guest" and "clipboard" in the log and found these:

Code: Select all

00:00:03.323095 Shared Clipboard: Service loaded
00:00:03.323117 Shared Clipboard: Mode: Bidirectional
00:00:03.323268 Shared Clipboard: Service running in normal mode
Then

Code: Select all

00:00:13.004543 VMMDev: Guest Additions information report: Interface = 0x00010004 osType = 0x00053100 (Linux >= 2.6, 64-bit)
[...]
00:28:14.504605 VMMDev: Guest Additions capability report: (0x5 -> 0x4) seamless: no, hostWindowMapping: no, graphics: yes
Now, it's the first time I'm looking at a VirtualBox log, but naive me would take those 2 snippets as indications that a) guest additions are enabled and b) bidirectional shared clipboard is enabled. Shared folders work. Copy paste does work for a while after powering down the VM and then powering it up again. In fact, it's working right now, I can copy/paste from the Ubuntu VM:

Code: Select all

stefan@<vm-name>:~$ uname -a
Linux <vm-name> 5.15.0-57-generic #63-Ubuntu SMP Thu Nov 24 13:43:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
What would be a good way to check that the guest additions are properly installed?
Also, this is not a question about the host OS. Topic moved to "Linux Guests".
Thanks, and sorry for posting in the wrong forum.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by mpack »

fencekicker wrote: naive me would take those 2 snippets as indications that a) guest additions are enabled and b) bidirectional shared clipboard is enabled.
Naive you would be wrong. Those lines mean that the host software has enabled the requested APIs, so it tells me how your VM is configured. You still need to install drivers in the guest to allow it to access those features. When that happens there will be lines in the log like this one from a Debian VM of mine:
00:00:15.782225 VMMDev: Guest Additions information report: Version 6.1.36 r152435 '6.1.36'
00:00:15.782257 VMMDev: Guest Additions information report: Interface = 0x00010004 osType = 0x00053100 (Linux >= 2.6, 64-bit)
00:00:15.782350 VMMDev: Guest Additions capability report: (0x0 -> 0x0) seamless: no, hostWindowMapping: no, graphics: no
00:00:15.782405 VMMDev: vmmDevReqHandler_HeartbeatConfigure: No change (fHeartbeatActive=false)
This indicates that the Guest Additions (in this case from 6.1.36) are installed and were were successfully run by the guest OS.

I saw no such lines in your log, and since the VM runs to completion I should have seen them.

See chapter 4 on how to install the GAs.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by scottgus1 »

The log is from a save-stated VM. It's possible that's the cause of the partial and incomplete list of Guest Additions log lines.

Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. In the "Logs" subfolder, zip the VM's "vbox.log", and post the zip file, using the forum's Upload Attachment tab. (Configure your host OS to show all extensions so you can find the "vbox.log", not "vbox.log.1", etc.)
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by fth0 »

scottgus1 wrote:The log is from a save-stated VM. It's possible that's the cause of the partial and incomplete list of Guest Additions log lines.
Yes, probably. When restoring the Saved state of the VM (including the state of the VirtualBox Shared Clipboard), the Host-to-Guest Communications Manager (HGCM) notified the VirtualBox Guest Additions (GA), which were already running in the guest OS since a previous VM run. The corresponding log messages are
ubuntu-64bit-dev-vm-2023-01-16-13-40-55.log wrote:
00:00:13.002120 HGCM: Restoring [VBoxSharedClipboard]
00:00:13.002495 Shared Clipboard: New Clipboard API enabled
00:00:13.004543 VMMDev: Guest Additions information report: Interface = 0x00010004 osType = 0x00053100 (Linux >= 2.6, 64-bit)
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by fencekicker »

scottgus1 wrote:The log is from a save-stated VM. It's possible that's the cause of the partial and incomplete list of Guest Additions log lines.
Yes, I think that's the case. I prefer to save the VM state after a day's work.
Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. In the "Logs" subfolder, zip the VM's "vbox.log", and post the zip file, using the forum's Upload Attachment tab. (Configure your host OS to show all extensions so you can find the "vbox.log", not "vbox.log.1", etc.)
I'll try that, thanks. I might not be able to reproduce the issue without saving the VM, but I can always save the first log after powering up, and then the last log before the issue happens.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by scottgus1 »

We'll need the log from a fully shut down VM, not save stated. Please wait until you see the problem after fulfilling this condition, then send the log per the instructions.
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by fencekicker »

scottgus1 wrote:We'll need the log from a fully shut down VM, not save stated. Please wait until you see the problem after fulfilling this condition, then send the log per the instructions.
Are you saying to try to reproduce the problem after powering up the VM instead of resuming? I'm not sure the issue will reproduce only after a power up, but I can try. I power down/up the machine quite rarely, usually I save the VM state and that's it (I do that often because of some HW / driver issue that sometimes causes my laptop to crash when the screen is locked).
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by fencekicker »

Well, for what it's worth, I was able to reproduce the issue today. I have logs from when the VM started (I always save the VM logs when it starts just in case) and logs from the last resume. There have been a few resumes in between.

This is most annoying, since I can't copy/paste anything from VirtualBox to either Firefox, Slack... Any app I try to paste in freezes.
Attachments
ubuntu-64bit-dev-vm-2023-04-25-14-24-05.log
latest resume log
(109.1 KiB) Downloaded 5 times
ubuntu-64bit-dev-vm-2023-04-05-14-42-46.log
Startup log
(106.82 KiB) Downloaded 4 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by scottgus1 »

I see that you have running Guest Additions installed, good.
I don't see a use of shared clipboard in the "Startup log". Did you try it in that log?

The "latest resume log" shows these:
00:24:05.076770 Shared Clipboard: Reading guest clipboard data for Windows host failed with VERR_TIMEOUT
00:24:47.181017 Shared Clipboard: Reading guest clipboard data for Windows host failed with VERR_TIMEOUT
00:25:37.196782 Shared Clipboard: Reading guest clipboard data for Windows host failed with VERR_TIMEOUT
00:26:33.348444 Shared Clipboard: Reading guest clipboard data for Windows host failed with VERR_TIMEOUT
00:27:31.191765 Shared Clipboard: Reading guest clipboard data for Windows host failed with VERR_TIMEOUT
00:31:05.366032 Shared Clipboard: Reading guest clipboard data for Windows host failed with VERR_TIMEOUT
Sounds like a service failure inside the VM.

I wouldn't know what else to suggest to diagnose this one. Others may have ideas.

One suggestion: If this never happens after the VM has started from full shutdown but does happen after the VM has started from save-state, try stop using save-state.
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by fencekicker »

scottgus1 wrote:I see that you have running Guest Additions installed, good.
I don't see a use of shared clipboard in the "Startup log". Did you try it in that log?
I think I simply collected the logs after startup, at that point I hadn't done anything with the VM.
Sounds like a service failure inside the VM.
Is there maybe a log file on the VM that I can check?
One suggestion: If this never happens after the VM has started from full shutdown but does happen after the VM has started from save-state, try stop using save-state.
Well, what I end up doing is using save-state until copy/paste doesn't work anymore :). Then it depends, sometimes just suspending the VM and resuming after a while can fix copy/paste, but more often I need to shut down the VM and start it again.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by fth0 »

fencekicker wrote:Is there maybe a log file on the VM that I can check?
Not automatically, but you could create one with the following commands:

Code: Select all

# Clipboard logging (X11 guest)
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
fencekicker
Posts: 33
Joined: 13. Oct 2022, 15:45

Re: Copy/paste issues more frequent after VM upgrade to Ubuntu 22.04 (jammy)

Post by fencekicker »

fth0 wrote: Not automatically, but you could create one with the following commands:

Code: Select all

# Clipboard logging (X11 guest)
...
Thanks, I tried this, using a non-volatile folder for the log file (since I might rage shutdown when copy/paste stops working, it's that annoying). Unfortunately, I don't see any output in the clipboard.log file after the problem reproduced. The only output is what VBoxClient printed to stdout / stderr on startup. I ran the commands in a screen, since 'VBoxClient -d --clipboard' seems to run in the foreground now. I'll try again after a hard shutdown, see if maybe I get luckier next time.
Post Reply