Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # References:
- # - Davide Cavalca from the Asahi team on Matrix
- # - https://gist.github.com/Vogtinator/293c4f90c5e92838f7e72610725905fd
- # - https://www.tomshardware.com/how-to/bypass-windows-11-tpm-requirement
- # - https://www.tomshardware.com/how-to/install-windows-11-without-microsoft-account
- # - https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/Driver-installation
- # Download prerequisites
- # - virtio-win.iso
- # - From: https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/Driver-installation
- # - Win11_24H2_English_Arm64.iso
- # - From: https://www.microsoft.com/en-us/software-download/windows11arm64
- # Install prerequisites
- sudo dnf5 install qemu-system-aarch64 qemu-img
- # Create a disk image
- qemu-img create -f qcow2 win11.qcow2 64G
- # Install Windows
- performance_cores=$(awk '
- /^processor/ { proc=$3 }
- /^CPU part/ {
- if ($4 == "0x023" || $4 == "0x025" || $4 == "0x029" || $4 == "0x033" || $4 == "0x035" || $4 == "0x039")
- procs=procs ? procs","proc : proc
- } END { print procs }
- ' /proc/cpuinfo)
- taskset -c "$performance_cores" \
- qemu-system-aarch64 \
- -M virt \
- -cpu host \
- -accel kvm \
- -m 10G \
- -smp $(nproc) \
- -device ramfb \
- -bios /usr/share/edk2/aarch64/QEMU_EFI.fd \
- -device qemu-xhci \
- -device usb-kbd \
- -device usb-tablet \
- -drive file=Win11_24H2_English_Arm64.iso,media=cdrom,if=none,id=inst \
- -device usb-storage,drive=inst \
- -drive file=virtio-win-0.1.266.iso,media=cdrom,if=none,id=iso \
- -device usb-storage,drive=iso \
- -drive file=win11.qcow2,if=virtio \
- -nic user,model=virtio-net-pci,mac=2A:50:A7:4E:D9:C4
- ## Bypass TPM:
- # - During first installation screen, press Shift+Fn+F10
- # - Type regedit
- # - Navigate to HKEY_LOCAL_MACHINE\SYSTEM\Setup
- # - Create a new Key; name it LabConfig
- # - Under LabConfig, create two DWORD values BypassTPMCheck and BypassSecureBootCheck and BypassRAMCheck, and set each to 1
- # - Close regedit and cmd and continue the installation as normal
- ## Installation process:
- # - When asked for a product key, click on "I don't have a product key"
- # - Select any version, for example Pro
- # - At disk selection screen, click on Load Driver, Browse, then navigate to E:\viostor\w11\ARM64, then install that driver
- # - Then create a partition and choose partition 3
- # - Installation might get stuck at 42% or such for 30mins or so.. it's not stuck
- # - The VM may reboot a couple of times before installation completes.
- # - Complete the installation until it asks for network, click Install Driver then install NetKVM by going to E:\NetKVM\w11\ARM64
- # - The VM may reboot a couple of more times and installs updates.
- # - Next, install the virtio drivers
- # - Reboot and now can use the command below to boot the VM
- ## Skipping account creation during setup
- # - Once installation gets to the point where it requires an account
- # - Press Shift+Fn+F10 and type oobe\bypassnro and press Enter. The machine will reboot
- # - After the reboot, press Shift+Fn+F10 again and type ipconfig /release and hit enter, then continue the installation
- # - When asked about connecting to a network, click "I don't have Internet"
- # - Once we make it to Desktop, the next step is to install the guest tools. Navigate to E:\ and click on "virtio-win-guest-tools.exe"
- # - Use the installer to install all the drivers.
- # - At this point, the VM is ready to switch to the virtio drivers. Shutdown the VM.
- # - From this point on, you can use the following command to start the VM:
- performance_cores=$(awk '
- /^processor/ { proc=$3 }
- /^CPU part/ {
- if ($4 == "0x023" || $4 == "0x025" || $4 == "0x029" || $4 == "0x033" || $4 == "0x035" || $4 == "0x039")
- procs=procs ? procs","proc : proc
- } END { print procs }
- ' /proc/cpuinfo)
- taskset -c "$performance_cores" \
- qemu-system-aarch64 \
- -M virt \
- -cpu host \
- -accel kvm \
- -m 10G \
- -smp $(nproc) \
- -bios /usr/share/edk2/aarch64/QEMU_EFI.fd \
- -device qemu-xhci \
- -device usb-kbd \
- -device usb-tablet \
- -drive file=win11.qcow2,if=virtio \
- -nic user,model=virtio-net-pci \
- -object rng-random,filename=/dev/urandom,id=rng0 \
- -device virtio-rng-pci,rng=rng0 \
- -audio driver=pipewire,model=virtio \
- -device virtio-gpu-pci \
- -display sdl,gl=on \
- -device usb-kbd \
- -device usb-tablet
- ## Post installation notes:
- # - Maximize the QEMU window to get higher display resolution.
- # - Note that the first boot will take a while without a display. Just showing "Display output is not active". This is normal and goes away once the VM fully boots after a few mins.
- # - Feel free to attach more devices or pass peripherals through by adjusting the command line above. Check QEMU docs/forums for more details.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement