Cutting and Pasting Text from Raspberry Pi using TightVNC

I run VNC on all of my machines to allow remote access from my ‘primary’ computer. Most of the time when I’m developing software, it is on a remote system in my basement. This tends to work well for me. Until recently anyway.

I’m working on software for a Raspberry Pi. Normally I use putty to access my RPI’s or I cross-compile using a 386 Linux for the main system. But for this particular project, I am doing the actual development on the RPI.

It has been very clumsy because I have not been able to transfer the clipboard between my primary system and the RPI. So, normally, I might find some snippet of code online that I want. I would copy that, bring up the VNC window, and paste into an editor in the remote system.

While that works on my Windows and Linux Mint systems just fine, it has been failing on my Raspberry Pi. I’ve noticed this issue since my first RPI, but it hasn’t been that big of a problem until this project. So I really want it FIXED!

My primary reference for fixing this problem was:

You will need to install a utility called autocutsel:

sudo apt-get update
sudo apt-get install autocutsel

Then, you must be logged in to the user that will be running tightvnc. The best way to do this is just remote connect via VNC to the RPI as you would normally.

Now go to the login user’s .vnc directory:

cd ~/.vnc

and edit the xstartup file to add the line “autocutsel -fork”:


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

Reboot and you should now be able to cut and paste into and out of the RPI VNC window!

This entry was posted in c-rpi and tagged . Bookmark the permalink.

1 Response to Cutting and Pasting Text from Raspberry Pi using TightVNC

  1. Rik Wouters says:

    Thank you sir, that works.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.