Automating Dual-Boot Lab Deployments at RMU
RMU just finished construction on its newest campus building for the School of Communications and Information Systems. The University's CIS department teaches a computer forensics course in which they expose students to forensic tools and procedures on both Mac and Windows platforms. In addition, students have requested a greater Mac availability on campus. For those reasons, the IT department decided that for the new building's special purpose lab, it would purchase iMacs from Apple and dual-boot them with OS X Mt. Lion and Windows 7. This proved to be both a much more elegant and cost effective solution than purchasing both a PC and a Mac for each workstation. It avoided clumsy and expensive KVM switches as well. With our decision came an interesting challenge for me: How can we reliably image a dual-boot lab in a repeatable and mostly automated manner?
- Apple BootCamp drivers package
- SetupComplete.cmd as part of the Windows sysprep process
- run-winsat.cmd
- A Windows 7 disk to repair the missing BOOTMGR
- DeployStudio
- A first boot script installed on the Mac side and run by DeployStudio
- BootPicker
- Munki
- The first line tells the machine to run another script, run-winsat.cmd (detailed below) during the Admin user's first login.
- The second line tells msiexec.exe to install the BootCamp drivers, logging to C:\Windows\BootCamp\BootCamp_Install.log. We found that calling the Apple BootCamp msi is the best way to install the BootCamp drivers on a Mac. Apple's msi handles all of the hardware probing and only installs the necessary drivers for that particular machine.
- The third and fourth lines simply rename the Apple HFS related drivers so that they are not used. We didn't want the Mac partition to mount on the Windows side of the machine for security reasons.
$echo "Beginning Bootcamp customization... checking for BOOTCAMP partition"
$diskutil info BOOTCAMP > /dev/null 2>&1
if [ $? = 0 ]; then
$echo "BOOTCAMP partition found!"
BOOTCAMPNODE=$($diskutil info BOOTCAMP | $awk '/Device Node/ {print $3}')
$echo "Got BOOTCAMP Node..."
$sleep 1
BOOTCAMPUUID=$($diskutil info BOOTCAMP | $awk '/Volume UUID/ {print $3}')
$echo "Got BOOTCAMP UUID..."
$sleep 1
$echo "Modifying /etc/fstab to not mount the BOOTCAMP volume on boot..."
$echo "UUID=$BOOTCAMPUUID none ntfs ro,noauto" > /etc/fstab
$echo "Done!"
$echo ""
$echo "Writing bootpicker preference file with the BOOTCAMP device location..."
$defaults write /Library/Preferences/bootpicker windowsPartition "$BOOTCAMPNODE"
$echo "Done."
else
$echo "No BOOTCAMP partition found! Continuing..."
fi
- Partitioning task for 160 GB Windows partition and the rest a Mac partition named RMU Workstation (Automated: Yes)
- Multicast Restore task for the Mac image to the RMU Workstation partition (Automated: Yes)
- Restore task for the Windows image to the Windows partition (Automated: No. Since it's unicast, we only would image a few at a time).
- Set the Windows partition to the default startup disk.
- Hostname form (Automated: No. We need to type in the name.)
- Generic Task to rename the computer on the Mac side (Automated: Yes)
- Install munkitools on the Mac side (Automated: Yes)
- Install the munki configuration file for the lab on the Mac side (Automated: Yes)
- Bind the machine to Open Directory on the Mac side for MCX management (Automated: Yes)
- Bind the machine to Active Directory on the Mac side (Automated: Yes)
- Enable the Firmware security when trying to use the startup manager (Automated: Yes. This is a new lab. The machines needed the firmware password.)
- Because we set the Windows partition to be the primary boot volume, the Mac first boots into Windows and begins the sysprep process with our customizations included.
- The machine reboots again to Windows and we login as the Admin user.
- Our run-winsat script runs and Aero is enabled and the default startup disk is then set to the Mac partition.
- We reboot the machine and then the DeployStudio finalize script runs and installs our munki packages, binds to the directories, and runs our first boot script with the customizations detailed earlier.
- The machine reboots after the DeployStudio finalize script is finished.
- After the reboot, Munki is set to be in bootstrap mode and begins installing the appropriate software on the Mac for the lab, including BootPicker and packages to update the BootPicker images and customize the text shown on the BootPicker window.
2577 views and 7 responses
-
Jan 1 2013, 9:07 PMJE responded:"I made a package that replaces the images (located at /Applications/Utilities/BootPicker.app/Contents/Resources/) with new ones for OS X 10.8 Mt. Lion and Windows 7. Our BootPicker text customization is done with a payload free package that runs a script that writes the appropriate lines to /Library/Preferences/bootpicker.plist. "
Would you mind sharing in greater detail exactly the process you went through to create this customisation of Bootpicker? Thanks very much.
-
Jan 3 2013, 5:24 PMMike Boylan responded:Hi JE, sorry for the delayed response.
Inside of BootPicker.app (right click and show contents...) is the folder structure Contents/Resources/. Inside that directory are two image files... one for Windows and one for OS X. You can replace those with your own to update the images. I made a package that had a payload of those two images with a destination path of /Applications/Utilities/BootPicker.app/Contents/Resources/.
As for the script... I made a payload-free package that included a postinstall (or postflight? can't remember at the moment) script that ran a few defaults write commands to set the key values for BootPicker. Something like defaults write /Library/Preferences/bootpicker title "Welcome to Lab 123!".
Hope that's helpful.
-
Jan 11 2013, 11:54 AMRussell responded:Good article and thanks for the Boot Runner mention. BR is out now and can be customized/automated with the bootrunner .plist file. twocanoes.com/boot-runner
-
Jan 13 2013, 9:07 PMDan responded:Hi Mike,
Please excuse the following ignorance, ive only just started working with Macs ( windows sys admin here)
Ive been tasked to set up dual boot for OSX 10.8 /Windows 7, everything is working fine, i set up dual boot with a similar way to you.
I would also like to change the bootpicker images, what i dont know how to do is compile a basic .pkg to copy the new images across, are you able to give me any guidance in this area?
Also i would love to be able to have bootpicker automatically display the computers hostname and i would also like to change the welcome message, any help in this would be appreciated.
Regards,
Dan
-
Jan 17 2013, 9:58 PMMike Boylan responded:Hi Dan,
Since you're new to OS X and packaging, I would take a look at Packages from Stephanie Sudre. It's a decently simple GUI that could help you accomplish this task. http://s.sudre.free.fr/Software/Packages/about.html After that, I'd take a look at The Luggage by Joe Block. It's my favorite tool for packaging. That being said, for this particular package, I actually used Jamf's Composer tool. It literally took me a few seconds to build as it watched the filesystem for changes while I just dragged the two new images into place.
BootPicker's welcome message cannot be (easily) changed, but the title can be by changing the value for "title" in the plist. It wouldn't be easily possible to add the hostname either as far as I know. Tim Sutton (http://macops.ca @tvsutton) has done some work on modifying the GUI for BootPicker. You may want to reach out to him for some additional assistance. I think he's removed the welcome message all together, come to think of it.
Hope this is helpful!
-
Jan 18 2013, 6:40 PMRyan Stasel responded:Mike,
Good article, thanks! I guess my only question is, why no answer file (unattend.xml) for sysprep? I did a test restore, and was greeted by all the "name computer", "create user", crap. I just want to image and be done with it. Only wish DS had the ability to rename the windows side (so I won't have to do it manually).
Thanks again! I'll be referring to this, and this: http://www.edugeek.net/forums/o-s-deployment/75778-sysprep-answer-file-window... on Tuesday when I finalize the image. =)
-
Jan 19 2013, 12:49 PMMike Boylan responded:Ryan,
I didn't mention it in the article because I don't manage that part of the deployment, but I believe our sysprep process does include an unattended.xml file.
DeployStudio does actually have the ability to rename the Windows side of a bootcamp deployment, but I've never actually tried to use it. I imagine there are very specific requirements for it to work.
Glad this was helpful to you!
- Mike