Why is VB taking over the guest clipboard with VB clipboard functionality disabled for the guest?

Discussions about using Linux guests in VirtualBox.
caramba
Posts: 20
Joined: 9. Jan 2014, 20:58

Why is VB taking over the guest clipboard with VB clipboard functionality disabled for the guest?

Post by caramba »

We are currently running VB 6.1.6 and since VB 6.1.2 we have noticed that we are unable to maintain selection on text via VNC client (both TigerVNC and RealVNC client) to a CentOS 7 guest VM running included TigerVNC server on a Windows 10 PC (both x64)

The problem manifested in CentOS Gnome as follows:
1. mouse select=> drag, selects, then loses selection immediately on releasing the mouse left button
2. ctrl-a selects then immediately loses selection on releasing the keys
3. the right click => copy menu option didn't work at all (only "Copy to..." option remains functional)

As a result we opened the following issue with TigerVNC https://github.com/TigerVNC/tigervnc/issues/995

They recommended that we upgrade from the CentOS provided version of TigerVNC to the latest version, from here: https://bintray.com/tigervnc/stable/tig ... S%2Fx86_64

We did this, and rebooted the host environment however the problem persisted.

We then removed the VB guest additions via VboxLinuxAdditions.run uninstall

On removal of the guest additions the selection immediately started working and all functions as normal.

We then re-installed the guest additions (as we need them for folder sharing), rebooted - and the problem immediately begins again.

I'm not sure what what to do but this is causing frustration for a number of our team using the same environment config so any help would be greatly appreciated.

thank you.
Last edited by caramba on 29. Jun 2020, 14:57, edited 2 times in total.
caramba
Posts: 20
Joined: 9. Jan 2014, 20:58

Re: On Window10 host, CentOS Guest Additions break tigerVNC copy and paste functionality

Post by caramba »

Here is the latest from TigerVNC support...

Thank you for the log. It shows that there is something on the server side that is aggressively taking over the clipboard. Since uninstalling VirtualBox guest additions helps we must assume it is something included there. I don't quite understand how they get started in a VNC session though...
Unfortunately there isn't much we can do now. You'll need to report this issue to VirtualBox and have them adjust the behaviour of their stuff. Feel free to link to this issue so they can better understand the problem.

This has been happening since VB 6.1.2

Any help would be GREATLY appreciated! (as this is driving our team nuts)

thanks very much.
caramba
Posts: 20
Joined: 9. Jan 2014, 20:58

Re: On Window10 host, CentOS Guest Additions break tigerVNC copy and paste functionality

Post by caramba »

I'm absolutely astounded by the complete silence on this.

Are we truly the only people accessing a CentOS 7 VM with guest additions on it via VNC?

Please please - if there are any wise people out there we'd love to hear any constructive comments from you!

thanks in advance
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: On Window10 host, CentOS Guest Additions break VNC copy and paste functionality

Post by mpack »

caramba wrote: Are we truly the only people accessing a CentOS 7 VM with guest additions on it via VNC?
Quite possibly. What's the combined probability of (Centos 7 | VNC | VirtualBox)?

Or perhaps the fact that VirtualBox (official) has no VNC functionality is behind the lack of comment. The only VNC function is a third party extension typically only used by forks of the VirtualBox open source. This is the official VirtualBox discussion site - there is no discussion of forks here.

Or if you mean a direct VNC connection using guest software and standard networking, then again it's hard to see the relevance to the VirtualBox forums, other than the "choose an appropriate networking mode" stuff well covered in the manual.
caramba
Posts: 20
Joined: 9. Jan 2014, 20:58

Re: On Window10 host, CentOS Guest Additions break VNC copy and paste functionality

Post by caramba »

Quite possibly. What's the combined probability of (Centos 7 | VNC | VirtualBox)?
I would have thought quite high for the following reasons:
1. This only involves Centos 7 standard packages and Virtualbox (as the VNC server is available as standard for CentOS 6 & 7), so really isn't that esoteric.
2. Using VNC as the interface is great as it provides a consistent server desktop view, independent of the underpinning server technology - which may be VB, or physical, or indeed some other virtual environment
Or perhaps the fact that VirtualBox (official) has no VNC functionality is behind the lack of comment. The only VNC function is a third party extension typically only used by forks of the VirtualBox open source. This is the official VirtualBox discussion site - there is no discussion of forks here.
This issue is not about VNC functionality per se. It is rather that the Virtual Box Guest additions have - since 6.2 - started "stealing" the guest clipboard functionality, even with the Virtual Box clipboard configured to be fully disabled for the guest VM.

My question could possibly be rephrased as: Why is VB GA stealing the clipboard when VB clipboard functionality is set to disabled for the guest.

