How to enable text copy and paste for VNC
Matthew Harrington
I am accessing a remote machine by VNC Viewer. Sometimes I find I can't copy and paste text from VNC Viewer.
19 Answers
None of the posted answers worked for me. vncconfig wasn't installed and other posts indicates that those fix only helped when c&p worked in the past. This was not the case for me on a fresh machine.
Using tight vnc server on a Raspberry Pi 3, I had to install autocutsel:
sudo apt-get install autocutseladd the following line to ~/.vnc/xstartup:
autocutsel -forkMy complete xstartup file now looks like this:
#!/bin/sh
xrdb $HOME/.Xresources
# -solid grey gaves us a real mouse pointer instead of the default X
xsetroot -solid grey -cursor_name left_ptr
# Allow copy & paste when ClientCutText is set to true on the client side
autocutsel -fork
export XKL_XMODMAP_DISABLE=1
/etc/X11/XsessionTo apply the changes, restart VNC server:
vncserver -kill :1
vncserver :1 -localhost -geometry 1400x1050Adjust the parameters according to your needs (display, resolution, ...) Now make sure that the property ClientCutText is set to true on your client. In real vnc viewer, open the properties and choose expert tab.
Now copy and paste works for me :)
3If you can't copy & paste text, first check if you run "vncconfig &".
If you still can't, check terminal number n and run "vncconfig -display :n &".
Hope this helps.
3well this is what worked for me :
all i did is open VNC using "Run as administrator " and I was able to copy paste from windows 10 to Mac over VNC
0If you're having problems pasting from windows client to a remote mac, do remember to use the appropriate keyboard shortcut - alt+v (translates to ⌘+v) instead of ctrl+v
This may be obvious for some, but less so for others
The other autocutsel answer was almost the answer for me, but not quite. What works for me is:
autocutsel -f -s PRIMARYI'm running vnc4server 4.1.1+xorg4.3.0-37.3ubuntu2 on xenial and tigervnc-viewer 1.10.1+dfsg-3 on focal
- Create a shortcut of your VNC viewer
- right click it, than properties
- in the target, add
-clientcuttext=1
example: "C:\Program Files\RealVNC\VNC Viewer\vncviewer.exe" -clientcuttext=1
In windows:
cmd
C:\Program Files\RealVNC\VNC Viewer\vncviewer.exeRun this way, you can copy from both sides.
Run this way,
C:\Program Files\RealVNC\VNC Viewer\vncviewer.exe -clientcuttext=1from vnc server to windows client is available.
Even after trying autocutsel, my vnc still would not work. My issue was that on XFCE terminalemulation has and issue with copy paste for some reason with vnc. When I switched to xfce-terminal my problem stopped.
Thanks,
1On your remote machine, append the text you want to a file:
echo "here is my text" >> ~/clip.txtThen on your local machine, open a terminal window and ssh into your remote machine. Then run:
tail -f ~/clip.txtThe clipped text will show up in your terminal window whenever you append it to clip.txt remotely. There it can be copy and pasted locally, and you have an infinite copy buffer!
1