CM 2012: Image a BootCamp Partition using a Task Sequence

Imaging a BootCamp partition was one of the most difficult things to figure out when I started my CM 2012 implementation. There was no documentation or instructions to found on the Internet, so I had to make it up as I went. Now there is limited documentation and blog posts that detail very involved methods of making this work. This method is different, and I think easier. Read on for the details.

BootCamp Assistant and Support Software

Macs come with the built-in BootCamp Assistant application. This application is great if you are installing a base copy of Windows from a DVD. The primary issue with using the BootCamp Assistant is that it does not see your CM 2012 boot media as a Windows DVD. This means that BootCamp Assistant cannot be used to BootCamp your Mac.

You can, however, use the BootCamp Assistant to download the support software, or download it from Apple here: http://support.apple.com/kb/DL1638 (this link is current as of July 2013). This support software is what you install after Windows is installed and includes all of the drivers and support programs. This software normally does not change until a new release of BootCamp Assistant or a new release of Apple hardware, which means that you can download it and save it to a network share for installation on multiple computers.

As of this writing, there is no way to automate the install of the support software. It comes as a MSI, but it does not install drivers correctly when ran in an automated fashion. Because of this, the support software must be installed by hand after your BootCamp task sequence is complete.

Configuring your CM 2012 Environment

You must have CDROM boot media to complete the BootCamp process. A USB drive will not work, because the Mac will not pick it up as an appropriate startup disk. PXE will not work because the Mac’s firmware cannot recognize the PXE protocol (Macs use something called NetBoot as their network boot protocol).

I created a separate boot image for my BootCamp process. This is not really a requirement for the process to work, but I wanted to separate this process from my Windows machines. This boot media only contains the Ethernet drivers for Macs. These drivers can be found in the BootCamp support software and imported just like any other driver into CM 2012. I also was sure to add the Apple USB Ethernet Adapter drivers so that I could use this process for MacBook Airs and the new MacBook Pros.

After you have created your new boot image, create a boot media ISO and burn it to a CDROM or DVD. Another tip here would be to use an ISO editor and add the BootCamp support software to the ISO image before burning it. This will make accessing the support software easier as you must leave the boot media DVD in the drive for the entire imaging process (more on this later).

After creating the boot media, create a driver package containing just the network drivers that you imported. We will need to add this to the task sequence.

CM 2012 Task Sequence

Now we need to create a special BootCamp task sequence. This task sequence can be the copied from another, as it will only contain a few changes. First, remove any driver packages and “Apply Device Drivers” items that you may have. These will not be necessary. Now add the driver package that you created that contains the Mac network drivers.

If you have a step that repartitions the disk, remove it also. If you allow this step to run, it will erase the entire disk, including the Mac and recovery partitions. In its place, we need to reformat the BootCamp partition we create on the Mac side because it is formatted in FAT32 (more on this later). We will use a diskpart script to do this. Open a blank Notepad, and paste this into it:

SELECT disk 0 SELECT partition 4 FORMAT FS=NTFS QUICK OVERRIDE EXIT

This is a pretty simple script that any Windows admin should understand. The only thing to watch out for is where we select the appropriate partition. It will always be partition 4 (as of OS X 10.8) unless you have more than one Mac partition on your system.

This script needs to be saved to a network share that CM 2012 can access. In the task sequence, we will add the step that connects to a network share. Put the share path into the “Path” box and assign it a drive letter. If you have an account that you use to access network shares in a task sequence, fill in the “Account” box. Next, add a “Run Command Line” item to your task sequence immediately after the “Connect to network share” item. In the “Command line” box, paste this:

cmd.exe /c diskpart.exe /s Z:\bootcamp-diskpart.txt

Replace the drive letter with your drive letter and the text file name with your text file name. This step executes diskpart and picks up our script. Next, you can disconnect the network share if you want. The command to do this is:

net use Z: /delete

This step is voluntary, but I always do it.

This series of steps must be at the very top of your task sequence. If anything else tries to execute with the file system still being FAT32, the task sequence will fail.

1

All of these steps are the same no matter the architecture of your image. Also, if you copy another task sequence to create your BootCamp one, be sure to change the boot image it is using.

Setting up your Mac

Now we have to configure the Mac to use BootCamp. All we do here is use Disk Utility to create another partition. This can be done automatically through Apple Script, Apple Remote Desktop, or a management suite such as Casper, but that is out of the scope of this article. We will do it by hand in this example.

To begin, open Disk Utility. Next, select the disk where you want to add the BootCamp partition, and then the “Partition” tab. Shrink the Mac partition, then add a new partition. Change the format to “MS-DOS (FAT)”. Make sure that the partition you will be using for BootCamp is at least 10GB larger than your base CM 2012 image.

2

Now insert your CM 2012 boot media DVD. Go into the system preferences and select “Startup Disk”. The CM 2012 boot media should be an option. Select it and then click the “Restart…” button. This will reboot the Mac into the new BootCamp partition and load the boot media. One note here that I’ve noticed is that sometimes you have to reboot the Mac in order for the CM 2012 boot media to show up in the startup options. There is no clear reason for this, as it happens on different models and at different times. If the CM 2012 boot media doesn’t show up, reboot the Mac and it will.

3

When the computer boots to the task sequence screen, simply select your custom BootCamp task sequence and it runs just like anything else.

One of things you may be wondering at this point is how the Windows partition gets set to active so that Mac firmware sees it as an OS that can boot the computer. When you use the CM 2012 boot media, it recognizes that it goes with the MS-DOS partition. Because this DVD is bootable, the system sets that partition as active, and allows it to boot.

The boot media must remain in the Mac until the imaging process is complete. If you remove it, the Mac will reboot into the OS X partition every time your task sequence reboots the computer.

After Imaging

Once your task sequence completes, the only thing left to do is install the BootCamp support software. This will finish out any drivers that you are missing and also install the BootCamp control panel.

Also, I would recommend always installing Apple Software Update. Any BootCamp control panel updates will come through this service. This is vital to ensuring your system stays up-to-date.

email

Written by , Posted .