Showing posts with label macosx. Show all posts
Showing posts with label macosx. 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.

Monday, June 26, 2017

Clearing applications from Profile Manager

For some unknown reason when editing the Dock payload in Profile Manager there are sometimes applications that won't go away, even if you delete them from the server. Thanks to this post on krypted.com I was able to figure out how to remove the offending apps from the database. Once they are created again on the server they will appear correctly when editing a Dock payload.



  1. Open a Terminal session on the profile manager server.
    You can do this while connected via Screen Sharing or on your Mac by connecting via ssh
  2. Switch to root with the following command:
    sudo –s
  3. Open the PostgreSQL command line application with the following command:
    sudo -u _devicemgr psql -h /Library/Server/ProfileManager/Config/var/PostgreSQL devicemgr_v2m0
  4. Show a list of applications installed on the system that are in the database with the following command:
    select id,path from system_applications;
    Note the semicolon at the end of the command line, it is needed
  5. To show a list of specific applications, e.g. Photoshop use this command:
    select id,path from system_applications where path like '%Photoshop%';
    Make a note of the id for the application you want to remove.
  6. To delete the offending application:
    delete from system_applications where id=123;
    Substitute the 123 for the actual id found in steps 4 or 5
  7. Exit psql with the following command:
    \q
  8. Exit the root shell with the following command:
    exit 
Once in the psql command line application there is a lot you can do to muck around in the database, of course. If you aren't comfortable in that kind of environment then be very careful or you would ruin your entire Profile Manager setup.

Friday, June 23, 2017

Automating Dual Boot Deployments - Part 1 - Introduction

I have been putting a lot of effort into the automation of dual boot deployments on Apple hardware and I am ready to start publishing that work. This first post in the series will cover my motivation for this work and future posts will include the details on my approach and methodology.

Trend 1 - Higher Demand
Dickinson College has seen a growth in the demand for dual boot Apple devices in recent years. I personally support three dual boot labs and many classrooms which total to almost 100 devices that need to be configured and re-imaged on an annual basis.

Trend 2 - Imaging Problems
With newer versions of macOS and Windows the benefits of creating "golden master" images are quickly fading and moving towards scripted installations/thin imaging is becoming a more preferred method of deployment. The tools used to create those images are also becoming more difficult to work with. In particular, changes in the macOS architecture have made creating images of Bootcamp partitions more difficult, if not impossible in some scenarios. The differences in hardware also make moving an image from one platform to another very difficult, also. For instance, creating an image on a Dell and applying it to an Apple device is fraught with peril.

Trend 3 - Thin Imaging/Scripted Installation
We have already made the transition to thin imaging on our Apple hardware for macOS and scripted installations for configuring Windows on our Dell systems. There was not a method for replicating this technique for Windows on Apple hardware in a dual boot scenario.

Motivator 1 - Desire for consistency
This divergence of configuration management resulted in a lack of consistency across devices. For example, imagine two classrooms with instructor computers. Classroom A has an iMac that is configured with macOS and Windows. Classroom B has a Dell with just Windows. If a professor teaches in classroom A using Windows she should expect the same experience in classroom B. Having the ability to create the same configuration on both platforms is highly desirable.

Motivator 2 - Making the most of current resources
With the move to thin imaging and scripted installations the desktop support team has put a large amount of time into packaging applications for deployment. This work could not be leveraged effectively when configuring Windows on dual boot systems.

Motivator 3 - Laziness
Let's be honest, I don't want to spend time configuring computers by hand, especially at a large scale. I have found that it is worth putting the time into developing a system that will save countless hours of clicking and typing.

Combining these trends and motivators led me to the work that I will be detailing in the next several posts. The broad strokes of my technique leverage Windows Native Boot to a virtual hard drive that contains the imaging environment for our Quest K2000 appliance. An image containing this virtual hard drive is placed onto the Bootcamp partition of a dual boot Apple device and when booted a scripted installation is performed. The end result is a Deploystudio workflow that completely automates the configuration of a dual boot system for both platforms that is consistent with other deployments across campus.

Friday, November 04, 2016

Deploying Creative Cloud Applications with the Dell K1000 Appliance

This document outlines the procedures for building Adobe Creative Cloud packages for distribution with the K1000. The document assumes that you have knowledge of using the Creative Cloud Packager already. You will need the ability to create packages using the Creative Cloud Packager and be able to install them on a Mac.
A few notes:
Because the end goal of this process is creating a managed install the instructions below are designed for installers that only include one application from the Creative Cloud.
The K1000 relies on specific version numbers of products which don't always align with the human friendly names of the Creative Cloud apps. Because of this we will be using the number release names for installers and not always the year release names, i.e. Dreamweaver 16.0 instead of Dreamweaver CC 2015.
In this document I will be using the example of creating a package for Photoshop CC 2015 which has a version number of 16.0.0. I recommend creating a folder on the root of your drive to save packages. Avoid using spaces in the folder and package names to make things easier later. You will be using  command line tools to manipulate files so you will need to know the paths to the packages you are creating. The Creative Cloud Packager will create a folder using the package name you specify.
1.     Using the Creative Cloud Packager create a package for a Creative Cloud Application.
a.     Note that if you are using serial numbers for device based application Adobe recommends not including the Creative Cloud application (as of Summer 2016).
2.     Install the package on your Mac.
3.     In the K1000 force an inventory update of your computer.
4.     Expand the Installed Programs section and find the title that you just installed.
5.     Click on the title to edit it.
6.     Make a note of the version number displayed for the title.
7.     Select the operating systems that this title supports.
Information about the Creative Cloud requirements is available here: https://helpx.adobe.com/creative-cloud/system-requirements.html
8.     Open Terminal.
9.     Create a disk image that contains the package. The disk image name should include the exact version number of the software title.
a.     The syntax for the command is:
hdiutil create –format UDZO –srcfolder /path/to/package.pkg -volname "Name of Volume" /path/to/output.dmg
b.     If you told Creative Cloud Packager to create a package named Photoshop in /Adobe then it will place the installer package at /Adobe/Photoshop/Build/Photoshop_Install.pkg
c.     The command to place that in a disk image would then be:
hdiutil create –format UDZO –srcfolder /Adobe/Photoshop/Build/Photoshop_Install.pkg -volname "Adobe Photoshop" /Adobe/Photoshop/Build/Photoshop16.0.0.dmg
d.     For more help on the hdiutil command view my document on creating disk images or the manual page: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/hdiutil.1.html
10.  Upload the disk image to the software title for this package.
11.  In the K1000 click Distribution.
12.  Click Choose Action, New
13.  Enter the name of the software title including the version number followed by (Mac) to indicate that this is the Mac installer.
14.  Select the title from the Software dropdown menu.
15.  Under execution select Anytime.
16.  Add a device to the devices list or a label to the Labels list.
Note: If you do not specify a device then the K1000 will want to deploy to all devices. If I do not have a specific target device planned, then I will add my own machine as a placeholder.
17.  Save the managed installation.