-
Notifications
You must be signed in to change notification settings - Fork 165
Installing windows
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
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.
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:
- 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.
- 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.) - Change into that directory. (I used
c:\build
, but anything should be good.) - 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.
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:
-
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.
-
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.)
-
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. -
Install the
p7zip
orp7zip-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.
-
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 therepo_store_root
directory. The repo's directory should match the repo's name. -
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.
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
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
).
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.