I’ve been dealing with a rack-mount KVM that refuses to sync properly with any generation of Xserve on reboot. While reboots aren’t a common occurrence, I had a request to from The Powers That Be to “fix this”.
Since a regular display will sync correctly every time, I do blame the KVM. To me this is a complete non-issue: simply set the KVM to another unit, wait til the Xserve has finished booting, login via ARD and set the desired resolution. However, I still had a request to do something about it.
Read on for how I solved this…
I did know about CScreen, but that’s PPC-only and the author wishes to be left alone at this time. There’s no code for it available that I know of, and I don’t much want Rosetta running on an Intel Xserve. Thankfully, we have SetDisplay, available at macosxlabs.org.
I’ve provided an installer package that will install the (Universal Binary) binary “SetDisplay” in /usr/local/bin , add a launchd item for it in /Library/LaunchDaemons, and add a short (10 second) delay to the loginwindow (required for this to work correctly) – which means that 10.4.3 or higher is required. The supplied installer has been fully tested but is supplied as is, use at your own risk. However, it’s easy enough to pull it apart and see what’s going on if you choose to.
Download SetDisplay from http://archive.macosxlabs.org/tools_and_scripts/script_archive/scripts/miscellaneous/university_of_utah/SetDisplay.html
Be sure to read the the terms of use at the beginning of the provided code. Then take that actual code and drop it into a file, for example, SetDisplay.c and save. If you don’t have the developer tools installed, you’ll need to. I used the latest available XCode from developer.apple.com. My compile instructions will give you a Universal Binary, binary.
cd to the location of SetDisplay.c, and be sure to comment out the info at the beginning of the file.
Compile it with:
<code> CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386" \\ LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386" \\ cc -g -o SetDisplay -arch ppc -arch i386 -Wall -framework ApplicationServices \\ -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework \\ SetDisplay.c </code>
Put SetBinary in a location of your choice, for example /usr/local/bin and verify the permissions on it.
Note that if you don’t pass an argument to SetDisplay, it will default to 1024 Height x 768 , 32 BitsPerPixel, Refresh rate: 75.
If you desire a different resolution, you’ll need to customize your launchd item for it. If you go that route of course you assume all risks, be sure you choose a resolution that your kvm (or display) supports.
If you don’t have Lingon, find it here:http://lingon.sourceforge.net/
Make a launchd item for SetDisplay. I went with a UserDaemon, with program argument: /usr/local/bin/SetDisplay and rebooted. After the initial trickery of the 10.4 startup “progress” bar, the screen resolution reset to the SetDisplay default, and the login window appeared. However, for this to work right, I found you need to insert a delay in the loginwindow prefs, support for which was added in 10.4.3.
Note that if your kvm keels over immediately after you reboot your Xserve (as is the case for me), you’ll still need to switch away from the unit in question immediately after reboot. Still, all of this allows the kvm to sync (vs. not at all) when switching back to the unit.
Hope you find this helpful.
— David Haines.