Posts RSS Comments RSS 48 Posts and 155 Comments till now

Setting up a Mac for dual booting to Windows using Boot Camp and three partitions

I got a lab full of new Intel Macs that I wanted to dual boot using Boot Camp. Boot Camp works really well if you only want to split your drive into two partitions. But if you want three partitions you have to do some hoop jumping. I need three partitions so I can have a dual boot machine as well as a scratch disk that both OSes can read and write from. The instructions below describe how I got my machines to work with Boot Camp and use three partitions.

This page assumes you have an external hard drive that you can boot from as well as run NetRestore. NetBooting works fine for this as well.

The problem with making three partitions on your drive is because of two issues.

First, Boot Camp will only run if one of two conditions exists:

1. The drive has never been partitioned
2. The drive has been partitioned once and the second partition is FAT32

This is because Boot Camp only works if it can put Windows on the last partition. So, the obvious answer is just install Windows on the last partition, right? Sorry, Windows has a problem with that. Windows by default sets the active boot partition to the FIRST partition is sees. So, we have to work around both this issue to get it to work.

Step 1 – Install OS X

If you want to configure an install and then image it off for use on other machines or you want to have a backup image of your drive then follow this step. If you plan on putting a clean install of OS X on the drive after you partition it then skip to Step 2.

1. Install and configure OS X on the unpartitioned drive.

2. Install Boot Camp.

Download Boot Camp from Apple and install it on your machine. This will put Boot Camp Assistant in your Utilities folder. Run Boot Camp Assistant and let it burn the drivers CD but DON’T let it partition the drive. We’re going to do that ourselves shortly.

But what if I’ve already partitioned my drive?

You can still install Boot Camp but you can’t run the Assistant to burn the drivers CD. You can do this without Boot Camp Assistant though.

Right click on Boot Camp Assistant and choose “Show Package Contents”. Drill down through the Contents and Resources folder. You’ll see a disk image file called “DiskImage.dmg”. This is the image file for the drivers CD. Copy that out of Boot Camp Assistant and use Disk Utility or Toast to burn a drivers CD from it.

3. Image off the OS install using NetRestore Helper or Disk Utility

You only need to do this if you’re going to put this image on several machines or you want a backup.

Step 2 – Partitioning

Reboot the machine from another drive or your Install disc. Use Disk Utility to partition the drive into three sections.

IMPORTANT: You need to partition it in the following manner

Partition 1 – HFS+(Journaled)
Partition 2 – MS-DOS – It should be no larger then 32 GB as FAT32 has issues beyond that size.
Partition 3 – MS-DOS – this is the section you’ll use for the Windows install

I find it makes things easier later if I name these partitions now. Something like “Mac”, “Scratch” and “Windows”.

As I said earlier Boot Camp will only work if Windows is on the last partition.

Next, reboot from a CD that includes FDisk. I use the basic CD created from the Ultimate boot CD website. You need to complete this step before installation of Windows because Boot Camp MUST see Windows on the last partition but Windows will always default to making the FIRST partition the active one.

Once you boot from the CD select Filesystem Tools>Partition Tools> Free Fdisk.

Select “Ok” on all of the windows while it loads. Choose all the defaults until you get to the FDisk menu.

Choose selection 4 “Set Active Partition”. When it opens you’ll see that the User Temp parition is set to C: and the Windows partition to D:. Select the Windows partition (most likely partition 4) as the active partition. Escape out of FDisk and reboot the machine. You only have to do this when you partition. You’ll only have to use FDisk again if you wipe the drive and re-partition it.

Step 3 – Put your OS X installation back on

Boot the machine from the drive you imaged your machine to and use NetRestore to put the OS X image on the first (HFS+) partition. You also do this after you put Windows on the other partition. Order doesn’t matter here.

Step 4 – Install Windows

Put your Windows install disc in and hold down the “C” key to boot from it. Run the standard Windows installer. If you did Step 2 correctly you see the last partition showing up as the “C:” drive. You can go ahead and let it format it as NTFS.

After you finish the basic Windows install put the Mac drivers CD in that we created in Step 1. Run the installer and let it put in all the Mac drivers. This will let Windows work with your Mac keyboard, mouse and even your iSight camera! It also installs “Startup Disk” in your Windows control panel so you can boot back and forth between the OSes.

After installing Windows use NetRestore Helper to image it off. Mike Bombich has a lot of good information on his site about deploying dual boot systems using NetRestore. You should read through it before you image your Windows install. The one issue I will point out is that you need to have the program “ntfsprogs” installed on the drive you’re using to image. This program lets NetRestore work with NTFS volumes. Mike supplies you with a link to download this program as well.

Also, when you create a NetInstall boot image for Netbooting you must either install “ntfsprogs” on the image after you create it or create it off of an installation that already has “ntfsprogs” installed. NetRestore will automatically include it in the NetInstall image if it sees it on the boot drive. Again, go to Mike’s site and read the information before you start to image.

If all went correctly you should now have a machine with three partitions and can be successfully booted between OS X and Windows.

Post-install issues

Updating the Windows install

I have 12 machines in my lab that all dual boot. 6 stay booted in OS X and 6 in Windows. However, I need for all of my Windows machines to run Windows Update every night as well as update their anti-virus software. So I came up with this solution that so far seems to be working well.

Set up a cron job on the Mac side that runs just before 3 AM (the default time for Windows Update to run). I use this script. Remember it must run as root:

#!/bin/bash
/usr/sbin/bless -mount /Volumes/WINDOWS -legacy -setBoot -nextonly
/sbin/shutdown -r +1

This script will reboot the machine into Windows but only for that boot cycle. The next time the machine reboots it will default back to OS X. I named the drive that holds my Windows installation “WINDOWS” (duh).

If you want to put a warning up before this happens I recommend iHook. I use it to display a large graphic that tells the user that the machine is going to reboot in 1 minute so they better save their stuff. I don’t expect any users at 3 in the morning but always nice to have a warning just in case.

On the Windows side I set up “Windows Update” to run at 3 AM and Symantec AntiVirus to update at 3:05 AM. Then I use “Scheduled Tasks” to have the Windows side reboot us back into OS X. Make a new task and enter the following:

In the “Run” box:
C:\WINDOWS\system32\shutdown.exe –r –t 120 –d p –c “Your warning text here”

This will restart Windows but give a 2 minute warning before it happens and display your warning text.

In the “Start in” box:

C:\WINDOWS\system32

Run it as an administrator. The syntax in the box would be “Computer name\admin name”

Now, after all of the updates run the machine will reboot itself back in OS X. I still haven’t worked on a way to do this starting from Windows but when I do I’ll post it here as well. I’m more worried about my Windows machines getting updated frequently then my Macs anyway.

Snow Leopard Boot Camp update
Apple has added the ability to boot BACK to OS X from Windows in Boot Camp 3.0, available with Snow Leopard.
Check out the information on the Apple KB article:
http://support.apple.com/kb/HT3802

No NumLock key on a Macintosh keyboard

One of the first things my users noticed once I deployed the dual boot machines with Macintosh keyboards is that they don’t have a NumLock key and Windows defaults to NumLock being off.

Fortunately Microsoft has a nice little VBScript that you can use to fix this issue. Put the script below into the Startup folder for “All Users” to turn NumLock on when they log in.

Paste this into a WordPad document and save it with a “.vbs” extension.

set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{NUMLOCK}"