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.

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.
–
scottishwildcatAug 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 MosherAug 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.
–
scottishwildcatAug 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 MosherAug 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 MosherAug 7 '12 at 0:53

2 Answers
2

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.

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 MosherAug 26 '11 at 18:43

Added my xrandr output to the question (maybe it would help to generate a command?)
–
Ben MosherAug 26 '11 at 18:51

Maybe try to set the output resolution to something more manageable on the screen your using.
–
Split71Aug 29 '11 at 20:02

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.