27

I used to access a remote system via VNC viewer, but when I copy some text from the remote system and paste it in my text editor(local system), nothing happens. Do I need to install any additional packages to achieve this task?

Updates:
There is no such option found in the Real VNC properties.

Screenshot

I just get the following output:

karthick@karthick:~$ vncconfig         
No VNC extension on display :0.0

Updated:

karthick@karthick:~$ vncserver

Warning: karthick:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server karthick:1

Warning: karthick:2 is taken because of /tmp/.X2-lock
Remove this file if there is no X server karthick:2

New 'X' desktop is karthick:4

Starting applications specified in /home/karthick/.vnc/xstartup
Log file is /home/karthick/.vnc/karthick:4.log

karthick@karthick:~$ vncconfig -display :1 
vncconfig: unable to open display ":1"

enter image description here

Isaiah
  • 58,486
  • 28
  • 133
  • 145
karthick87
  • 80,647
  • 59
  • 193
  • 232
  • 1
    This is turning into a bit of a mess. Can you state somewhere what the setup is. What OS is the client? What OS is the server? What client and server software are you using on each? – Oli May 27 '11 at 15:25
  • Client runs windows XP and the server runs ubuntu 10.10. And the client runs `Real VNC` and the server runs `vncviewer`. Do you need anyother information ? – karthick87 May 27 '11 at 15:31
  • `vncviewer` is not a VNC server (the clue's in the name :P) – Oli May 27 '11 at 15:50
  • I have already installed `vnc4server` too. – karthick87 May 27 '11 at 16:07

17 Answers17

20

There will be a .vnc directory in your home folder. In this directory there will be few files named like <computer name>:<number>.extension
For example my laptop contains following two files in .vnc directory.

adnan-laptop:1.log
adnan-laptop:1.pid

The :1 in the above file names shows that the vnc server is running on display :1.

Now connect to your VNC server and from the connected session run vncconfig as follows:

vncconfig -display :1  

This will show a small window with clipboard related options. Check all the options and dont close the window. Now you should be able to copy paste from/to remote system.

binW
  • 12,804
  • 8
  • 49
  • 66
  • 3
    karthick@karthick:~$ vncconfig -display :1 vncconfig: unable to open display ":1" – karthick87 Jun 07 '11 at 10:59
  • @karthick87: what command are you using to run vnc server? have you checked .vnc directory in your home folder? does it contain files like karthick:1.pid? – binW Jun 07 '11 at 11:14
  • Pls see the updates in my question.. – karthick87 Jun 07 '11 at 13:46
  • @karthick87: the output of vncserver says that "New 'X' desktop is karthick:4" so you should run "vncconfig -display:4" – binW Jun 07 '11 at 14:11
  • Now i am getting the following output, karthick@karthick:~$ vncconfig -display :5 No VNC extension on display :5 – karthick87 Jun 07 '11 at 14:20
  • @binW For me inside the .vnc directory there are multiple entries with display `1`. For example `slc01ags:1.log` and `slc04lyo:1.log`. So how do I specify which display `1`while running the command `vncconfig -display :1`? – Geek Jan 14 '14 at 03:48
  • The command ```vncconfig -display :1``` works for me but why can't we close the window? Is there a way to set this once and for all? – wsw Sep 19 '16 at 03:10
  • 5
    For people reading this answer **DON'T CLOSE THE WINDOW** is the keyword. I missed that the first time and was unable to achieve the desired result. – tryingToLearn Apr 13 '18 at 06:34
  • 4
    I get `No VNC extension on display :1` – Elia Weiss Aug 05 '18 at 12:05
20
  1. Install:

    sudo apt-get install autocutsel
    
  2. Run vi /home/b37399/.vnc/xstartup and add this line:

    autocutsel -fork
    

    like this:

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

techraf
  • 3,306
  • 10
  • 26
  • 37
ashish
  • 300
  • 2
  • 5
10

I use the following line in my login-script:

vncconfig -nowin&

Hope it works for you!?

Clausi
  • 4,937
  • 2
  • 16
  • 19
9

It depends on the VNC client that you are using. If you are using RealVNC then open the VNC Viewer Properties dialog and, on the Inputs tab, turn on Share clipboard with VNC Server.

UPDATE:
Try this. Connect using vncviewer and run vncconfig within the remote window, check the options regarding the clipboard and then try.
enter image description here

binW
  • 12,804
  • 8
  • 49
  • 66
3

I use Remote login with vnc-ltsp-config with GNOME Desktop Environment on CentOS 5.9. From experimenting today, I managed to get cut and paste working for the session and the login prompt (because I'm lazy and would rather cut and paste difficult passwords).

  1. Created a file vncconfig.desktop in the /etc/xdg/autostart directory which enabled cut and paste during the session after login. The vncconfig process is run as the logged in user.

    [Desktop Entry]
    Name=No name
    Encoding=UTF-8
    Version=1.0
    Exec=vncconfig -nowin
    X-GNOME-Autostart-enabled=true

  2. Added vncconfig -nowin & to the bottom of the file /etc/gdm/Init/Desktop which enabled cut and paste in the session during login but terminates after login. The vncconfig process is run as root.

  3. Adding vncconfig -nowin & to the bottom of the file /etc/gdm/PostLogin/Desktop also enabled cut and paste during the session after login. The vncconfig process is run as root however.

Pysis
  • 107
  • 5
Alton XL
  • 131
  • 2
  • 1
    This seems to be the only solution where copy-and-paste is enabled at startup/boot/login and in the background. I'm running Red Hat Enterprise Linux 5 and could not get @Clausi's answer to work. – John Girata Jul 26 '13 at 21:19
  • At the end of the day, I ditched VNC for NoMachine NX. – Alton XL Sep 26 '13 at 18:46
2

I tried all the above suggestions with no luck.

I eventually solved it by replacing the vnc server from tightvncserver to vnc4server

On any manner, make sure that under ~/.vnc/xstartup you have the line

vncconfig -iconic &
Yuval Atzmon
  • 303
  • 2
  • 8
  • 1
    This is the **only** suggestion that worked for me, thanks! I was also using `tightvncserver`, and I had `autocutsel -fork` in my `xstartup`. But the clipboard was only working from remove to local machine (not the other way around). I installed `vnc4server` and added `vncconfig -iconic &` right after `autocutsel -fork`. Clipboard is now working bidirectionally! – Maghoumi Sep 22 '21 at 17:01
1

Try using www.letscopypaste.com or pastebin.com .
They offer simple to use clipboard capability.

Vlad K.
  • 321
  • 1
  • 3
  • 10
Alex2061
  • 11
  • 1
1

Using tightvnc (with the command: vncviewer) on Puppy Linux, I have to press F8 in the remote window to bring up the VNC menu. The VNC menu has entries for "Clipboard: local -> remote" and "Clipboard: local <- remote". I have to copy some text, use either of those entries, and then paste on the other system. I don't know if this is related to your particular problem, but it does behave like the symptoms you described if I don't use the menu.

Anonymous
  • 11
  • 1
  • Thank you. `vncconfig` did nothing this time, but I remember that adding it at the xstartup you can enable that feature. But using F8 I can enable or disable easily the direcction of the data, enabling only Remote->Local and never the opossite. – m3nda Jan 28 '16 at 10:07
  • in my linux setup, I menu pop up but either copying didnt worked :( thanks for this menu hint, I wonder how did you find, there in the help menu they didnt show – nerkn Dec 06 '18 at 10:29
1

In a new terminal window, I used the command vncconfig, the command keeps running and you can use the copy and paste functions in other windows or terminals.

Pransh Tiwari
  • 171
  • 4
  • 6
0
enter code hereThis below config works perfectly fine for Ubuntu 16.04 and Ubuntu 18.04 LTS.

Please freshly copy-paste/replace the below config to ~/.vnc/xstartup and restart your vnc.  It will definitely work.  
_____________________________________

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
autocutsel -fork  
vncconfig -iconic &
vncconfig -nowin &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &

gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
0

The only way I could fix this is to install clipIt.

Without ClipIt, I could only paste from VNC client to Console.

ClipIt took care of copying clipboard information to the GDE3 clipboard, so that I could do an insert in Terminal for example.

0

For me, I have tried all the solutions above but none worked. The real solution for me is to kill the process klipper. Not sure why but this process is the root cause of preventing me from copy and paste from windows to VNC.

ps aux|grep klipper
kill -9 <klipper_pid>
Rock
  • 101
  • 1
0

Different vncservers locate their configurations in different directories. In case you can't change your configuration despite adding autocutsel -fork in ~/.vnc/xstartup, you could also probably run find if /etc/X11/Xsession exist, if so, you can simply add autocutsel -fork and restart your vnc session. It works for me.

Negrito
  • 764
  • 1
  • 11
  • 25
0

It can be sketchy, but has successfully worked for me in a pinch. Use Microsoft PowerToys Text Extractor. I can vouch for a ~47 character token with only one obvious 0 to O error at the very end of the string.

Screenshot of tool description and hotkeys

face.
  • 1
  • 1
0

The VNC viewer you are using has to support this feature otherwise you're just copying it localy on the remote system.

LayerCake
  • 1,036
  • 9
  • 23
0

Some commentary on your problem: RealVNC's is proprietary and it's clipboard support may be entirely incompatible with tightvncserver. I've used both, together, in the past but I don't remember 100% if clipboard sharing worked bettween them. I do know for sure that RealVNC-server paired with RealVNC-viewer did accommodate clipboard sharing; but RealVNC-server is not free (as in $$s)

You might try:

muru
  • 193,181
  • 53
  • 473
  • 722
DM8
  • 630
  • 6
  • 13
0

One more cause for this is multiple instances of vncconfig instances running conflicting with each other. In my case i had custom vncserver setup, but the vncconfig started as part of the system boot conflicted with the custom vncconfig setting.

To resolve this kill unwanted vncconfig instances running.

To get the list of vncconfig instances currently running:

ps -ef | grep vncconfig

To kill :

kill -9 <process_id>

bprasanna
  • 101
  • 2