6

I'm using x11vnc and SSH to tunnel VNC remotely to my local machine.

One of the interesting side-effects of this is that as I use my work computer from home, my coworkers will see me moving around my mouse, typing, etc. and can stand at my computer in the office and spectate everything.

Is there a way for me to disable display output remotely but still be able to VNC into my actual desktop as I left it? Preferably, stopping keyboard and mouse input for the duration of the session would be a good idea™.

2 Answers 2

7

You should be able to use xrandr to turn off a given display.

$ xrandr --output CRT1 --off

To re-enable it:

$ xrandr --output CRT1 --auto

You can see the names of your output displays using xrandr -q:

$ xrandr -q
Screen 0: minimum 320 x 200, current 1440 x 900, maximum 8192 x 8192
LVDS1 connected primary 1440x900+0+0 (normal left inverted right x axis y axis) 303mm x 190mm
   1440x900       60.0*+   50.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)

References

7
  • This is pretty awesome, but unfortunately the side-effect of doing this is this: imgur.com/HDKc4Ym ; my VNC desktop size automatically becomes what looks like 640x480 :-| Commented Jul 8, 2014 at 19:32
  • @NaftuliTzviKay - when connected does it switch the desktop size on the fly, or for connections after the above command has been run?
    – slm
    Commented Jul 8, 2014 at 20:39
  • Connections afterward. In one SSH command, I disabled the monitor, then I reconnected with port forwarding and x11vnc. Commented Jul 8, 2014 at 21:06
  • @NaftuliTzviKay - pre-existing connections maintain the resolution though, right? I'm only clarifying so I can try and replicate the scenario 8-). Also what method are you doing the tunneling? Is it using the via method that I detailed before? I think it was for one of your other Q's if I'm not mistaken?
    – slm
    Commented Jul 8, 2014 at 21:07
  • Yes, see my new answer to that question here. Perhaps I need to write a script which will turn off the display, then immediately start x11vnc, and then trap the exit signal to turn back on the display... Commented Jul 8, 2014 at 21:13
4

xrandr removes display from active thus it also makes problem with view-port resolution. The better way is to force screen power save mode with vbetool. The following command blackens screen by sending power save command to graphic card:

vbetool dpms off

To get back from power save run:

vbetool dpms on

Mind the fact that your input devices like keyboard or mouse are still active and somebody may interact with your remote machine. To disable these device please see Disable Keyboard & Mouse input on unix (under X).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .