Showing posts with label boot camp. Show all posts
Showing posts with label boot camp. Show all posts

Thursday, January 20, 2011

Fully automated reinstall of computer lab

We have a computer room with 23 iMacs, all is dual boot Mac OS X 10.6/Windows 7 through BootCamp. Here is how I have automated the whole process.









Because there are so many applications in both OS's, we have created two master images which is deployed through DeployStudio (DSS).

DeployStudio does the following:

- Deploys the two master images
- Sets the computer name from the DSS database in both Mac OS and Windows
- Sets Mac OS as default startup disk
- Sets time server in Mac OS
- Joins Mac OS to our Active Directory
- Activates Software Update on first boot
- Activates a script on first boot that sets some energy savings settings
- Activates a script on first boot that sets the windows partition as default startup disk

So when DSS is done, rebooted and run Software Update, joined AD and run the scripts, it boots into a syspreped Windows 7 installation. The sysprep does a lot of things to the Windows installation, like: setting the computername, joining AD (through a powershell script on first automatic login), running winsat and so on...

One thing to think about is when you create the unattend.xml, you have to specify a ComputerName, otherwise, that key is not present in the xml file, and DSS does not set the ComputerName automatically.

And another thing to think about is the joining to AD. The component UnattendedJoin, did not work for us, then I discovered we were not alone. Setting the admin user to login automatically one time and setting a powershell script to run on first login did the trick.

So long fully automated, but you still have to go to every machine and netboot them, select workflow in DSS and trigger it. Here is where bless blesses us! But first we had to create a user and a group for DSS, which we named dsautodeploy and dsautodeployers. Add the group as a runtime group in DSS, create a NetBoot set in DSS with dsautodeploy enabled as autologin. Then edit the workflow in DSS so everything is automated and select a default workflow for the group of computers.
Now, all you have to do to reinstall the computers is to send this command with ARD (as root):

bless --netboot --server "bsdp://" --options "rp=nfs::/private/tftpboot/NetBoot/NetBootSP0:.nbi/DeployStudioRuntime.sparseimage"

And if the computers is booted in Windows 7, you can (as of BootCamp 3.0) run this command with psexec:
psexec \\COMPUTERNAME "C:\Program Files\Boot Camp\BootCamp.exe" -startupDisk

And then run the bless command above. The "BootCamp.exe -startupDisk" command may also be used in sysprep to boot into Mac OS after the windows setup is done when deploying. But we want windows to be the default OS on these machines...

The script I run in the workflow to make Windows the default startup disk is as simple as this:

#!/bin/sh

#Find the Windows disk and it's mountpoint
WINDOWSDISK=$(mount | grep ntfs | awk -F" " '{print $3}')

#Set $WINDOWSDISK as default boot partition
bless --mount "$WINDOWSDISK" --setBoot --legacy --verbose

exit 0

Happy deploying!

PS. Don't you just love DSS? I know I do :)

Friday, August 20, 2010

If Boot Camp drivers fails to install

Had this problem yesterday with a new iMac (iMac10,1).

I had an old Windows XP SP3 image with all the applications etc I wanted in Windows. I applied the image to a Boot Camp partition, booted Windows without any problems.

Now I wanted to install the Boot Camp drivers from the Snow Leopard DVD, I launched the installation, but it failed immediately with a message saying something like "a problem occurred, please try again later".

The event log said "msiinstaller error code 11708", which gave me nothing.
Then I launched the BootCamp.msi (in /Boot Camp/Drivers/Apple) with "msiexec /i BootCamp.msi /l* c:\bc.log". In the log file I found that a function called GETINTELGRXID failed with exit code 3.
I think this is supposed to get which kind of Intel graphics card it is in the machine, but since it's an Nvidia card in this iMac I thought it didn't matter if that function ran or not.

So next thing to do was editing the msi with Orca and delete all entries that contained "GETINTELGRXID" (I think I found it in two places). When that was done, I just saved the msi and launched it with the command above, and it worked! Now I have an iMac that have a fully working Boot Camp install!