HOW-TO:
0) DON'T BOOT IT! It will try to phone-home!!!! Obtain an iso image of the original 'RTM' version of your exact flavor of Windows (google and/or your PC's manufacturer will help you). Verify the SHA256 against what MSDN says it should be!
1) Grab a live-boot Fedora DVD
2) Read your manual, be SURE of how to enter the boot-device menu IMMEDIATELY after power on (i.e. DO NOT LET WINDOWS BOOT!!!!)
3) Boot the live-dvd, UNMOUNT the hard-drive filesystems (if they auto-mount).
4) Connect up to a network and save an image of the original factory content of your disk (take a LONG time):
Code:
dd if=/dev/sda bs=32M | xz -9 --block-size 32M --stdout - | ssh someone@somewhere.com'cat - > /path/to/some/file.xz'
5) From a terminal make copies of these two ACPI tables onto a USB stick or similar:
Code:
/sys/firmware/acpi/tables/SLIC
/sys/firmware/acpi/tables/MSDM
6) Your windows COA key is embedded in plain-text, in the last one. Make quick work of that with hexdump and tail:
Code:
hexdump -e '"%c"' /sys/firmware/acpi/tables/MSDM | tail -c 29
That there is your COA / install key, write it down and keep in in a safe place.
7) Note the exact size (in bytes) and the serial number of your hard-disk with 'smartctl -i /dev/sda'
8) Note _all_ your network interfaces MAC addresses (including wireless)
9) Reboot and install Fedora, blowing away the content of the hard-disk.
10) Install all the development tools and libraries and the 'iasl' package
11) Follow these instructions to setup an EDK II build environment
12) Edit Conf/target.txt and set (assuming you have 4 CPU threads:
Code:
ACTIVE_PLATFORM = OvmfPkg/OvmfPkgX64.dsc
TARGET = RELEASE
TARGET_ARCH = X64
MAX_CONCURRENT_THREAD_NUMBER = 5
TOOL_CHAIN_TAG = GCC48
13) Go into 'src/edk2/CryptoPkg/Library/OpensslLib' and follow instructions in 'Patch-HOWTO.txt'
14) from src/edk2 build with this command:
Code:
OvmfPkg/build.sh -a X64 -b RELEASE -D FD_SIZE_2MB -D SECURE_BOOT_MODE_ENABLE
15) Your new UEFI secure-boot enabled, virtio supporting firmware is here:
Code:
Build/OvmfX64/RELEASE_GCC48/FV/OVMF.fd
16) Download the official M$ keys and signatures (completely legal), See attached tarball on this post (below)
17) Use 'virt-install' to create (but don't start) a new VM
18) Figure out your Socket/Core/Thread counts from /proc/cpuinfo
19) Note the entire CPU section from 'virsh capabilities'
20) Note the info from. 'dmidecode -t 0' and 'dmidecode -t 1'
21) Copy your 'OVMF.fd' to /var/lib/libvirt/images, use qemu-img to make a copy-on-write qcow2 image your VM can write to:
Code:
qemu-img create -f qcow2 -o backing_file=/var/lib/libvirt/images/OVMF.fd,backing_fmt=raw /var/lib/libvirt/images/win81_bios.qcow2
(fixup ownership, permissions, and SELinux contexts with chown/chmod/chcon)
22) Edit your new VM's xml with 'virsh edit somename', use info from above to fill out sysinfo as follows (for example):
Code:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
...
<uuid> exact uuid from dmidecode -t 0 </uuid>
...
<sysinfo type='smbios'>
<bios>
<entry name='vendor'>LENOVO</entry>
<entry name='version'>8ECN91WW</entry>
<entry name='date'>11/28/2013</entry>
<entry name='release'>0.91</entry>
</bios>
<system>
<entry name='manufacturer'>LENOVO</entry>
<entry name='product'>20252</entry>
<entry name='version'>Lenovo G710Lenovo G710</entry>
<entry name='serial'> serial number from dmidecode</entry>
<entry name='uuid'> exact from dmidecode -t 0 </entry>
<entry name='sku'>LENOVO_MT_20252</entry>
<entry name='family'>IDEAPAD</entry>
</system>
</sysinfo>
...
<os>
...
<smbios mode='sysinfo'/>
</os>
<cpu mode='custom'>
paste in CPU section contents from #19 above
</cpu>
...
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
...
<serial> disk serial number from #7 above </serial>
...
</disk>
...
<interface type='network'>
<mac address=' mac you noted from #8 above '/>
...
</interface>
<qemu:commandline>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/path/to/copy/acpi_table/MSDM'/>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/path/to/copy/acpi_table/SLIC'/>
<qemu:arg value='-pflash'/>
<qemu:arg value='/var/lib/libvirt/images/win81_bios.qcow2'/>
</qemu:commandline>
23) use qemu-img + guestfish to make a temporary fat32 image containing the *cer files you downloaded.
24) Make that temporary image and your Windows DVD iso image available to and boot the VM. Immediately hit escape to get into the UEFI BIOS, go under 'Device Manager' then 'Secure Boot Configuration'.
25) Set 'Secure Boot Mode' to 'custom', then go under 'Custom Secure Boot Options'
26) Use the menus + your temporary fat32 image to load the pk.cer, kek.cer, and all three db-?.cer files (ignore 'DBX Options')
27) Set 'Secure Boot Mode' to 'Standard Mode' and hit space bar on 'Attempt Secure Boot'
28) Back under 'Device Manager', go under 'OVMF Platform Configuration' and set your display resolution as you like.
29) Use 'Boot Maintenance Manager', 'Boot From File' to boot off your Windows DVD's bootx64.efi file.
30) Rejoice after installation when you find your windows boots and is already activated