25

My TightVNC Server on Raspberry Pi seems can not handle copy/paste between its and my local clipboards. What can I do?

3 Answers 3

36

First install autocutsel (sudo apt-get install autocutsel)

Then open your /home/pi/.vnc/xstartup (nano /home/pi/.vnc/xstartup) and put autocutsel -fork on it like this:

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
autocutsel -fork
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession

Then it will work after restart of the vnc server

To Stop VNC Server:

vncserver –kill :1 (pick your display)

To Start VNC Server:

vncserver :1 –geometry 1024x600 –depth 24

Source

3
  • Perfect solution, thank you very much (reboot was required) Nov 26, 2013 at 12:16
  • 1
    @sweetlilmre, no, reboot not required if you manually run autocutsel -fork
    – SAMPro
    Jul 18, 2016 at 11:53
  • I have an Odroid running Ubuntu Mate 16.04. I had an odd issue that this fixed. I could cut and paste from emacs to an xterm within the same VNC server. And I could cut and paste from an xterm to another app running on the host (which happens to be a Mac). But I could not cut and paste from emacs to an app on the Mac. Running autocutsel -fork fixed my issue.
    – pedz
    Dec 6, 2017 at 22:16
2

I had to make sure my autocutsel comes FIRST in the xstartup for copy/past to work

# Makes copy/past work - must come before RANDR 'fix'
#vncconfig -iconic &
autocutsel -s CLIPBOARD -fork
autocutsel -s PRIMARY -fork

# Get's rid of RANDR missing errors
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
2
0

Though this is an old post, I ran into an issue where I could no longer copy and paste from host to client with one of my rpi's (I have 5).

I tried everything suggested here and everywhere else I searched but nothing worked. In the end what worked is this.

  1. Logged into the pi,
  2. ls /home/pi/.vnc
  3. I see 2 files with the dns name of my pi mypi:1.log and mypi:1.pid I had a thought that there must be a mypi:0 and maybe this was causing the copy/paste to no longer work. I don't know all the ins and outs but by connecting to mypi:1 as the host name with my VNC client I can now copy and paste between host and client again!

I hope that this helps someone else and if anyone has any info to share about this please do!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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