Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Installing windows

smcclellan edited this page Nov 13, 2015 · 17 revisions

About Windows Install Support

Currently, Razor's Windows support has been tested to work with several variants. You may find some missing features and be required to do some error-debugging if any issues arise. The purpose of the current release is to get real world experience with Windows installation automation, and to discover the missing features required to truly support the Windows world.

For licensing reasons, you will need to have your own copies of Windows available: both the installer content, and the Windows Assessment and Deployment toolkit, containing the Windows PE environment used to automate the Windows installer.

The Windows installer support has been tested with:

  • WinPE 4.0 AMD64 built on Windows 8.0, Windows 2012R2, and Windows 2008R2 AMD64
  • VMWare Fusion VMs and physical machines
  • Windows 8 Professional, 2012R2, and 2008R2 installed to VM and physical server

Getting Started

Right now it is assumed that your DHCP server and your Razor server are on the same IP address, or that you forward HTTP on port 8150 from the DHCP server to the Razor server. If your DHCP server and Razor server are not on the same IP Address, or your Razor server is running on the open source default of port 8150, you must hard code the IP Address or FQDN in the razor-client.ps1 file, before building your WinPE image.

Setting up for Windows installation

Getting Windows installable is a multi-step process: licensing on Windows PE requires that you build your own custom WinPE WIM image containing our scripts, as we cannot redistribute a pre-built image. The first stage is to build your own WinPE image suitable for use with Razor:

  1. Install the Windows Assessment and Deployment IN THE DEFAULT LOCATION. Sadly, my scripts couldn't detect a custom install location at all, so they have hard coded paths.
  2. Copy the build-winpe directory content to a Windows machine. (I used Windows 8 Professional, but anything the ADK runs on should theoretically work fine.)
  3. Change into that directory. (I used c:\build, but anything should be good.)
  4. Run powershell -executionpolicy bypass -noninteractive -file build-razor-winpe.ps1 -razorurl http://<URL_FOR_RAZOR>:8150/svc to run the build script.

This will take some time. Quite some time. It will eventually output an image matching razor-winpe\*.wim under the current working directory. This is your custom WinPE image with the required components to work with the Razor server.

Create Repo

Next, create the repository from your Windows installer. This is done in the usual way; unfortunately, I found that my Windows DVD image triggered a bug in libarchive that prevented unpacking. You can use a tool like 7zip to unpack the Windows ISO image without going through libarchive.

To work around the incompatibility between some (but not all) Windows DVD images, and the libarchive code used in Razor to unpack them, perform the following steps:

  1. Have a normal installation of Razor ready to go, up to the point that you are ready to create the Windows repository. Make sure this is working correctly, e.g., by creating a repository with a Linux CD or DVD image.

  2. If desired, verify that your Windows DVD or CD image actually requires this effort, by trying to create a repository using it. The Razor system will emit log messages indicating that the task of unpacking the repository has been pushed into the background. If you do this, it will be necessary to delete the repository if unpacking fails. (The logs show that unpacking needs to be retried.)

  3. Assuming that it failed, run the create-repo command again but with the --no-content argument rather than --iso-url or --url. This creates a blank repo directory and skips the libarchive unpacking stage. Keep the rest of the details (e.g. the repo's name) the same.

  4. Install the p7zip or p7zip-full package for your platform, with ISO image support.

    Alternatively, anything that can unzip the ISO file will do. For example, you could mount the CD or DVD image using the standard mount(1) Linux command, and then use cp(1) to copy the files into the repository, or you could use another tool than 7zip to extract the content of the image.

  5. Use e.g. 7z x .../windows.iso to unpack the Windows image into the repo directory. To find the directory, look in your config.yaml for the repo_store_root directory. The repo's directory should match the repo's name.

  6. Copy the WinPE Wim you created earlier to the root of your repo (by default /var/lib/razor/repo-store/) and rename it to razor-winpe.wim

NOTE: There are several alternative methods for step 4. For example, you could mount the CD or DVD image using the standard mount(1) Linux command, and then use cp(1) to copy the files into the repository, or you could use another tool than 7zip to extract the content of the image.

Create SMB Share

Next, configure a SMB server on the Razor server, exporting the Razor repositories. This is necessary as the WinPE environment can't use an HTTP source for installation, and neither can the Windows 8 installer software.

This is a fairly simple share: allow anonymous access, call it razor, and point it to your repo store root. (e.g.: the one from your config.yaml file.) smb.conf (e.g. /etc/samba/smb.conf) should look like this:

[razor]
  comment   = Windows Installers
  # this is, by default, under /var/lib/razor/repo-store/
  path      = /var/lib/razor/repo-store/
  guest ok  = yes
  writable  = no
  browsable = yes

You may also have to set your smb server to "share" level security

[global]
  security = share

Create razor policies

Finally, create your policies, etc, as normal. The broker will be installed and run as a SetupComplete.cmd script when the install is complete. Unless you are passing the system off to a config management system, creating a "noop" broker will suffice (razor create-broker --name noop --broker-type noop).

Using Windows installation

Once you have policies, automatic installation should just work™ if your policy binds a node. You should watch the console -- error handling favors "drop to a cmd prompt" -- while testing it out.