I have a VNC session running and I'd like to share the clipboard between the two systems bidirectionally. The operation that's failing is where I take a URL from my desktop's web browser, go to my vnc session, highlight the text in the address bar, hit delete the old URL, and then CTRL-V to paste the URL from my desktop.

The part that's failing is where I delete out the old URL. For some reason highlighting the URL and deleting it using any method I can think of (backspace, delete key, right clicking and selecting "delete" from the context menu, etc) results in that text being cut to the clipboard and sent to the client computer (clobbering what I was trying to copy in the first place).

If I don't highlight and instead just hold down the backspace key until the URL is gone, the clipboard is preserved so it appears to only affect this one specific operation. I can workaround the issue (sort of) by disabling clipboard updates from the VNC server (so updates only go from clients to the server) but I want bidirectional support.

Since it happens even when deleting from the context menu it doesn't seem like key mapping. I just happen to be doing this with VNC so it may not be related but I've never had this sort of behavior with X11 or GNOME before (which I use at home on a daily basis). I've also reproduced this going between gedit and notepad with identical results. So it doesn't seem to be a browser issue.

  • VNC Server: TigerVNC 1.1
  • VNC Client: RealVNC 5.2
  • Server Desktop: GNOME 2.28 on RHEL 6.6
  • Client Desktop: Windows 7
  • Does this also happen if you only select the text without deleting it? Then it could it be that the vnc server is pushing the X selection to the clipboard. – Fabian Jan 12 '15 at 20:25
  • OK, I'm an idiot. That was it. I unchecked that box and it started working like I was expecting. Could you post that as an answer so that I can award the bounty to someone? Either way I lose it. – Bratchley Jan 12 '15 at 20:30
  • For newer version of VNC, you can check here: unix.stackexchange.com/questions/433612/… – Jeremy Pare Apr 16 '18 at 17:28

It appears that the VNC server is pushing the X Window selection to the clients clipboard.

The X Window selection gets updated whenever you select text. In your case this was done by selecting the text in the address bar of your browser, the vnc server then copied this into your client clipboard which overwrote your local clipboard. The act of deleting the selected text is not relevant, thus it did not matter how you deleted this.

The solution is to disable the "Send primary selection to viewers" option in vncconfig


Lastly, the SendPrimary option has been moved to VNC Server. So now to disable the SendPrimary option, you have to add the following line to .vnc/config.d/vncserverui-virtual:


If you want to disable it globally, add it to /etc/vnc/config.d/common.custom.

You need to restart VNC Server for this to take effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.