Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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

share|improve this answer
    
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 :-| –  Naftuli Tzvi Kay Jul 8 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 Jul 8 at 20:39
    
Connections afterward. In one SSH command, I disabled the monitor, then I reconnected with port forwarding and x11vnc. –  Naftuli Tzvi Kay Jul 8 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 Jul 8 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... –  Naftuli Tzvi Kay Jul 8 at 21:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.