Remotely turn off display output?

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™.

Asked By: Naftuli Kay

||

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

Answered By: slm

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).

Answered By: gertas
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.