I am accessing a remote machine by VNC Viewer. Sometimes I find I can't copy and paste text from VNC Viewer.
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
sudo apt-get install autocutsel
add the following line to
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/Xsession
To apply the changes, restart VNC server:
vncserver -kill :1 vncserver :1 -localhost -geometry 1400x1050
Adjust 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 :)
The other autocutsel answer was almost the answer for me, but not quite. What works for me is:
autocutsel -f -s PRIMARY
I'm running vnc4server 4.1.1+xorg4.3.0-37.3ubuntu2 on xenial and tigervnc-viewer 1.10.1+dfsg-3 on focal