Imaging both halves of a Dual Boot Mac

So I’ve finally got imaging a dual boot Mac dialed in to my satisfaction.

The nicest thing is that I don’t really use BootCamp at all – just steal the drivers off the disk.

First I netboot the Mac and repartition the drive into two logical drives before installing the standard Mac OS image. Next step is to insert my special CD (an Altiris PXE CD with some files added) and run a shell script which installs rEFIt and then tells it to make Windows the default boot OS (it makes life easier in the next bit) by writing the line “legacyfirst” to the end of its conf file.

Now we restart the Mac and rEFIt asks us where to boot from, we select the CD and Altiris PXE boot takes over. When that finishes and we get a DOS prompt I run RDeploy which loads the standard Windows image. Since we don’t have the proper drivers loaded we now have to reboot PXE to be able to write to C:. As it is rebooting we use the Partition Tool on the rEFIt menu to sync the GUID partition table and the MBR partition table. Now run a batch file that loads a share on our Altiris server and copy a new boot.ini and the Mac drivers into a spot on C: where sysprep will see them and install them. Now a couple of reboots for sysprep to do it’s work.

Back to Mac OS where we run another batch file. This one gets real tricky. First we disable rEFIt by moving the folder at /efi to /.efi (which also hides it from students), unzip a bunch of files into /var/tmp (as a Windows CD doesn’t keep things such as installer packages nice), install BootPicker, replace the logout script with one that runs BootPicker, shove a new BootPicker preference file into place (this one includes some text for the picker dialog) and finally replace the BootPicker /etc/rc.local with one I’ve hacked slightly.

That final rc.local was a real beaut. I discovered that Windows wants to write local time to the hardware clock while all other right thinking operating systems write GMT and then use the adjust for the display time. This means that when the Mac first boots after running Windows it sees a clock that is hours out and the network time daemon refuses to adjust the time as the skew is too large. Of course this means that when login.window tries to connect to Active Directory Kerberos barfs due to the time difference and I don’t get logons for network users.

This looks like a serious problem. Go to Terminal and type “apropos time” which shows me all the commands that deal with time. See ntpd and discover it’s running but with a fairly high process ID. Check its manual page and discover you can run it so that it will ignore the skew when setting the time and then quit. Type “ntpd -g -q” and after a couple of seconds the command prompt returns and the time in the top right corner is correct. OK, so I need to run that line before login.Window runs. Hmmmm, the obvious spot is either before or after BootPicker, let’s run it before so we don’t delay the arrival of the login window after they pick Mac OS. So since when we boot BootPicker is run in /etc/rc.local add our line between the “ipconfig waitall” and “bp=”. Now test. Problem fixed. Gotta love Unix.

Don’t you just love the fact that under the hood Mac OS is a real Unix operating system and no longer a toy. Weep you Windows guys, weep.

The real joy of all this is that all the files that ever need to change are on servers and so the CD can be used for years. Oh, and my dual-boot Mac is using standard student lab images on both halves – no need to create a special image.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s