1 | # OVMF runtime configuration
|
---|
2 |
|
---|
3 | Some aspects of OVMF can be configured from the host, mostly by adding
|
---|
4 | firmware config files using the qemu command line option `-fw_cfg`.
|
---|
5 | The official namespace prefix for edk2 is `opt/org.tianocore/` which
|
---|
6 | is used by most options. Some options are elsewhere for historical
|
---|
7 | reasons.
|
---|
8 |
|
---|
9 |
|
---|
10 | ## TLS: etc/edk2/https/cacerts
|
---|
11 |
|
---|
12 | This is a list of root CA certificates which the firmware should
|
---|
13 | accept when talking to TLS servers, stored in EFI signature database
|
---|
14 | format. Fedora and CentOS provide a copy of the host root CA database
|
---|
15 | (which is used by openssl & friends too) in the correct format. Using
|
---|
16 | that is as simple as:
|
---|
17 |
|
---|
18 | ```
|
---|
19 | qemu-system-x86_64 \
|
---|
20 | -fw_cfg name=etc/edk2/https/cacerts,file=/etc/pki/ca-trust/extracted/edk2/cacerts.bin
|
---|
21 | ```
|
---|
22 |
|
---|
23 | For a more strict configuration where only one or very few servers are
|
---|
24 | allowed (instead of pretty much any https server on the public
|
---|
25 | internet) you can use the `virt-fw-sigdb` utility from the
|
---|
26 | [virt-firmware project](https://gitlab.com/kraxel/virt-firmware) to
|
---|
27 | create a database with only these server certificates:
|
---|
28 |
|
---|
29 | ```
|
---|
30 | GUID=$(uuidgen)
|
---|
31 | virt-fw-sigdb -o mycerts.esl \
|
---|
32 | --add-cert ${GUID} /etc/pki/tls/certs/${server1}.crt \
|
---|
33 | --add-cert ${GUID} /etc/pki/tls/certs/${server2}.crt
|
---|
34 | qemu-system-x86_64 \
|
---|
35 | -fw_cfg name=etc/edk2/https/cacerts,file=mycerts.esl
|
---|
36 | ```
|
---|
37 |
|
---|
38 |
|
---|
39 | ## TLS: etc/edk2/https/ciphers
|
---|
40 |
|
---|
41 | Configres the allowed TLS chiper suites. Using the host's system
|
---|
42 | configuration works this way:
|
---|
43 |
|
---|
44 | ```
|
---|
45 | qemu-system-x86_64 \
|
---|
46 | -object tls-cipher-suites,id=mysuite0,priority=@SYSTEM \
|
---|
47 | -fw_cfg name=etc/edk2/https/ciphers,gen_id=mysuite0
|
---|
48 | ```
|
---|
49 |
|
---|
50 |
|
---|
51 | ## Network: opt/org.tianocore/IPv4Support
|
---|
52 |
|
---|
53 | As the name suggests, this enables/disables IPv4 support. Default:
|
---|
54 | enabled. Usage:
|
---|
55 |
|
---|
56 | ```
|
---|
57 | qemu-system-x86_64 -fw_cfg name=opt/org.tianocore/IPv4Support,string=no
|
---|
58 | ```
|
---|
59 |
|
---|
60 | ## Network: opt/org.tianocore/IPv6Support
|
---|
61 |
|
---|
62 | Same for IPv6.
|
---|
63 |
|
---|
64 |
|
---|
65 | ## Network: opt/org.tianocore/IPv4PXESupport
|
---|
66 |
|
---|
67 | This enables/disables PXE network boot over IPv4. This does not
|
---|
68 | affect HTTP boot. Default: enabled. Usage:
|
---|
69 |
|
---|
70 | ```
|
---|
71 | qemu-system-x86_64 -fw_cfg name=opt/org.tianocore/IPv4PXESupport,string=no
|
---|
72 | ```
|
---|
73 |
|
---|
74 |
|
---|
75 | ## Network: opt/org.tianocore/IPv6PXESupport
|
---|
76 |
|
---|
77 | Same for IPv6.
|
---|
78 |
|
---|
79 |
|
---|
80 | ## Network: opt/org.tianocore/VirtioNetSupport
|
---|
81 |
|
---|
82 | This enables/disables the edk2 driver for virtio net devices.
|
---|
83 | Default: enabled. Usage:
|
---|
84 |
|
---|
85 | ```
|
---|
86 | qemu-system-x86_64 -fw_cfg name=opt/org.tianocore/VirtioNetSupport,string=no
|
---|
87 | ```
|
---|
88 |
|
---|
89 |
|
---|
90 | ## Network: opt/org.tianocore/ISCSISupport
|
---|
91 |
|
---|
92 | This enables/disables the edk2 driver for iSCSI.
|
---|
93 | Default: disabled. Usage:
|
---|
94 |
|
---|
95 | ```
|
---|
96 | qemu-system-x86_64 -fw_cfg name=opt/org.tianocore/ISCSISupport,string=yes
|
---|
97 | ```
|
---|
98 |
|
---|
99 |
|
---|
100 | ## Security: opt/ovmf/PcdSetNxForStack
|
---|
101 |
|
---|
102 | Set stack pages as not executable in page tables. Usage:
|
---|
103 |
|
---|
104 | ```
|
---|
105 | qemu-system-x86_64 -fw_cfg name=opt/ovmf/PcdSetNxForStack,string=yes
|
---|
106 | ```
|
---|
107 |
|
---|
108 |
|
---|
109 | ## Security: opt/org.tianocore/UninstallMemAttrProtocol
|
---|
110 |
|
---|
111 | Do not provide the `EFI_MEMORY_ATTRIBUTE_PROTOCOL` protocol. This is
|
---|
112 | a workaround for a bug in shim version 15.6. Usage:
|
---|
113 |
|
---|
114 | ```
|
---|
115 | qemu-system-x86_64 -fw_cfg name=opt/org.tianocore/UninstallMemAttrProtocol,string=yes
|
---|
116 | ```
|
---|
117 |
|
---|
118 |
|
---|
119 | ## Shell: opt/org.tianocore/EFIShellSupport
|
---|
120 |
|
---|
121 | This enables/disables the EFI shell.
|
---|
122 | Default: enabled. Usage:
|
---|
123 |
|
---|
124 | ```
|
---|
125 | qemu-system-x86_64 -fw_cfg name=opt/org.tianocore/EFIShellSupport,string=no
|
---|
126 | ```
|
---|
127 |
|
---|
128 |
|
---|
129 | ## Security: opt/org.tianocore/EnableLegacyLoader
|
---|
130 |
|
---|
131 | OVMF can load linux kernels in two ways:
|
---|
132 |
|
---|
133 | * modern: load them as EFI binary, let the linux kernel's EFI stub
|
---|
134 | handle initrd loading, exiting boot services etc.
|
---|
135 | * legacy: load kernel + initrd directly, patch kernel setup header
|
---|
136 | with initrd location, ...
|
---|
137 |
|
---|
138 | OVMF will try the modern way first, in case of a failure fallback to
|
---|
139 | the legacy method. The legacy loader will not do secure boot
|
---|
140 | verification though. Disabling the legacy loader using this option
|
---|
141 | will plug that hole. It will also break booting prehistoric kernels
|
---|
142 | without EFI stub. If you are using kernels that old secure boot
|
---|
143 | support is the least of your problems though ...
|
---|
144 |
|
---|
145 | The linux kernel is typically signed by the distro secure boot keys
|
---|
146 | and is verified by the distro `shim.efi` binary. qemu release 10.0
|
---|
147 | (ETA ~ March 2025) will get support for passing the shim binary
|
---|
148 | (additionally to kernel + initrd) to the firmware, so the usual secure
|
---|
149 | boot verification can work with direct kernel load too.
|
---|
150 |
|
---|
151 | For now the legacy loader is enabled by default. Once the new qemu
|
---|
152 | release is available in most linux distros the defaut will be flipped
|
---|
153 | to disabled.
|
---|
154 |
|
---|
155 | Usage (qemu 10.0+):
|
---|
156 |
|
---|
157 | ```
|
---|
158 | qemu-system-x86_64 \
|
---|
159 | -shim /boot/efi/EFI/${distro}/shimx64.efi \
|
---|
160 | -kernel /path/to/kernel \
|
---|
161 | -initrd /path/to/initamfs \
|
---|
162 | -append "kernel command line" \
|
---|
163 | -fw_cfg name=opt/org.tianocore/EnableLegacyLoader,string=no
|
---|
164 | ```
|
---|
165 |
|
---|
166 |
|
---|
167 | ## Platform: opt/org.tianocore/X-Cpuhp-Bugcheck-Override
|
---|
168 |
|
---|
169 | On some older qemu versions CPU hotplug support was broken. OVMF
|
---|
170 | detects that and will by default log an error message and stop. When
|
---|
171 | setting this option OVMF will continue despite qemu being buggy. It
|
---|
172 | is only safe to set that option if you do not use CPU hotplug. Usage:
|
---|
173 |
|
---|
174 | ```
|
---|
175 | qemu-system-x86_64 -fw_cfg name=opt/org.tianocore/X-Cpuhp-Bugcheck-Override,string=yes
|
---|
176 | ```
|
---|
177 |
|
---|
178 |
|
---|
179 | ## Platform: opt/ovmf/X-PciMmio64Mb
|
---|
180 |
|
---|
181 | Historically OVMF has by default used 32GB of address space for the
|
---|
182 | 64-bit PCI MMIO window. This option can be used to change that size.
|
---|
183 |
|
---|
184 | Recent OVMF versions have started to use a larger MMIO window by
|
---|
185 | default, with the actual size depending on the address space size
|
---|
186 | supported by the CPU. With this the default configuration should
|
---|
187 | cover alot more use cases and it should be rather rare that this
|
---|
188 | option must be used to enlarge the MMIO window.
|
---|
189 |
|
---|
190 | Usage example (128GB / 131072 MB):
|
---|
191 |
|
---|
192 | ```
|
---|
193 | qemu-system-x86_64 -fw_cfg name=opt/ovmf/X-PciMmio64Mb,string=131072
|
---|
194 | ```
|
---|
195 |
|
---|
196 |
|
---|
197 | ## Platform: physical address space bits
|
---|
198 |
|
---|
199 | OVMF will check the supported physical address space bits (via CPUID)
|
---|
200 | when creating the address space layout. OVMF will use the complete
|
---|
201 | available address space and place the 64-bit PCI MMIO window near the
|
---|
202 | top of the address space.
|
---|
203 |
|
---|
204 | The `host-phys-bits-limit` property of the `-cpu` option can be used
|
---|
205 | to reduce the address space used by OVMF.
|
---|
206 |
|
---|
207 | Usage:
|
---|
208 | ```
|
---|
209 | qemu-system-x86_64 -cpu ${name},host-phys-bits=on,host-phys-bits-limit=42
|
---|
210 | ```
|
---|
211 |
|
---|
212 |
|
---|
213 | ## Platform: opt/org.tianocore/PagingLevel
|
---|
214 |
|
---|
215 | Configure the number of paging levels (4 or 5) OVMF will use. Four
|
---|
216 | paging levels are better for compatibility, not all OSes can handle
|
---|
217 | 5-level paging being active at ExitBootServices time. Five paging
|
---|
218 | levels are better for huge VMs, the address space managed by OVMF can
|
---|
219 | be larger.
|
---|
220 |
|
---|
221 | Default: Use 5-level paging in case more than 1TB of memory is
|
---|
222 | present, 4-level paging otherwise.
|
---|
223 |
|
---|
224 | Usage:
|
---|
225 | ```
|
---|
226 | qemu-system-x86_64 -fw_cfg name=opt/org.tianocore/PagingLevel,string=5
|
---|
227 | ```
|
---|
228 |
|
---|
229 |
|
---|
230 | ## Other: opt/org.tianocore/UsbStorageSupport
|
---|
231 |
|
---|
232 | This enables/disables the edk2 driver for USB storage devices.
|
---|
233 | Default: enabled. Usage:
|
---|
234 |
|
---|
235 | ```
|
---|
236 | qemu-system-x86_64 -fw_cfg name=opt/org.tianocore/UsbStorageSupport,string=yes
|
---|
237 | ```
|
---|
238 |
|
---|
239 |
|
---|