My TightVNC Server on Raspberry Pi seems can not handle copy/paste between its and my local clipboards. What can I do?
3 Answers
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
-
-
1@sweetlilmre, no, reboot not required if you manually run
autocutsel -fork
– SAMProJul 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.– pedzDec 6, 2017 at 22:16
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
-
1
-
Didn't need to be first on my Pi 3. The solution from @Ebrahim above worked (after I remembered to install autocutsel) Mar 18, 2016 at 1:27
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.
- Logged into the pi,
- ls /home/pi/.vnc
- 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!