Showing posts with label apple. Show all posts
Showing posts with label apple. Show all posts

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.

Thursday, March 03, 2016

Deploying MacOS X Upgrades with the Dell K1000

At work we will be deploying Office 2016 to campus this summer and it requires at least MacOS X version 10.10. In our environment we normally don't upgrade operating systems in place so we have a fair number of computers with earlier versions installed. This presents a problem. Our initial thought was that we would need to deploy the sneaker net and get to work. I realized that the K1000 detects Mac OS X as an installed program so I wondered if I could setup a managed install to deploy it and it turns out you can. I used the following procedure to deploy Mac OS X 10.11 El Capitan but it should also work for other versions.

Step 1: Download the OS Installer from the AppStore
If you don't already have a copy of the Install OS X El Capitan application from the Apple AppStore login and download a copy of it. You can leave it in the /Applications folder.

Step 2: Build a Mac OS X install package
Download createOSXInstallPkg script from GitHub and store it somewhere on your computer.
https://github.com/munki/createOSXinstallPkg
Open a terminal window and change to the location of the script.
The documentation for the script is well written but there isn't too much necessary for a basic package. The following command will create the package in the same location as the script:
sudo ./createOSXInstallPkg --source /Applications/Install\ OS\ X\ El\ Capitan.app/

You should end up with a file named something like InstallOSX_10.11.3_15D21.pkg. The version and build number (10.11.3 and 15D21 respectively) will depend on when you download the installer from the App Store.

Step 3: Create a disk image to hold the package
The K1000 appliance will deploy packages stored on a disk image and I have found this method to be the most reliable for uploading packages to the appliance.
Open Disk Utility
Click New Image
Give the disk image a name, I called mine MacOSX_10.11.3_15D21.dmg.
For the size you need to make the image larger than the size of the package because once the disk is formatted it will loose some space. My install package was 6.1GB so I made the disk image 7.5GB.
Leave the Format, Encryption, Partitions and Image Format defaults.
Click Create

Step 4: Copy the install package to the newly created disk image
The disk image should be mounted when created, but if it isn't mount it and then copy the file to the volume. Once it is copied, unmount the disk.

Step 5: Copy the disk image to the K1000 appliance
The web interface won't allow you to upload files more than 2GB so you will need to mount the clientdrop share on your K1000 and copy the file there. If you have not already enabled the SAMBA share on your appliance login to the admin interface and browse to Settings, Security.

Step 6: Associate the disk image with the software title
When creating a managed install it is very important that you associate the installer with the correct title. If you have any doubt about which software title to use then I strongly recommend that you use the installer to update one machine in your environment manually and then associate the file with the software title found in that machines software inventory after the setup is complete and the machine has checked into the K1000 again.
Once you are satisfied that you have the correct software title select the disk image from the Upload and Associate Client Drop File menu.
In the Supported Operating Systems list select the operating systems that you will be upgrading to 10.11.
Save the software title.

Step 7: Create the managed install
In the K1000 interface click Distribution
Under Managed Installs click Choose Action, New
Give your MI a name, I called mine Mac OS X El Capitan Install
Select 10.11.3 software title from the dropdown
Set the execution option based on whether or not you want to interrupt users with the installation or not.
Leave the Default installation option selected
For the notification options we setup both Alert user before run and Completion messages. This is what we have set for our environment:
Alert user before run:
Your computer has been scheduled to be upgraded to OS X El Capitan (10.11). You can continue to use the computer and will be notified when the first phase is complete.
Completion message:
The first phase of your upgrade to Mac OS X El Capitan is complete. Please restart your computer to begin the next phase. Phase two will take about half an hour to complete.
Save the managed install.

You should now be able to target computers with the installation and they will receive the upgrade. Note that the first phase of the installation (before the computer restarts) is silent. Unless you use a completion message the user will not be prompted to restart. Once the computer does restart the installation will proceed. I have had varied reports of whether or not there is interaction required during this phase of the upgrade.

The installation of 10.11 has been resetting the Sharing preferences in our environment. We normally have remote login and remote desktop enabled for certain users and after the upgrade those options are turned off. Thankfully the KACE agent is still checking in so you can use a script to set those options. Here is our script:
#!/bin/sh
# start here
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -allowAccessFor -specifiedUsers
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -users admin -access -on -privs -DeleteFiles -ControlObserve -TextMessages -OpenQuitApps -GenerateReports -RestartShutDown -SendFiles -ChangeSettings
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -clientopts -setmenuextra -menuextra no
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw VNCPasswordHere
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent -menu -console
sudo systemsetup -setremotelogin on
exit 0