18

I am connecting to a remote OpenSuse computer using VNC from Windows. On other Linuces that I've used over VNC, I can copy text between the remote machine and the local Windows machine using the clipboard. In this case, I can seem to connect the local clipboard to the remote.

The VNC server is whatever is set by default on OpenSuse. I don't know which it is.

How can I fix copy/paste over VNC?

7 Answers 7

9

Yes, I just went thru this again on CentOS 5.2 (setting up old dev environment). Add this to $HOME/.vnc/xstartup worked for KDE and GNOME and ICEWM to enable copy/paste between VNC Client on Windows and the Windows host:

vncconfig  -nowin &
export XKL_XMODMAP_DISABLE=1
autocutsel -fork
0
7

Copy/paste to work add these:

  1. sudo apt-get install autocutsel

  2. add autocutsel -fork line to xstartup file with:

    vi /home/<username>/.vnc/xstartup
    

    like this:

     #!/bin/bash  
     xrdb $HOME/.Xresources  
     autocutsel -fork  
     startxfce4 &
    
  3. restart vncserver

3
  • Could you please expand about the need for xrdb $HOME/.Xresources in this case? Jun 13, 2016 at 20:49
  • xrdb $HOME/.Xresources it worked for me, i found it in some google pages, and i consolidated it here
    – ashish
    Jun 17, 2016 at 16:10
  • 1
    This is correct and the proper way to do copy/paste between machines through VNC. Aug 16, 2017 at 15:55
6

I resolved this by installing the autocutsel RPM from the software management section of Yast, and then running:

$ autocutsel -s PRIMARY -fork

This enabled copy/paste between my VNC and my Windows clipboard.

Thanks to this source.

3

On Linux, vncserver executable itself does not provide clipboard support. You should run vncconfig, then you have clipboard support.

How you should run vncconfig depends on the way you use vnc server. If you are starting the server from desktop you can run the executable while starting the server. If you are starting the server at boot time, you can start the vncconfig in headless mode too. I believe it is possible to run vncconfig in headless mode with -nowin flag.

You can refer to man page of vncconfig for more info.

3
  • I don't seem to have any vncconfig installed. What should I make of that? Mar 27, 2012 at 7:30
  • 1
    I'm not an OpenSUSE user but after a Google search It came out they use tightvnc and vncconfig is missing in the OpenSUSE package. Without vncconfig it is not possible to use clipboard integration through vnc clients. You can try to install Real VNC Server or any other vnc server clone that supports clipboard integration through vncconfig or by any other mean. Mar 28, 2012 at 13:11
  • This method also works if the vnc module (Tiger VNC) is loaded into a normal Xorg server (i.e. to support remote and local access to a real display). Sep 2, 2020 at 11:32
0

For over a year I have been using tightVNC from a Windows client to a RHEL server. Copy-and-paste worked well until a few weeks ago. Then it stopped. I found that the vnc service was "defunct" (not sure what that meant, but it did not sound good).

ps -u myUserid | grep vnc
 3414 ?        00:00:01 Xvnc
 3450 ?        00:00:00 vncconfig
 6227 pts/0    20:15:56 Xvnc
 6235 pts/0    00:00:12 vncconfig <defunct>

So I restarted it in the background, from a terminal in my Windows session:

vncconfig &

Now everything is back to normal. In fact the above command/response lines were copied from Linux and pasted into my Windows browser session. No need for autocutsel.

0

Simply go to your VM machine. Open your terminal and write:

vncconfig -display :1

NOTE: Please give the spaces as given above in the command.

A pop-up will appear. Don't close it. Now, copy-paste will work from VM to Windows and vice-versa.

0

On the right corner of the Linux, the scissor is located. right-click and close the default clipboard manager and then start with Tigervnc clipboard manager as :

$ vncconfig &

It will start the TigerVNC clipboard. So you can share the clipboard with the local and remote machine.

I have tested and worked this on Oracle Linux.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .