Copy/Paste (Clipboard like) functionality from a VNC desktop

1

3

I use TightVNC, RealVNC to access the Remote Linux(CentOS,Ubuntu) desktops by running a vncserver on the remote machine. When I connect to those servers from my Windows host:

  1. Can I use the Copy/Paste functionality on the VNC client desktop window. i.e. Copy some text on some terminal open inside the VNC client desktop window and paste it into some text file on my local windows machhines and vice-a-versa?

  2. I checked TightVNC options but did not see anything. Can it be done by a)Running vncserver on the remote machine with some options or b)By running some configuration on remote machine to enable this. How could I get it done?

  3. Also is this kind of Copy/Paste functionality possible in Microsoft Windows Remote Desktop connection/Terminal session protocol?

goldenmean

Posted 2012-01-10T15:00:00.797

Reputation: 2 087

If you copy text from a VNC window, it goes onto your local clipboard, no? Try it and let me know if it works. – Yitzchak – 2012-01-10T15:54:08.697

@Yitzchak - No it surely doesnt because it goes into the remote machines 'clipboard equivalent'. and that content seems inaccessible on the Local(windows) machine. – goldenmean – 2012-01-10T16:01:31.003

Answers

4

This should work if you've got vncconfig running as a VNC client application. The man page clearly states that it is required for X clipboard support, so make sure that ~/.vnc/xstartup on the server side contains the following line somewhere:

vncconfig -iconic &

to ensure it's started automatically. If you already have a running VNC session without an active instance of vncconfig, just open a terminal on your VNC desktop and start it manually.

CodeGnome

Posted 2012-01-10T15:00:00.797

Reputation: 1 841

0

Another option is to use autocutsel as mentioned in a 2015 thread. In fact, I installed it a few moments ago and started it (autocutsel -s CLIPBOARD -fork) manually without restarting the vnc server or session:

raub@desktop:~$ sudo apt-get install autocutsel
Reading package lists... Done
[...]
Preparing to unpack .../autocutsel_0.10.0-1_amd64.deb ...
Unpacking autocutsel (0.10.0-1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up autocutsel (0.10.0-1) ...
raub@desktop:~$ autocutsel -s CLIPBOARD -fork
raub@desktop:~$

The above quote was copied from the ubuntu host running tightvnc server to my macbook pro through screen sharing in Mojave (just in case there are version idiosyncrasies).

The reason I picked autocutsel is because I could not find vncconfig in the tightvncserver package. Now I saw it works, I also added it to my ~/.vnc/xstartup so it is automagically started:

cat >> ~/.vnc/xstartup << EOF

# Ensure clipboard works
/usr/bin/autocutsel -s CLIPBOARD -fork
EOF

raubvogel

Posted 2012-01-10T15:00:00.797

Reputation: 11