skint
Posts: 3
Joined: Wed Nov 21, 2012 8:17 pm
Location: Shropshire, UK.

Remote (VNC) cut and paste not working.

Thu Nov 22, 2012 2:56 pm

Hello. Very much enjoying Raspbian. Thanks for all the work.

I've set up tightVNC and it's working well, except cut and paste isn't working in either direction.

I found I could get it working in one direction (cut/copy showed up in the local Klipper) by running 'autocutsel -s PRIMARY -fork' on the RasPi. Even tried running the same thing on the local PC, which is running Kubuntu 12.04

I use KRDC on Kubuntu, but I get the same problem with other clients.

User avatar
justinsb
Posts: 32
Joined: Sun Feb 12, 2012 9:33 am
Location: Deepest, darkest Yorkshire...

Re: Remote (VNC) cut and paste not working.

Sat Nov 24, 2012 4:19 am

I've got it working on mine, so I know it's possible. It is a server side thing, so it "shouldn't" matter what client you use, or which OS you run that client on.

These were the pages that I found most of my info on:
https://bbs.archlinux.org/viewtopic.php?id=101243
https://wiki.archlinux.org/index.php/Ti ... Clipboards
https://wiki.archlinux.org/index.php/Ti ... ger_issues

I log in using SSH, & ran the following to install everything. The fonts stop various log error messages which annoy me.

Code: Select all

sudo apt-get install tightvncserver gsfonts-x11 xfonts-75dpi xfonts-100dpi autocutsel
Then you have to pick which account you are going to run TightVNC from (not root, but try "pi" unless you have created a new account yourself). Open /home/pi/.vnc/xstartup & change it to

Code: Select all

#!/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
Hope this helps. You then start your VNC server in the normal way. If you want me to I can post up my startup init script which kicks it all off on boot.

skint
Posts: 3
Joined: Wed Nov 21, 2012 8:17 pm
Location: Shropshire, UK.

Re: Remote (VNC) cut and paste not working.

Sun Nov 25, 2012 2:22 pm

Many thanks for that. Now working a treat.

n9mfk
Posts: 26
Joined: Fri Nov 09, 2012 10:39 pm

Re: Remote (VNC) cut and paste not working.

Wed Dec 05, 2012 11:34 pm

HI justinsb,
cold you please post your start-up script an how to do it
thanks Beau

thanyator
Posts: 2
Joined: Thu Feb 28, 2013 6:45 am

Re: Remote (VNC) cut and paste not working.

Mon Mar 11, 2013 2:24 pm

justinsb wrote:I've got it working on mine, so I know it's possible. It is a server side thing, so it "shouldn't" matter what client you use, or which OS you run that client on.

These were the pages that I found most of my info on:
https://bbs.archlinux.org/viewtopic.php?id=101243
https://wiki.archlinux.org/index.php/Ti ... Clipboards
https://wiki.archlinux.org/index.php/Ti ... ger_issues

I log in using SSH, & ran the following to install everything. The fonts stop various log error messages which annoy me.

Code: Select all

sudo apt-get install tightvncserver gsfonts-x11 xfonts-75dpi xfonts-100dpi autocutsel
Then you have to pick which account you are going to run TightVNC from (not root, but try "pi" unless you have created a new account yourself). Open /home/pi/.vnc/xstartup & change it to

Code: Select all

#!/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
Hope this helps. You then start your VNC server in the normal way. If you want me to I can post up my startup init script which kicks it all off on boot.

**** If your VNC has access as root (not 'pi' user), then edit file 'xstartup' in path '/root/.vnc' with the same code of above (insert the line 'autocutsel -fork').
After that, reboot the system by command 'reboot'. Try to connect again. Good luck ;)

sergiosch
Posts: 9
Joined: Wed Apr 23, 2014 3:26 pm

Re: Remote (VNC) cut and paste not working.

Wed May 28, 2014 5:07 pm

Thanks for the info, I also didn't have the copy/paste working to my pi tightvnc server

Solved it by installing the autocutsel package and adding the "autocutsel -fork" line. Reboot and working !

Bosse_B
Posts: 1408
Joined: Thu Jan 30, 2014 9:53 am

Re: Remote (VNC) cut and paste not working.

Mon Oct 19, 2015 9:22 pm

I can confirm that it is working also on tightvncserver running on Raspbian Jessie! :D
Makes life so much easier going back and forth between the pi and the PC!
And I did not have to reboot either, just did this:
- installed autocutsel
- Added line "autocutsel -fork" to /home/pi/.vnc/xstartup
- Stopped the vncserver service
- Started the vncserver service
- Connected VNC to he pi
Now cut-and-paste works!
Bo Berglund
Sweden

Bosse_B
Posts: 1408
Joined: Thu Jan 30, 2014 9:53 am

Re: Remote (VNC) cut and paste not working.

Tue Oct 20, 2015 6:31 am

I talked too soon!
I disconnected the VNC overnight and then connected again and now the copy-paste only works in one direction, from PC to RPi2!

After looking further for a solution I ran across this webpage.
In this the xstartup is edited slightly differently so I tried that as follows:

Code: Select all

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey -cursor_name left_ptr
autocutsel -s CLIPBOARD -fork
autocutsel -s PRIMARY -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
But it still only works in one direction, the one I need least of course...
Is there anyone here who can advice what to do in Jessie to get the clipboard work both ways with tightvncserver?
Yesterday I only had this line for autocutsel:

Code: Select all

autocutsel -fork
Bo Berglund
Sweden

Bosse_B
Posts: 1408
Joined: Thu Jan 30, 2014 9:53 am

Re: Remote (VNC) cut and paste not working.

Sat Oct 24, 2015 9:36 am

Seemingly I have stumbled across the root cause of this problem of clipboard bidirectionality...

In the Lazarus programming environment for Free Pascal there is a code editor and whatever one selects and copies in this does not make it across to the Windows clipboard!

But strangely it is in the Raspbian clipboard so it can be pasted for example into the Raspbian Text Editor.
And the amazing thing is that once the text copied from Lazarus has been pasted into the Raspbian Text Editor it immediately becomes available also in Windows!!
So pasting Lazarus copied text elsewhere in Raspbian seems to activate the transfer into the Windows clipboard too.

Is this a known issue?
Can it be solved?
Bo Berglund
Sweden

bwims0
Posts: 34
Joined: Fri Dec 07, 2012 11:51 am

Re: Remote (VNC) cut and paste not working.

Thu Dec 03, 2015 6:53 pm

Bump.

Is stumbling around trying to find the answers to undocumented weirdness one of the objectives for school children using Pi s?

The problem with free software, I suppose.

Return to “Raspberry Pi OS”