VNC: I Want See ” My Session”

Home » CentOS » VNC: I Want See ” My Session”
CentOS 4 Comments


I installed VNC server in my CentOS 7 box, when i want to connect to the VNC server, it connects but open a new session instead the session where i working,

Any suggestions?



4 thoughts on - VNC: I Want See ” My Session”

  • Milton Plasencia wrote:

    From within the session you want to connect to, you need to start x11vnc instead of VNCserver. That’s a separate package you’ll have to install (yum install x11vnc).

    Note that x11vnc’s display number will be the same as that of the X server it was started from, so you’ll most likely have to connect your VNC client to display :0 (and not :1)
    in order to access your existing X screen.


  • Hi Patrick,

    Thanks for you quickly answer.

    Yes, x11vnc was installed on my system.

    The problem is i not understand the “logic” of VNC connection, so i try to dark…

    I copy the /etc/systemd/system/vncserver@:1.service to /etc/systemd/system/vncserver@:0.service

    restart the VNC service and obtain

    Jul 18 11:17:16 systemd[1]: VNCserver@:0.service: control process exited, code=exited status=98
    Jul 18 11:17:16 systemd[1]: Failed to start Remote desktop service (VNC). Jul 18 11:17:16 systemd[1]: Unit VNCserver@:0.service entered failed state.

    Thanks again,


  • (Please don’t top-post.)

    Milton Plasencia wrote:

    As I said in my previous post, for what you are wanting to do, vncserver is not the right tool. Use x11vnc instead (and also remove the above copy).

    This error is caused by display :0 alreading being in use by the X server. Again, in your case you don’t want to run vncserver anyway.

    If both your VNC server and client are on the same local network, the following two commands should be all you need to get started:

    1. On the server, from within the X session you want to share:

    x11vnc -forever -shared

    2. Then, on the client:

    VNCviewer your-vnc-server:0

    You should also take a look at That site provides a ton of useful information on how to run x11vnc in all different kinds of situations.