Thoughts welcome!
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Why is VB taking over the guest clipboard with VB clipboard functionality disabled for the guest

Post by mpack »

Out of 1000 computer users, what fraction uses CentOS? Out of 1000 CentOS users, how many use VNC? Out of 1000 Centos VNC users, how many use VirtualBox? Out of 1000 Centos VNC VirtualBox users, how many care about the clipboard? Given 1000 of the latter, how many post on the VirtualBox forums?

And you honestly think this will be a big number despite none of them being mainstream? My own guess is that the final number is likely around 1 ± 1.

I assume the "clipboard functionality" you refer to is a part of VNC, since of course GA clipboard function will definitely stop working if you disable it.

Does VNC use any VirtualBox code? Otherwise I can't think of a reason why a function that copies clipboard data from A to B could be interefered with by anything. AFAIK there is no OS functionality for doing this, therefore there's nothing in the OS to interfere with: VNC and VirtualBox should each be doing their own thing: unless one decided to piggyback on the other's code.
caramba
Posts: 20
Joined: 9. Jan 2014, 20:58

Re: Why is VB taking over the guest clipboard with VB clipboard functionality disabled for the guest

Post by caramba »

LOL - do you truly think I'm going to engage with your random guesses as to how many people use Enterprise Linux on Virtualbox?

The only things of relevance here are:
1. Virtual Box emulates a server and as such it should NOT arbitrarily interfere with guest operating system function.
2. If it doesn't reliably adhere to 1, it will die.

Problem summary notes:
1. VNC server clipboard functionality only breaks when:
- the host is Windows 10 x64; AND
- Virtual Box is 6.2 or newer; AND
- guest additions are installed on the guest CentOS 7 server.

2. VNC server clipboard functionality works perfectly when:
- the host is Linux; OR
- guest additions are not installed on the guest CentOS 7 server (regardless of whether the host is Windows or Linux)

Our conclusion is thus that the problem is introduced by the windows host guest additions for VB 6.2 and later. Enabling / disabling VB clipboard functionality has no apparent effect on behaviour.

If anyone has something useful to contribute towards resolving the problem we are seeing please let me know.

thanks.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Why is VB taking over the guest clipboard with VB clipboard functionality disabled for the guest

Post by mpack »

caramba wrote:LOL - do you truly think I'm going to engage with your random guesses as to how many people use Enterprise Linux on Virtualbox?
In fact I asked you to provide the guesses, and since you seem pretty defensive about it I assume your guess is similar to mine. I remind you that you are the one who raised this question of frequency with "Am I the only one...". Why raise a question you don't want answered?

And yes, if you are going to talk bull (like why a non-customer is ASTOUNDED that nobody hangs on his every word about his parochial interests) then yes, I expect you to be able to reason about it, otherwise this conversation - which has no value to me otherwise - is entirely wasting my time. So, with that, I'll say goodbye.
caramba
Posts: 20
Joined: 9. Jan 2014, 20:58

Re: Why is VB taking over the guest clipboard with VB clipboard functionality disabled for the guest

Post by caramba »

:lol: bye mpack.

If anyone has anything useful to contribute I'd love to hear it.

thanks
Last edited by caramba on 1. Jul 2020, 14:05, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Why is VB taking over the guest clipboard with VB clipboard functionality disabled for the guest

Post by scottgus1 »

caramba, there are a couple things that need to be known about the Virtualbox forums that will smooth one's experience and expectations.

Those who are Oracle's customers get direct-to-the-developers support, and therefore don't post here on the forums. Users of free Virtualbox (namely, freeloaders like me :lol: ) are entitled to zero support, and post here on the off chance that another user who is volunteering his/her time, and happens to notice the post, and happens to know how to fix it or would like to try.

With this in mind it should be easy to see why no one posted on your topic for a while. Remember that we are all volunteers here who for our own reasons/joy/gluttony-for-punishment try to help unknown individuals on the internet get their Virtualbox working. Actual Oracle employees' names are in red, and are few and very far between.

That said, I too have had interference on the clipboard because of multiple programs wanting to access it at once: RDP & VNC, VNC & Virtualbox, etc. Virtualbox has a shared clipboard option, which if it interferes with TightVNC (or TightVNC interferes with Virtualbox, we have not and maybe cannot pin down who's causing the interference) Virtualbox's shared clipboard can be turned off if you find that giving TightVNC clipboard access is more important.

First, if you have uninstalled Guest Additions, please reinstall them.

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

Right-click the guest in the main Virtualbox window's guest list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.

The log will show the state of the Guest Additions and shared clipboard.
caramba
Posts: 20
Joined: 9. Jan 2014, 20:58

Re: Why is VB taking over the guest clipboard with VB clipboard functionality disabled for the guest

Post by caramba »

Well met Dr Jekyll :lol: , thanks for the constructive assistance and diplomatic observations.

I have I believe followed your instructions correctly. Here is the uploaded the zip file:
DEV-2020-07-01-09-01-45.zip
VB zipped logfile.
(34.14 KiB) Downloaded 12 times
The following may also be relevant:
  • 1. The issue we raised with TigerVNC and their investigation and feedback (bottom probably most relevant): https://github.com/TigerVNC/tigervnc/issues/995
    2. The issue happens immediately and reliably (since Virtual Box 6.1.2 - we have been using this build configuration successfully since VB 5.x)
    3. We can successfully paste into VNC from an external copy source
    4. THE PROBLEM: If we copy within the VNC guest environment eg.
    • a. if we try to copy text in Gnome gedit then there is nothing to paste, neither to another location on the guest within VNC, nor to an external target ie. Windows Notepad
      b. if we try to copy/move a file via the Nautilus "Copy/Cut" menu then the paste menu option remains greyed out. (notably however, the Nautilus "Copy/Cut to..." menu options works fine)
    5. Nothing else we are aware of is problematic on the guest; the server behaves 100%
    6. We see this consistently across our team's laptops (we all use the same server build)
Just to say again, your constructive help on this is greatly appreciated - if we can get this understood and resolved it will remove a significant and persistent headache for our entire team.
Last edited by caramba on 2. Jul 2020, 11:12, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Why is VB taking over the guest clipboard with VB clipboard functionality disabled for the guest

Post by scottgus1 »

I have had similar occasional results using UltraVNC on my Windows host, both with and without a Virtualbox guest running: copy in the host or the VNC window and nothing pastes, or Paste is grayed out (because there's nothing in the clipboard to paste). I have not had trouble copy/pasting within the guest itself, though, like it appears you're having.

The log shows Virtualbox Shared Clipboard turned off in this run of the guest:
00:00:03.100118 Shared Clipboard: Mode: Off
Please confirm if the TightVNC clipboard glitch happened while this guest was running for this particular instance from which the log was copied?

Your guest is running old Guest Additions:
00:00:02.611693 VirtualBox VM 6.1.8 r137981 win.amd64 (May 14 2020 20:30:31) release log
00:00:18.197405 VMMDev: Guest Additions information report: Version 6.1.2 r135662 '6.1.2'
Try the GAs that install from the guest's Devices menu, Insert Guest Additions CD Image". Up-to-date GAs might fix the problem and let shared clipboard and TightVNC work.

A new file-transfer for clipboard might be causing unintended trouble:
--clipboard-file-transfers enabled|disabled:
Specifies if clipboard file transfers are allowed between host and guest OSes or not.
Try this vboxmanage command:
VBoxManage modifyvm "vm name" --clipboard-file-transfers disabled
Also try something relating to this section in the manual: https://www.virtualbox.org/manual/ch12. ... 1-services.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Why is VB taking over the guest clipboard with VB clipboard functionality disabled for the guest

Post by scottgus1 »

I'm also thinking of other ways to look at this problem that might not be just TightVNC vs Virtualbox, live on pay-per-view next Saturday 8pm. :lol:

There's at least three different ways to remote into a guest:
1. Remote directly into the guest OS itself, using whatever remote software is running in the guest.
2. Remote into Virtualbox's remote desktop server, which normally uses MS RDP protocol but can be set to VNC protocol.
3. Remote into the host.

How are you remote-controlling this guest? And are more than one person remoting into a guest at the same time?

I'm curious if you could set up a test where you remote into someone else's guest while the host owner is not using the computer? Virtualbox's shared clipboard could be active, but I wonder if there will be trouble if the host owner isn't typing & copy/pasting at the time.

I'm also curious if the guest's X window environment might have a hand in this. Can you set up a Windows guest temporarily, use TightVNC with Virtualbox shared clipboard enabled, and see if you have the same trouble?

Ultimately I think it may depend on disabling Virtualbox shared clipboard (sorry if I missed that you tried disabling shared clipboard in earlier posts).
caramba
Posts: 20
Joined: 9. Jan 2014, 20:58

Re: Why is VB taking over the guest clipboard with VB clipboard functionality disabled for the guest

Post by caramba »

hey @scottgus1 - thanks!
Please confirm if the TightVNC clipboard glitch happened while this guest was running for this particular instance from which the log was copied?
I turned off the clipboard some time ago to minimise any potential conflict areas - so yes, the problem occurs even with the clipboard off.
Also just a note in case relevant, CentOS uses "TigerVNC" rather than "TightVNC"
Try the GAs that install from the guest's Devices menu, Insert Guest Additions CD Image". Up-to-date GAs might fix the problem and let shared clipboard and TightVNC work.
Sorry about the GA version! - I must have rolled back and wiped out. I have now upgraded to from 6.1.8 to 6.1.10 and installed the 6.1.10 GAs on the VM.
Sadly, the issue persists
VBoxManage modifyvm "vm name" --clipboard-file-transfers disabled
Unfortunately this doesn't appear in my list of options and i get "VBoxManage.exe: error: Unknown option: --clipboard-file-transfers" when I run it.
I have successfully run "VBoxManage modifyvm "DEV" --draganddrop disabled". Sadly, the issue persists.
How are you remote-controlling this guest? And are more than one person remoting into a guest at the same time?
The host PC is personal to the only person accessing the guest VM. The guest VM has only Host-only and NAT adapters enabled. It is on a private 192.168.56.x subnet.

The access method is via DOS batch file running RealVNC as follows:

Code: Select all

START /B C:\OriginSystems\applications\VNC\VNC-Viewer-Windows-64bit.exe -config vnc_DEV.vnc
where vnc_DEV.vnc is a realVNC configuration file containing the following redacted information:

Code: Select all

ConnTime=2017-05-11T09:38:50.022Z
FriendlyName=DEV
Host=dev.localdummydomain:1
Quality=High
Password=???????
RelativePtr=0
Uuid=?????
(dev.localdummydomain is the guest server and dev.localdummydomain IP is hard set in the host PC's windows hosts file)

ADDITIONALLY: I should mention I see an error when installing the 6.1.10 GAs (we've been seeing this for some versions of GAs now but - maybe stupidly - I haven't paid attention to)

Code: Select all

Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.10 Guest Additions for Linux........
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel 
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 
3.10.0-1127.13.1.el7.x86_64.
dracut-install: ERROR: installing '/etc/crypttab/bin/ndctl'
/usr/lib/dracut/dracut-install -D /var/tmp/dracut.5aLATj/initramfs -a /etc/bootpasswd /etc/crypttab/bin/ndctl
VirtualBox Guest Additions: Running kernel modules will not be replaced until 
the system is restarted
While the GA install is running and the error displays, I look on the server for a file called /etc/crypttab/bin/ndctl and no such file exists as shown here:

Code: Select all

# find / -name ndctl
/etc/ndctl
/usr/bin/ndctl
/usr/share/bash-completion/completions/ndctl
I assume it is the fact that the ndctl VB GA install is looking for does not exist that is causing the problem? (/etc/bootpasswd exists and is proprietary to us so I think can be safely ignored).
The other observation I have is that crypttab is mentioned in the folder but we are not using luks encryption on the guest.

I do hope this is useful but sadly none of the remedial work tried here has changed the behaviour.

(If I could, I would use the VM without GA installed but the problem is that we need the shared folder ability - which requires 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: Why is VB taking over the guest clipboard with VB clipboard functionality disabled for the guest

Post by scottgus1 »

Hmm this is a real puzzle! So you still have the same trouble with Virtualbox's shared clipboard turned off...

I got the same "Unknown option" error trying the command on one of my guests. It appears the manual and 6.1.10 are a little out of sync. Sorry for not testing it myself at the beginning.

I don't doubt that there is some conflict between Virtualbox, VNC, and/or the guest's window renderer. Unfortunately I do doubt I will be able to fix it.
caramba wrote:The host PC is personal to the only person accessing the guest VM. The guest VM has only Host-only and NAT adapters enabled. It is on a private 192.168.56.x subnet.
If I understand this correctly, each user has a guest running on the user's host PC. That user is the only one remoting into the guest. The guest has a Host-Only network to the user's host PC. I gather from the Virtualbox executable in the log (VirtualboxVM.exe) that the guest window is visible on the host's PC, or could be visible.

If this understanding is correct, then here are a couple workarounds. The first is a 'frame challenge', like they do on Stack Exchange. :lol:

If you can or could see the guest's Virtualbox window on the host PC screen directly, then why remote into the guest? (Or am I misunderstanding the need for remote-in?)

You have very good reasons for your particular work flow. But could a change in guest access be helpful?

The guest's Virtualbox window can be seen and accessed on the host directly without VNC, thus hopefully avoiding copy/paste conflict. It is also possible to remote into the Virtualbox window itself instead of remoting into the guest OS, if such remote-in is needed so other PC's can access the guest, using the Virtualbox Remote Desktop Server, and possibly avoid copy/paste conflict.

If I am completely missing an important point, then here is another workaround: Don't use Guest Additions Shared Folders. Rather, use real host-OS shared folders passed through the Host-Only network. Then you can not run Guest Additions, stay with VNC, avoid copy/paste conflict, and still be able to pass data between host and guest. In fact, GASFs are really only for manual drag-n-drop file & folder copying between host and guest, not for anything else. But real shared folders can run, edit, churn databases, etc.
Post Reply