VNC Server: Disable local screen when remote VNC client connects

13,869

What you should do is create a new X session using x11vnc (you have to install that on the server). Login with ssh to the server and run:

 x11vnc -display :9

You can now connect to the server using, e.g., vncviewer:

 vncviewer server:9

make sure the numbers in both commands are the same. The normal display is :0, so that will not show anything. You could explicitly blank that screen programmatically, but if you just want to prevent others from seeing what you are doing this should be enough.

Please note that you don't have a full desktop, just an X session.

More background info can be found on this site

Share:
13,869

Related videos on Youtube

Level1Coder
Author by

Level1Coder

Updated on September 18, 2022

Comments

  • Level1Coder
    Level1Coder over 1 year

    There is a Linux desktop/server co-located at location-b.

    I am stationed at location-a and use a VNC client to connect to location-b.

    To prevent others from watching my desktop actions, how can I disable/blank the remote desktop at location-b when my VNC client connects?

    • Timo
      Timo over 10 years
      Do you want to blank the local desktop and work on it remotely, or do you want to connect to some other X session using VNC that is not displayed, and during that time blank the screen so people know you are working?
    • Level1Coder
      Level1Coder over 10 years
      When the VPN client connects, I want to blank/blackout the remote desktop and work on it remotely. Usually, the monitor is turned off, but I want to make sure it's blacked out even if someone decides to turn on the monitor.
    • Timo
      Timo over 10 years
      That doesn't really answer my question, so one more try: you can connect with VNC to an X session that does not show up even if the monitor is on do you want that and blank the screen while you do that (answer A), or do you want to connect to the running X on the monitor and blank that (answer B). Please answer A or B. (B is AFAIK not possible, A is possible)
    • Level1Coder
      Level1Coder over 10 years
      Answer A is fine.
  • Level1Coder
    Level1Coder over 10 years
    was hoping I could stay within openbox gui env, but I'll give x11vnc a try in the future.
  • jave.web
    jave.web about 2 years
    *** XOpenDisplay failed (:9) any ideas?