Thursday, April 26, 2018

Dualboot imaging macOS 10.13 and Windows 10 with Deploystudio and the Quest K2000 SDA


Introduction

This is the workflow I developed for deploying DualBoot Apple systems with macOS 10.13 and Windows 10. The workflow will only run on hardware that has been updated with a firmware version high enough to support 10.13 if using the APFS option. The HFS option does not require the firmware updates, although installing the latest firmware is always best practice.

Background

At Dickinson we use the Quest Systems Deployment Appliance (K2000) to run scripted installs of Windows. In the interest of having uniform configurations for all Windows systems I wanted to develop a system that would allow us to leverage the K2000 for BootCamp situations. This also allows us to save a lot of time by avoiding the need to create Windows images for those systems. The method I am using below should be adaptable to other WinPE based installation workflows.

Workflow steps

1.     Partition Disk
a.     If using APFS
                                               i.     Target Volume: First Disk Available
                                              ii.     Entire disk, Macintosh HD
b.     If using HFS
                                               i.     Target Volume: First Disk Available
                                              ii.     I use Macintosh HD 50%, BOOTCAMP 50% and KBE 5GB for the partitions
                                             
2.     Apply image
a.     Target Volume: Macintosh HD
b.     Image: APFS or HFS
c.      Image created using AutoDMG
3.     Disable SIP
We use rEFInd to provide a boot choice to users at startup, it requires SIP to be disabled to install.
4.     If using APFS you can now create the other required partitions using a ResizeAndAddPartitions shell script
This command will reduce the size of the APFS container to 50% of the drive, create an ms-dos partition named BOOTCAMP that is 100GB in size and create an ms-dos partition named KBE that is 6GB in size:
diskutil apfs resizecontainer disk0s2 50% ms-dos BOOTCAMP 100G ms-dos KBE 6G
I created a new DeployStudio shell script and the command is in the script.
5.     Copy Files – KBE files to KBE partition
The KACE Boot Environment files were generated by the KACE Media Manager. I copied them to the deployment share in the Files folder.
a.     Target Volume: /Volumes/KBE
b.     File/Folder: KBE
This folder contains the contents of the boot environment
c.      Path: /
d.     Exclude root folder: checked
6.     Additional tasks
At this point your DeployStudio workflow can include any other tasks required for configuring the macOS environment. We have a set of standard workflows for configuring our standard settings and installing our standard software.
7.     Install rEFInd
a.     If you are using a boot picker like rEFInd I recommend installing it as the last option.

Windows installation on BOOTCAMP partition

As far as the Deploystudio workflow goes, that is all there is to it. Once the workflow is applied to a machine and it finishes the process you should have a machine with the three partitions. Booting to the KBE partition, either through rEFInd or by holding in the option key at boot, should boot the system into the KACE Boot Environment. From there you can apply a scripted installation of Windows onto the Bootcamp partition.
It is important to note that the workflow for installing Windows should not include any partitioning steps. The BOOTCAMP partition should appear as the C: drive but won’t be formatted. The only pre-installation task in our scripted install formats the drive as NTFS.

I also include a last task in the post-installation tasks that deletes the KBE partition from the computer and expands the BOOTCAMP partition into that space using the diskpart command.

Further automation of the Windows installation

The developers of the K2000 have created an application called Default Deploy that allows you to automate the selection of an image or scripted install. More information about the tool can be found on the ITNinja Website (https://www.itninja.com/blog/view/k2000-default-deploy). Adding the tool to the boot environment requires the use of the KBE Manipulator application. Normally, you would add a custom command line to launch the default_deploy.bat file that launches the default_deploy.exe along with the correct parameters to begin the imaging process.
Rather than just launching the application, I modified the startnet.cmd command in the KBE to check for the presence of the default_deploy folder at the root of the KBE partition. This allows for the addition of a file copy task in the Deploystudio workflow that will automate the BOOTCAMP setup process.

In this case, I am copying a version of the default_deploy folder that has been configured to run the scripted installation for our Library’s pool of student loaners. After selecting the KBE boot option from the rEFInd menu I can walk away from the computer and it will automatically install Windows on the BOOTCAMP partition and be ready to go.

No comments: