25

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

Ebrahim Byagowi
  • 947
  • 3
  • 11
  • 15

3 Answers3

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

Ebrahim Byagowi
  • 947
  • 3
  • 11
  • 15
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
nixda
  • 53
  • 5
user11952
  • 21
  • 1
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!

technified
  • 111
  • 3