How to copy/paste text from remote system?
Solution 1
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.
Solution 2
Install:
sudo apt-get install autocutsel
Run
vi /home/b37399/.vnc/xstartup
and add this line:autocutsel -fork
like this:
#!/bin/bash xrdb $HOME/.Xresources autocutsel -fork startxfce4 &
Restart
vncserver
Solution 3
I use the following line in my login-script:
vncconfig -nowin&
Hope it works for you!?
Solution 4
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.
Solution 5
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).
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=trueAdded
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.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.
Related videos on Youtube
karthick87
Updated on September 18, 2022Comments
-
karthick87 over 1 year
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.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"
-
Oli almost 13 yearsThis 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?
-
karthick87 almost 13 yearsClient runs windows XP and the server runs ubuntu 10.10. And the client runs
Real VNC
and the server runsvncviewer
. Do you need anyother information ? -
Oli almost 13 years
vncviewer
is not a VNC server (the clue's in the name :P)
-
-
karthick87 almost 13 yearsPls see my updates in the question.
-
binW almost 13 years@karthick87: you are looking at VNC server's properties. Go to VNC viewer's Properties dialog
-
karthick87 almost 13 yearsNo its not there in VNC viewer properties.Look @ the snapshot pls.
-
binW almost 13 years@karthick87: I have updated the answer. Plz try the vncconfig method. I believe it will work because it has always worked for me.
-
karthick87 almost 13 yearsDo you want me to type vncconfig in command prompt ?
-
binW almost 13 years@karthick87: run 'vncconfig' from command prompt or using Alt+F2. It will open a VNC Config dialog as shown in the image above. Check all the options and then try copy-pasting between local and remote systems.
-
binW almost 13 years@karthick87: did it help?
-
karthick87 almost 13 yearsI will try that tonight and let me update the status :)
-
karthick87 almost 13 yearsPls see the output on my question..
-
binW almost 13 years@karthick87: can you plz tell us what command line are you using to run vnc server. Also plz run "ps ax|grep Xvnc" and add its output to the question. And plz remember to add @binW in the comment when you reply to me because otherwise I dont get notified.
-
karthick87 almost 13 yearskarthick@karthick:~$ vncconfig -display :1 vncconfig: unable to open display ":1"
-
binW almost 13 years@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?
-
karthick87 almost 13 yearsPls see the updates in my question..
-
binW almost 13 years@karthick87: the output of vncserver says that "New 'X' desktop is karthick:4" so you should run "vncconfig -display:4"
-
karthick87 almost 13 yearsNow i am getting the following output, karthick@karthick:~$ vncconfig -display :5 No VNC extension on display :5
-
John Girata almost 11 yearsThis 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.
-
Alton XL over 10 yearsAt the end of the day, I ditched VNC for NoMachine NX.
-
Geek over 10 years@binW For me inside the .vnc directory there are multiple entries with display
1
. For exampleslc01ags:1.log
andslc04lyo:1.log
. So how do I specify which display1
while running the commandvncconfig -display :1
? -
m3nda over 8 yearsThank 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. -
wsw over 7 yearsThe 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? -
Mithun B over 6 yearsautocutsel worked for me, but not the "vncconfig -nowin &" or "vncconfig -display :1"
-
tryingToLearn about 6 yearsFor 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.
-
kurdtpage almost 6 yearsDo you run this before
vnc4server
or after? -
user889030 almost 6 yearsnot working on debian 8.10
-
Elia Weiss over 5 yearsI get
No VNC extension on display :1
-
Elia Weiss over 5 yearsI get 'No VNC extension on display :1'
-
Hassaan over 5 yearsthis works for me on Debian 9
-
ckujau over 5 yearsAs
vncconfig
appears to only be available with TigerVNC setups, theautocutsel
trick helped - thanks! -
Ruslans Uralovs over 5 yearsThe fix applies to both copying to and from the remote system. Tested on Mac OS High Sierra / Ubuntu 18.04
-
nerkn over 5 yearsin 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
-
Maghoumi over 2 yearsThis is the only suggestion that worked for me, thanks! I was also using
tightvncserver
, and I hadautocutsel -fork
in myxstartup
. But the clipboard was only working from remove to local machine (not the other way around). I installedvnc4server
and addedvncconfig -iconic &
right afterautocutsel -fork
. Clipboard is now working bidirectionally!