Self-Installing Windows OVA
because I can't distribute Windows
This is an Virtual Machine in OVA format that will install Windows ontop of itself. I wrote this as an alternative to packer. This OVA basically downloads the evaluation version of the Windows version you select to one drive as installation media and then installs onto the primary drive. After this is done, the smaller secondary drive can be discarded to save disk space. If the default size of the primary drive is not large enough, it should be resized BEFORE booting the OVA for the first time.
This OVA supports being repackaged with an ISO for further customization. Simply add at least one file,
install.cmd to an iso and attach it before booting the OVA for the first time. The system will boot up, and copy the contents of the iso to the secondary drive, display a message to the user upon success, then shutdown. The VM can be exported as a OVA now for redistribution.
Contents for an example iso are in the
iso/ directory. There is also a
Makefile target for building this iso,
This is simply run at first login after install. Place things in here like silent installation instructions for programs either off the same iso or downloaded from the internet.
This file should set at least one variable.
This should be one of the following keys:
|win2k16||Windows 2016 Standard|
|win10-64||Windows 10 64-bit|
|win10-32||Windows 10 32-bit|
|win2k12r2||Windows 2012 R2 Standard|
|win81-64||Windows 8.1 64-bit|
|win81-32||Windows 8.1 32-bit|
|win8-64||Windows 8 64-bit|
|win8-32||Windows 8 32-bit|
|win2k8r2||Windows 2008 R2 Standard|
|win7-64||Windows 7 64-bit|
|win7-32||Windows 7 32-bit|
This should be the absolute address of a local mirror for ISOs. It can also be
"none" for no mirror and no prompt. This allows truly unattended installation.
If this file is present on the ISO, in a directory named for the version key being installed, it will be used instead of an
Autounattend.xml from the boxcutter project. One gotcha is how Windows 7 and Windows 2008 think the install media is DriveID 0 and the actual "C" drive is DriveID 1. Keep that in mind when crafting answer files for these versions.
To build this, start with a debian system and install virtualbox and the following:
apt-get install fakeroot multistrap debian-archive-keyring rsync mtools genisoimage qemu-img dosfsutils