I just got a KVM switch box and when plugging my monitor on that box, MacOSX doesn't recognize all possible resolutions, esp. not the native resolution which is very annoying.

Is there any way I can fix this?

Is there any way I can force MacOSX to let me specify any possible resolution?


I'm not sure if it still works, but you might give the cscreen command-line tool a try. It's been abandoned by its original author, but it still available from the macosxhints forum (posting #6 here).


Take a look at SwitchResX.

SwitchResX is a tool designed to manage resolutions of all your monitors. Here's a quick summary:

As standard features: it gives you access to most of your monitor settings within its customizable menus (in the Menu Bar or with a Contextual Menu Plugin [also on Snow Leopard] on the Finder Desktop). SwitchResX incorporates features relative to the Monitor Resolution, Color Depth, Video Mirroring, Display Rotation, Display Overscan into one single utility. Other useful features include saving desktop layout, ie positions of the icons on the desktop and positions of the windows of all open applications, and restore them automatically when the resolution is changed or when you plug or unplug an external monitor. You can disable or deactivate a monitor without having to physically unplug it, allowing you to use a laptop in clamshell mode with external monitor, keyboard and mouse Specialized features allow you to link your monitor settings with system events: Key shortcut pressed, Apple Scripts, Application launched.

Advanced features lets you create and enable new resolutions for your monitor, HDTV, Plasma or LCD screen or Video Projector. This advanced feature is very powerful for users requesting complete control over their display resolution.

  • It's not free. I wont pay any money for such trivial basic function. – Albert Jul 31 '12 at 23:36

Thanks Gordon for the link to the Macworld forum. There is this code which might be able to do what I want:

* main.c
* newscreen
* Created by Jeffrey Osterman on 10/30/07.
* Copyright 2007 Jeffrey Osterman. All rights reserved. 

#include <ApplicationServices/ApplicationServices.h>

void MyDisplaySwitchToMode (CGDirectDisplayID display, CFDictionaryRef mode);

int main (int argc, const char * argv[]) {

int h; //horizontal resolution
int v; //vertical resolution
CFDictionaryRef switchMode; //mode to swich to
CGDirectDisplayID mainDisplay; //ID of main display

if (argc != 5)
printf("Expected 4 inputs, but only received %i\n", argc-1);
return 0;

if (!strcmp(argv[1],"-h"))
h=strtol(argv[2], NULL, 0);
else if (!strcmp(argv[1],"-v"))
v=strtol(argv[2], NULL, 0);
else {
printf("Error! Expected first argument to be -h or -v\n");
return 0;

if (!strcmp(argv[3],"-h"))
h=strtol(argv[4], NULL, 0);
else if (!strcmp(argv[3],"-v"))
v=strtol(argv[4], NULL, 0);
else {
printf("Error! Expected third argument to be -h or -v");
return 0;

mainDisplay = CGMainDisplayID();
switchMode = CGDisplayBestModeForParameters(mainDisplay, 32, h, v, NULL);
MyDisplaySwitchToMode (mainDisplay, switchMode);
return 0;


void MyDisplaySwitchToMode (CGDirectDisplayID display, CFDictionaryRef mode)
CGDisplayConfigRef config; // 1
CGBeginDisplayConfiguration (&config); // 2
CGConfigureDisplayMode (config, display, mode); // 3

CGCompleteDisplayConfiguration (config, kCGConfigureForSession ); // 5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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