summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Nelson <peter@peterdn.com>2020-08-14 13:19:30 +0100
committerAndreas Kling <kling@serenityos.org>2020-08-14 15:09:59 +0200
commite36fce9cfc68711e8bb0c7f59d8d176032a7301e (patch)
tree7b71a115af2182d3ff16e7c288ad1df3f77ead7e
parentd00df4e721cb95828ff3fb96f52a7906cadf7013 (diff)
downloadserenity-e36fce9cfc68711e8bb0c7f59d8d176032a7301e.zip
Docs: explain how to enable QEMU hardware acceleration on Windows
Describes how to enable QEMU hardware acceleration on Windows using the Windows Hypervisor Platform feature.
-rw-r--r--Documentation/NotesOnWSL.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/Documentation/NotesOnWSL.md b/Documentation/NotesOnWSL.md
index b23f665078..a138ef0164 100644
--- a/Documentation/NotesOnWSL.md
+++ b/Documentation/NotesOnWSL.md
@@ -45,6 +45,25 @@ By default this will be located at `/mnt/c/Program Files/qemu/qemu-system-i386.e
- `make run` as usual.
+#### Hardware acceleration
+
+The steps above will run QEMU in software virtualisation mode, which is very slow.
+QEMU supports hardware acceleration on Windows via the [Windows Hypervisor Platform](https://docs.microsoft.com/en-us/virtualization/api/) (WHPX), a user-mode virtualisation API that can be used alongside Hyper-V.
+This is important to note as WSL2 itself runs on top of Hyper-V, which conflicts with other acceleration technologies such as Intel HAXM.
+
+To run SerenityOS in a WHPX-enabled QEMU VM:
+
+- If you have not already done so, enable Windows Hypervisor Platform, either using "Turn Windows features on or off", or by running the following command in an elevated PowerShell session: \
+`dism /Online /Enable-Feature /All /FeatureName:HypervisorPlatform`
+
+- Specify QEMU acceleration option: \
+`export SERENITY_EXTRA_QEMU_ARGS="-accel whpx"`
+
+- Disable Virtual Machine eXtensions on the vCPU, otherwise some versions of QEMU will crash out with a "WHPX: Unexpected VP exit code 4" error: \
+`export SERENITY_QEMU_CPU="max,vmx=off"`
+
+- `make run` as usual.
+
### Note on filesystems
WSL2 filesystem performance for IO heavy tasks (such as compiling a large C++ project) on the host Windows filesystem is terrible.