1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:57:45 +00:00

Meta: Automatically enable WHPX when possible

This commit is contained in:
Gunnar Beutner 2021-08-04 01:39:14 +02:00 committed by Andreas Kling
parent 5445155dba
commit 723c89af67
2 changed files with 19 additions and 16 deletions

View file

@ -48,10 +48,6 @@ following command in an elevated PowerShell session: \
![WHPX Windows Feature](WHPX_Feature.png) ![WHPX Windows Feature](WHPX_Feature.png)
Set the `SERENITY_VIRT_TECH_ARG` environment variable in your WSL2 shell: \ You may have to reboot after enabling the WHPX feature.
`export SERENITY_VIRT_TECH_ARG="-accel whpx,kernel-irqchip=off"`
You might want to add those environment variables to your shell's configuration file, so that you don't have to set them Afterwards you can start the VM with `Meta/serenity.sh run` as usual.
manually each time you start a new shell.
Start the VM with `Meta/serenity.sh run` as usual.

View file

@ -60,16 +60,6 @@ fi
[ -z "$SERENITY_RAM_SIZE" ] && SERENITY_RAM_SIZE=512M [ -z "$SERENITY_RAM_SIZE" ] && SERENITY_RAM_SIZE=512M
if command -v wslpath >/dev/null; then
case "$SERENITY_QEMU_BIN" in
/mnt/?/*)
[ -z "$SERENITY_QEMU_CPU" ] && SERENITY_QEMU_CPU="max,vmx=off"
SERENITY_KERNEL_CMDLINE="$SERENITY_KERNEL_CMDLINE disable_virtio"
esac
fi
[ -z "$SERENITY_QEMU_CPU" ] && SERENITY_QEMU_CPU="max"
[ -z "$SERENITY_DISK_IMAGE" ] && { [ -z "$SERENITY_DISK_IMAGE" ] && {
if [ "$SERENITY_RUN" = qgrub ]; then if [ "$SERENITY_RUN" = qgrub ]; then
SERENITY_DISK_IMAGE="grub_disk_image" SERENITY_DISK_IMAGE="grub_disk_image"
@ -100,6 +90,23 @@ if [ "$installed_major_version" -lt "$SERENITY_QEMU_MIN_REQ_VERSION" ]; then
die die
fi fi
if command -v wslpath >/dev/null; then
case "$SERENITY_QEMU_BIN" in
/mnt/?/*)
if [ -z "$SERENITY_VIRT_TECH_ARG" ]; then
if [ "$installed_major_version" -gt 5 ]; then
SERENITY_VIRT_TECH_ARG="-accel whpx,kernel-irqchip=off -accel tcg"
else
SERENITY_VIRT_TECH_ARG="-accel whpx -accel tcg"
fi
fi
[ -z "$SERENITY_QEMU_CPU" ] && SERENITY_QEMU_CPU="max,vmx=off"
SERENITY_KERNEL_CMDLINE="$SERENITY_KERNEL_CMDLINE disable_virtio"
esac
fi
[ -z "$SERENITY_QEMU_CPU" ] && SERENITY_QEMU_CPU="max"
if [ -z "$SERENITY_SPICE" ] && "${SERENITY_QEMU_BIN}" -chardev help | grep -iq qemu-vdagent; then if [ -z "$SERENITY_SPICE" ] && "${SERENITY_QEMU_BIN}" -chardev help | grep -iq qemu-vdagent; then
SERENITY_SPICE_SERVER_CHARDEV="-chardev qemu-vdagent,clipboard=on,mouse=off,id=vdagent,name=vdagent" SERENITY_SPICE_SERVER_CHARDEV="-chardev qemu-vdagent,clipboard=on,mouse=off,id=vdagent,name=vdagent"
elif "${SERENITY_QEMU_BIN}" -chardev help | grep -iq spicevmc; then elif "${SERENITY_QEMU_BIN}" -chardev help | grep -iq spicevmc; then