Results 1 to 9 of 9

Thread: Can't use clipboard between client and VNC server

  1. #1
    Join Date
    Sep 2015
    Beans
    1

    Unhappy Can't use clipboard between client and VNC server

    Hi,

    I've ubuntu 14.04 running on a Thinkpad T60, which I'm using as a server, and access remotely with x11vnc. The problem is that I can't cut and paste between x11vnc sessions and VNC clients. I have this consistently with different VNC clients on PC/ios/Linux and Mac systems and those clients have no problem cutting and pasting from other ubuntu systems). I've tried replacing x11vnc with vncserver and with tightvncserver and had the same result.

    So something must be up with the Ubuntu setup on the Thinkpad - but what?

    Any suggestions very gratefully received...

    Dan

  2. #2
    Join Date
    Jan 2008
    Beans
    15

    Re: Can't use clipboard between client and VNC server

    I have the same problem with 16.04 LTS and x11vnc 0.9.13. Clipboard allows pasting from Ubuntu into TightVNC client, but copying in TightVNC client will not paste into Ubuntu.

    Has anyone ever found a solution?

  3. #3
    Join Date
    Jan 2014
    Beans
    1

    Re: Can't use clipboard between client and VNC server

    I have ubuntu 16.04 and tested a lot of options:

    https://ubuntuforums.org/showthread.php?t=45565

    http://www.nongnu.org/autocutsel/

    but at the moment I dont get to run it properly.

    Other info:
    http://www.karlrunge.com/x11vnc/faq.html#faq-clipboard


    Misc: Clipboard, File Transfer/Sharing, Printing, Sound, Beeps, Thanks, etc.]
    Q-123: Does the Clipboard/Selection get transferred between the vncviewer and the X display?
    As of Jan/2004 x11vnc supports the "CutText" part of the RFB (aka VNC) protocol. When text is selected/copied in the X session that x11vnc is polling it will be sent to connected VNC viewers. And when CutText is received from a VNC viewer then x11vnc will set the X11 selections PRIMARY, CLIPBOARD, and CUTBUFFER0 to it. x11vnc is able to hold the PRIMARY and CLIPBOARD selections (Xvnc does not seem to do this.)
    The X11 selections can be confusing, especially to those coming from Windows or MacOSX where there is just a single 'Clipboard'. The X11 CLIPBOARD selection is a lot like that of Windows and MacOSX, e.g. highlighted text is sent to the clipboard when the user activates "Edit -> Copy" or presses "Control+C" (and pasting it via "Edit -> Paste" or "Control+V".) The X11 PRIMARY selection has been described as 'for power users' or 'an Easter Egg'. As soon as text is highlighted it is set to the PRIMARY selection and so it is immediately ready for pasting, usually via the Middle Mouse Button or "Shift+Insert". See this jwz link for more information.
    x11vnc's default behavior is to watch both CLIPBOARD and PRIMARY and whenever one of them changes, it sends the new text to connected viewers. Note that since the RFB protocol only has a single "CutText" then both selections are "merged" to some degree (and this can lead to confusing results.) One user was confused why x11vnc was "forgetting" his CLIPBOARD selection and the reason was he also changed PRIMARY some time after he copied text to the clipboard. Usually an app will set PRIMARY as soon as any text is highlighted so it easy to see how CLIPBOARD was forgotten. Use the -noprimary described below as a workaround. Similarly, by default when x11vnc receives CutText it sets both CLIPBOARD and PRIMARY to it (this is probably less confusing, but could possibly lead to some failure modes as well.)
    You may not like these defaults. Here are ways to change the behavior:

    • If you don't want the Clipboard/Selection exchanged at all use the -nosel option.
    • If you want changes in PRIMARY to be ignored use the -noprimary option.
    • If you want changes in CLIPBOARD to be ignored use the -noclipboard option.
    • If you don't want x11vnc to set PRIMARY to the "CutText" received from viewers use the -nosetprimary option.
    • If you don't want x11vnc to set CLIPBOARD to the "CutText" received from viewers use the -nosetclipboard option.

    You can also fine-tune it a bit with the -seldir dir option and also -input.You may need to watch out for desktop utilities such as KDE's "Klipper" that do odd things with the selection, clipboard, and cutbuffers.
    I cheked all of this and it doesnt work, but in this link

    https://prismsoul.wordpress.com/2014...-ubuntu-14-04/

    and in this

    http://superuser.com/questions/90197...e-and-tightvnc

    They talk about the option -xkb

    So in /lib/systemd/system/x11vnc.service

    You have to write the options you want.

    [Unit]Description=Start x11vnc at startup.
    After=multi-user.target
    [Service]
    Type=simple
    ExecStart=/usr/bin/x11vnc -xkb -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
    [Install]
    WantedBy=multi-user.target
    restart o tested with the comands

    x11vnc -R xkb

    and evuala: you can paste at x11vnc server with shift+insert

    Note: also without -xkb works
    Last edited by supercurro2; September 27th, 2016 at 09:40 PM.

  4. #4
    Join Date
    Jan 2008
    Beans
    15

    Re: Can't use clipboard between client and VNC server

    I'm restarting this thread, in the hopes that some solution has been found.

    Server is Ubuntu 16.04 LTS 32 bit.
    Remote is TightVNC View 2.7.10 under Windows.

    Problem 1: Clipboard does not work from TightVNC client to Ubuntu desktop.
    Example. Copy text on Windows machine. Paste into Windows Notepad to verify clipboard. It works. Select window in Ubuntu through TightVNC. Right-click. Paste option is grayed out.

    Problem 2: File Transfer does not work. Note: the -tightfilexfer option is included on the server, per the information in x11vnc-help.txt provided in Ubuntu. when starting X11VNCserver in Ubuntu, the prompt for "File Transfer, the TightVNC checkbox was chosen. However, In TightVNC, the "File transfer" option in the menu is grayed out.

    /usr/share/applications/x11vnc.desktop looks like this:

    Code:
    [Desktop Entry]
    Name=X11VNC Server
    Comment=Share this desktop by VNC
    Exec=x11vnc -gui -tightfilexfer tray=setpass -rfbport PROMPT -bg -o %%HOME/.x11vnc.log.%%VNCDISPLAY
    Icon=computer
    Terminal=false
    Type=Application
    StartupNotify=false
    #StartupWMClass=x11vnc_port_prompt
    Categories=Network;RemoteAccess;

  5. #5
    Join Date
    Sep 2007
    Location
    Toronto, ON
    Beans
    95
    Distro
    Ubuntu Studio Development Release

    Re: Can't use clipboard between client and VNC server

    the server needs to run vncconfig -nowin -- add this into your ~/.vnc/xstartup before starting your window manager.

  6. #6
    Join Date
    Jan 2008
    Beans
    15

    Re: Can't use clipboard between client and VNC server

    Thanks for the suggestion. My system did not have a file xstartup in .vnc.
    The directory contained another directory certs, and a file passwd.

    I created the file xstartup in the directory .vnc.
    It now has the single line:
    Code:
    vncconfig -nowin
    After restarting the system, I still do not have the ability to paste the clipboard from the host system into the TightVNC server terminal.

  7. #7
    Join Date
    Jan 2008
    Beans
    15

    Re: Can't use clipboard between client and VNC server

    After looking around further, I think my x11vnc is set up to start differently.
    I found /lib/systemd/system/x11vnc.service

    which contained:

    Code:
    [Unit]
    Description=Start x11vnc at startup.
    After=multi-user.target
    
    [Service]
    Type=simple
    ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
    
    [Install]
    WantedBy=multi-user.target

    so would the -nowin option get added to the ExecStart= line?
    Or would another ExecStart line like "ExecStart=/usr/binvncconfig -nowin" be required?

  8. #8
    Join Date
    Jan 2008
    Beans
    15

    Re: Can't use clipboard between client and VNC server

    I'm still looking for a solution to make the clipboard in TightVNC work.

    Perhaps I'm running the wrong version of tightVNC?

    x11vnc --version reports:
    x11vnc: 0.9.13 lastmod: 2011-08-10

    That seems rather old. I just did
    Code:
    sudo apt-get update
    sudo apt-get upgrade
    so apparently this is the latest version?

    I've seen another article that recommended vncconfig. However it is not presently installed. When run I get this:

    Code:
    $ vncconfig --help
    No command 'vncconfig' found, did you mean:
     Command 'vnc4config' from package 'vnc4server' (universe)
    vncconfig: command not found

    I'm using the setup for x11vnc described on this page:

    I found this article that indicates I can use autocutsel instead of the (unavailable) vncconfig.

    I verified that /usr/bin/autocutsel is present.

    I edited /lib/systemd/system/x11vnc.service

    To look like this:


    Code:
    [Unit]
    Description=Start x11vnc at startup.
    After=multi-user.target
    
    [Service]
    Type=simple
    ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
    ExecStart=/usr/bin/autocutsel -s PRIMARY -fork
    
    [Install]
    WantedBy=multi-user.target
    After restarting the system, TightVNC was not available. The viewer reported the server "actively refused the connection".

    I edited /lib/systemd/system/x11vnc.service again to remove the autocutsel line, and restarted, and TightVNC is able to connect again. But the clipboard still doesn't work, so I'm back at the start.
    Last edited by timg11; July 3rd, 2018 at 09:37 PM.

  9. #9
    Join Date
    Dec 2018
    Beans
    1

    Re: Can't use clipboard between client and VNC server

    i've the same problem , but at my case is in Windows 10 vs Debian 9 , client side : windows 10 and server side : debian 9 , the option file trasnfer is grayed out,


    but i want to make you so clearing you the case , you are using x11vnc server , not tightvncserver i have the self server , but still dont test with tightvncserver on my linux distro debian , i tried install tightvncserver but i dont see the real desktop xfce4 ,

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •