FYI: self service command to reboot into boot camp

tlarkin
Honored Contributor

So, after almost pulling my hair out trying to make a self service policy that will force a reboot into windows, I finally found the answer.

At first I tried just having Casper set the boot volume to the boot camp partition, that did not work. JAMF support had me try the bless command, and that did not work either. The bless manual page is very lacking.

It is actually quite simple, and I thought i would post this on the Casper list for anyone who deploys dual booting Macs with OS X/Windows and still wants to lock down firmware and manage the clients.

so here are the very basic steps

1) Create new policy in JSS

2) Make it sure it is self service, add comments and custom logo if you want. I used the Windows XP logo for the policy.

3) On the reboot tab, force a reboot with your desired options. I force a reboot instantly, as I don't want my users interrupting it.

4) On the advanced tab, on the bottom there is a run unix command box, in there put this simple command

/usr/sbin/bless --device /dev/<devNode> --setBoot --legacy --nextonly

If you don't know the node your windows partition is on, simply in terminal do a diskutil list and it will list all of your partitions and the node they are on. For example, my windows partition is on /dev/disk0s3, so I would use that after the device flag.

You have to have the --legacy option. This is because Macs don't use BIOS and need to be set for legacy support and was the missing factor in my debacle earlier.

Now on the Windows side forcing the user back into OS X is a bit tricky, but I have a Novell object policy that runs a script for an application called autoIT, that forces the user back into OS X upon exiting a certain application.

It works for me when manually invoked, but I have yet to toss it on my JSS. I have full confidence it will most likely work as advertised though. Just remember to test it before you put it in the live environment.

Later,

Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
cell: 913-449-7589
office: 913-627-0351

1 REPLY 1

dmohs
Contributor

I also attempted to use a Casper policy that restarts into Boot Camp. Casper's built-in option to specify a startup disk failed to properly startup Boot Camp.

Using the information provided above, along with a tip from someone, I found great success executing the following command via Casper.

bless -mount "/Volumes/BOOTCAMP" -setBoot -legacy -nextonly

The above command assumes the Boot Camp partition is named "BOOTCAMP". The computer was running OS X 10.9.5, with Windows 8.1 on the Boot Camp partition.