Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have two monitors set up at work, with the external one set to a portrait configuration. When I attempt to VNC in to work remotely, this results in a HUGE (something like 1600x3000) because the virtual screen is the compositing of the two (with black bars where there is no monitor space).

As a result, the VNC connection is non-responsive.

I'd like to be able to login via ssh and disable the second monitor via some command-line command or script. What commands might accomplish this?

Again, I am remote, so disconnecting the screen is not an option, and mirroring results in a screen that is about 1440x1440 (so it will fit onto both monitors with no stretching), so that is also a non-optimal strategy.

Output from xrandr:

themachine% xrandr -q
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 640 x 480, current 2970 x 1680, maximum 2970 x 1702
default connected 2970x1680+0+0 0mm x 0mm
   1920x1080      60.0  
   640x480        60.0  
   800x600        60.0  
   1024x768       60.0  
   1280x1024      60.0  
   1280x720       60.0  
   1344x756       60.0  
   1600x900       60.0  
   1680x1050      60.0  
   2970x1680       1.0* 
   2970x1702       2.0  
share|improve this question
    
What VNC server, and what VNC client? If you're using native Mac screen sharing on both ends, the Screen Sharing app on the viewing side lets you choose whether to show one or both displays (via the View menu). I don't know whether other VNC clients can do this, or just ScreenSharing.app, though. –  scottishwildcat Aug 26 '11 at 16:38
    
I'm using Chicken of the VNC connecting to the default VNC server built in (set up via System Preferences -> Sharing). Where can I find the ScreenSharing.app? I haven't seen it on my machine or in any docs online, but that sounds like exactly what I need. –  Ben Mosher Aug 26 '11 at 18:38
2  
You can fire up the Screen Sharing app various ways, but easiest way for a machine whose IP or fully qualified domain name you know is to type vnc://w.x.y.z into Safari address bar, or "open vnc://w.x.y.z" into a Terminal. (You might need to add a colon followed by the port number, depending on how your server is set up--default is 5900). If you want to start it manually, you'll find it in /System/Library/CoreServices. For machines on your LAN, you can start it by selecting the machine in the Finder sidebar, then clicking Share Screen in the Finder toolbar. –  scottishwildcat Aug 26 '11 at 18:42
    
Worked like a charm! And already significantly more responsive than my previous solution. Move your comment to an answer so I can accept? –  Ben Mosher Aug 26 '11 at 22:03
    
I should note that there was a problem for a while in Lion that made Screen Sharing non-responsive w/ a secondary monitor on the left of the primary. Goofy bug. Fix showed up in a minor update release notes. –  Ben Mosher Aug 7 '12 at 0:53
add comment

2 Answers

Depending on what type of Apple machine you are connecting to, you can try these commands and see if they work for you. I know they are used with X11..This is the command to disable dual screens (Assuming it's a laptop).

xrandr --output VGA --off

And if you want to this is a command to enable the dual screens (but might aid you in troubleshooting getting the secondary one off). LVDS is the liquid display and VGA is the secondary monitor.

xrandr --output VGA --mode 1024x768
xrandr --output VGA --right-of LVDS
share|improve this answer
    
I'm using an iMac, connected monitor is Micro DVI. I tried xrandr but it seems to believe I have one huge 2970x1680 monitor, which must be the same screen that VNC is sending. –  Ben Mosher Aug 26 '11 at 18:43
    
Added my xrandr output to the question (maybe it would help to generate a command?) –  Ben Mosher Aug 26 '11 at 18:51
    
Maybe try to set the output resolution to something more manageable on the screen your using. –  Split71 Aug 29 '11 at 20:02
add comment
up vote 1 down vote accepted

From @scottishwildcat's comment:

You can fire up the Screen Sharing app various ways, but easiest way for a machine whose IP or fully qualified domain name you know is to type vnc://w.x.y.z into Safari address bar, or "open vnc://w.x.y.z" into a Terminal. (You might need to add a colon followed by the port number, depending on how your server is set up--default is 5900). If you want to start it manually, you'll find it in /System/Library/CoreServices. For machines on your LAN, you can start it by selecting the machine in the Finder sidebar, then clicking Share Screen in the Finder toolbar.

share|improve this answer
add comment

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.