Page 1 of 1

Solution: Allow Copy and Paste between VNC Server and Client

Posted: Mon May 20, 2019 9:18 am
by zatz
Just posting this here in case it helps someone else ...

I've just started using Raspbian Stretch and found that when using VNC I couldn't copy and paste between the server (i.e. the Raspberry Pi) and my PC. Previously, when using Jessie, copy and paste just worked. I've been able to fix this as follows:

  1. In /etc/vnc/config.d create config.custom with the following:

    Code: Select all

    # Custom settings for VNC
    
    AcceptCutText=1
  2. Reload the options using vncserver-x11 -reload

    Note that I got the following error in response

    Code: Select all

    Contacting VNC Server failed: connect: No such file or directory (2)
    but this appears not to have caused any problems.
For some reason, once I had done this on one Pi, copy and paste worked on my other Pi running Stretch as well.

Sources:
VNC Server parameter reference
- https://www.realvnc.com/en/connect/docs ... r-ref.html
Configuring VNC Connect using parameters
- https://www.realvnc.com/en/connect/docs ... e-vnc.html

Re: Solution: Allow Copy and Paste between VNC Server and Client

Posted: Mon May 20, 2019 11:42 am
by sconemad
zatz wrote:
Mon May 20, 2019 9:18 am
In /etc/vnc/config.d create config.custom with the following:
I think this should be common.custom, which is used to contain common settings between VNC apps.

It's curious that this fixed it for you, since the AcceptCutText parameter should be enabled by default. I'm guessing you have it disabled elsewhere. BTW, this parameter corresponds to the "Copy and paste text in either direction" check box on the Users & permissions page on the VNC Server options dialog. This is the global setting, but you can also allow/deny it on a per-user basis, if you need to.

Re: Solution: Allow Copy and Paste between VNC Server and Client

Posted: Mon May 20, 2019 12:22 pm
by klricks
zatz wrote:
Mon May 20, 2019 9:18 am
....Raspbian Stretch and found that when using VNC I couldn't copy and paste between the server (i.e. the Raspberry Pi) and my PC. ....
I have no problem with C&P...... either direction works by default.
Note that the RealVNC connection must be made before you attempt to C&P.