From cc87bf46c13560dc106ce334f21957b8d951ab8c Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 10 Jul 2021 14:12:40 +0200 Subject: [PATCH] Documentation+Meta: Automatically set vmx=off on Windows --- Documentation/BuildInstructionsWindows.md | 3 --- Meta/run.sh | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Documentation/BuildInstructionsWindows.md b/Documentation/BuildInstructionsWindows.md index 38225a9ea8..812ff9f73d 100644 --- a/Documentation/BuildInstructionsWindows.md +++ b/Documentation/BuildInstructionsWindows.md @@ -51,9 +51,6 @@ To run SerenityOS in a WHPX-enabled QEMU VM: - Specify QEMU acceleration option: \ `export SERENITY_VIRT_TECH_ARG="-accel whpx,kernel-irqchip=off"` -- 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"` - - Start the VM with `Meta/serenity.sh run` as usual. ### Known issues with WHPX diff --git a/Meta/run.sh b/Meta/run.sh index 371b707498..3f1696eea9 100755 --- a/Meta/run.sh +++ b/Meta/run.sh @@ -49,6 +49,13 @@ fi [ -z "$SERENITY_RAM_SIZE" ] && SERENITY_RAM_SIZE=512M +if command -v wslpath >/dev/null; then + case "$SERENITY_QEMU_BIN" in + /mnt/c/*) + [ -z "$SERENITY_QEMU_CPU" ] && SERENITY_QEMU_CPU="max,vmx=off" + esac +fi + [ -z "$SERENITY_QEMU_CPU" ] && SERENITY_QEMU_CPU="max" [ -z "$SERENITY_DISK_IMAGE" ] && {