Skip to content

Commit 4ab740f

Browse files
committed
Use BIOS boot instead of UEFI
1 parent bdb6de6 commit 4ab740f

File tree

5 files changed

+10
-55
lines changed

5 files changed

+10
-55
lines changed

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,18 @@ It also assumes that the Kubernetes cluster and Windows VM will be running on th
2525
- A Windows Server installation ISO (download from https://www.microsoft.com/en-us/evalcenter/download-windows-server-2022)
2626
- A Kubernetes cluster (kind is suggested) running the Stackable Data Platform
2727

28-
In addition, for a completely unattended installation, the ISO must be patched using cdrtools.
29-
3028
When using Nix, you *need* to run inside `direnv` or `nix-shell` (which will provide Ansible for you). Nixpkgs's regular Ansible is *not* enough.
3129

3230
## Using it
3331

3432
1. Put your Windows ISO in `target/Windows Server 2022 EVAL.iso` (or modify `install_iso_windows` to point at it)
3533
2. Run `ansible-playbook install.yaml -i inventory.ini`
36-
3. Open virt-manager
37-
4. When the VM appears, open it and answer the "press any key to boot" prompt (reboot the VM if you missed it)
38-
5. Wait for the playbook to complete
39-
6. Done!
34+
3. Wait for the playbook to complete
35+
4. Done!
36+
37+
### Completely unattended on UEFI (noprompt patch)
4038

41-
### Completely unattended (noprompt patch)
39+
NOTE: This is mostly a note for any future remigration to UEFI. This patch is not required when using BIOS boot.
4240

4341
The "press any key to boot" prompt can be disabled by patching the Windows ISO, but this requires a slightly manual one-time process as root:
4442

roles/create-vm/defaults/main.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,3 @@ install_iso_virtio_win: "{{ lookup('first_found', 'target') }}/virtio-win.iso"
2121
install_exe_spice_guest_tools_url: https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-0.141/spice-guest-tools-0.141.exe
2222
install_exe_spice_guest_tools_checksum: sha256:b5be0754802bcd7f7fe0ccdb877f8a6224ba13a2af7d84eb087a89b3b0237da2
2323
install_exe_spice_guest_tools: "{{ lookup('first_found', 'guest-files') }}/spice-guest-tools.exe"
24-
25-
# Some distributions don't ship firmware selection manifests, so we need to
26-
# provide an override ourselves.
27-
# vm_firmware_override will be set to the first candidate that exists, if any.
28-
vm_firmware_override: null
29-
vm_firmware_override_candidates:
30-
# NixOS:
31-
# https://github.com/NixOS/nixpkgs/issues/115996, and
32-
# https://github.com/NixOS/nixpkgs/issues/318079
33-
- /run/libvirt/nix-ovmf/OVMF_CODE.fd

roles/create-vm/files/windows-install-config/Autounattend.xml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,18 @@
1515
<DiskConfiguration>
1616
<Disk wcm:action="add">
1717
<CreatePartitions>
18-
<CreatePartition wcm:action="add">
19-
<Type>EFI</Type>
20-
<Size>200</Size>
21-
<Order>1</Order>
22-
</CreatePartition>
23-
<CreatePartition wcm:action="add">
24-
<Type>MSR</Type>
25-
<Size>200</Size>
26-
<Order>2</Order>
27-
</CreatePartition>
2818
<CreatePartition wcm:action="add">
2919
<Type>Primary</Type>
30-
<!-- Will be extended to the full rest of the disk in ModifyPartition -->
31-
<Size>1024</Size>
32-
<Order>3</Order>
20+
<Extend>true</Extend>
21+
<Order>1</Order>
3322
</CreatePartition>
3423
</CreatePartitions>
3524
<ModifyPartitions>
3625
<ModifyPartition wcm:action="add">
3726
<Order>1</Order>
3827
<PartitionID>1</PartitionID>
39-
<Format>FAT32</Format>
40-
</ModifyPartition>
41-
<ModifyPartition wcm:action="add">
42-
<Order>2</Order>
43-
<PartitionID>2</PartitionID>
44-
<!-- MSR partition is managed by Windows, and cannot be formatted manually -->
45-
</ModifyPartition>
46-
<ModifyPartition wcm:action="add">
47-
<Order>3</Order>
48-
<PartitionID>3</PartitionID>
4928
<Format>NTFS</Format>
50-
<Extend>true</Extend>
29+
<Active>true</Active>
5130
<Letter>C</Letter>
5231
</ModifyPartition>
5332
</ModifyPartitions>

roles/create-vm/tasks/main.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@
2424
url: "{{ install_exe_spice_guest_tools_url }}"
2525
checksum: "{{ install_exe_spice_guest_tools_checksum }}"
2626

27-
- name: Find firmware path
28-
set_fact:
29-
vm_firmware_override: "{{ item }}"
30-
with_first_found:
31-
- files: "{{ vm_firmware_override_candidates }}"
32-
skip: True
33-
3427
- name: Create VM Network
3528
community.libvirt.virt_net:
3629
name: "{{ vm_network_hostnet_name }}"

roles/create-vm/templates/windows-vm.xml.j2

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@
99
<currentMemory unit="MiB">{{ vm_memory_mib }}</currentMemory>
1010
<vcpu placement="static">{{ vm_vcpus }}</vcpu>
1111
<os
12-
{% if not vm_firmware_override %}
13-
{# firmware=... actually controls *autodetection*, so only set if there is no override #}
14-
firmware="efi"
15-
{% endif %}>
12+
{# EFI seems to vary more between distributions, and makes Windows always do the "press any key to install" prompt #}
13+
{# firmware="efi" #}>
1614
<type arch="x86_64" machine="pc-q35-8.0">hvm</type>
17-
{% if vm_firmware_override %}
18-
<loader type='pflash'>{{ vm_firmware_override }}</loader>
19-
{% endif %}
2015
</os>
2116
<features>
2217
<acpi/>

0 commit comments

Comments
 (0)