Skip to content

Commit 420c954

Browse files
committed
Add Windows 11 VM Docs to the guide
1 parent 0301b32 commit 420c954

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

docs/sw/windows-11-vm.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: How to create a Windows 11 VM
3+
---
4+
5+
### Introduction
6+
Here's a simple guide to install Windows 11 on Fedora Asahi Remix!
7+
This is going over how to install, configure, and manage your own instance of Windows 11 if you ever need anything from windows besides having to switch hardware or use bare metal windows machines.
8+
Credits to: aykevl and Davide Calvaca
9+
10+
### Steps
11+
1. Install QEMU, via the command `dnf install qemu` or if you want a more generalized install, do `dnf install @virtualization` which installs all the necessary requirements to have a virtual machine setup but that is out of scope for this guide.
12+
2. Create a new directory on your desktop or wherever, naming it to whatever you want, i.e. let's say, `windows11` using `mkdir windows11 via an appropriate terminal application or right clicking and making a directory on your desktop.
13+
3. Go into that directory with `cd windows11`
14+
4. Download a Windows 11 ISO, appropriately the Windows 11 IoT build for ARM64 [here](https://www.microsoft.com/en-us/evalcenter/download-windows-11-iot-enterprise-ltsc-eval). Feel free to rename it to a good name like `windows-11.iso` using `mv` in your appropriate terminal application of choice.
15+
5. Along with that ISO, it would be good to use the virtio-drivers to better improve performance of the machine. Feel free to download it [here](https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/Driver-installation) and renaming it appropriately to `win11-virtio.iso`.
16+
6. Create a virtual disk for your Windows 11 VM by using the command: `qemu-img create -f qcow2 win11.qcow2 25G` and adjusting it to how much disk space you would want, 25GB is a placeholder.
17+
7. Here we are going to create a startup script for our Windows 11 VM. Create a file named `win11.sh` and make sure it is executable with `chmod +x win11.sh`. The contents should be:
18+
``` {.md .copy}
19+
#!/bin/sh
20+
21+
performance_cores=$(awk '
22+
/^processor/ { proc=$3 }
23+
/^CPU part/ {
24+
if ($4 == "0x023" || $4 == "0x025" || $4 == "0x029" || $4 == "0x033" || $4 == "0x035" || $4 == "0x039")
25+
procs=procs ? procs","proc : proc
26+
} END { print procs }
27+
' /proc/cpuinfo)
28+
29+
taskset -c "$performance_cores" \
30+
qemu-system-aarch64 \
31+
-display sdl,gl=on \
32+
-cpu host \
33+
-M virt \
34+
-enable-kvm \
35+
-m 2G \
36+
-smp 2 \
37+
-bios /usr/share/edk2/aarch64/QEMU_EFI.fd \
38+
-hda win11.qcow2 \
39+
-device qemu-xhci \
40+
-device ramfb \
41+
-device usb-storage,drive=install \
42+
-drive if=none,id=install,format=raw,media=cdrom,file=windows-11-iot.iso \
43+
-device usb-storage,drive=virtio-drivers \
44+
-drive if=none,id=virtio-drivers,format=raw,media=cdrom,file=virtio-win.iso \
45+
-object rng-random,filename=/dev/urandom,id=rng0 \
46+
-device virtio-rng-pci,rng=rng0 \
47+
-audio driver=pipewire,model=virtio \
48+
-device usb-kbd \
49+
-device usb-tablet \
50+
-nic user,model=virtio-net-pci
51+
```
52+
!!! note
53+
You may have to adjust the file arguments if you have named it something different than windows-11-iot.iso and virtio-win.iso
54+
55+
8. Now run `./win11.sh`. A QEMU window pops up. After going through some boot screens, it should show “Press any key to boot from CD or DVD…”. Press any key to boot Windows (quickly, because otherwise you’ll end up in a UEFI console).
56+
9. Windows should now be booting, and you should end up in the Windows 11 setup. Most of this is straightforward, but there is one thing to be aware of:
57+
In the “Select location to install Windows 11”, no drives are shown. Fix this by clicking “Load Driver”, “Browse”, expand the virtio-win drive, and select viostor → w11 → ARM64. Click OK. Select the “Red Hat VirtIO SCSI controller” that appears, and click install.
58+
10. During the installation, the VM will reboot a few times. Don’t do anything, just let it happen.
59+
11. After installation you’ll end up in the first boot wizard (to configure location, keyboard, etc).
60+
In the “Let’s connect you to a network”, click “Install driver”, open the virtio-win drive, navigate to NetKVM → w11 → ARM64, and click “Select folder”. Wait a few seconds, and the network adapter should appear. You can now continue.
61+
12. After completing the installation, you should have a working Windows 11 install!
62+
63+
# Post Installation
64+
Shut down the VM as usual to not make Windows scared (don’t just exit the win11.sh script). To boot it again, simply run the ./win11.sh script again.
65+
66+
After installation, you can remove the two ISOs and remove the following 4 lines from the win11.sh script:
67+
``` md
68+
-device usb-storage,drive=install \
69+
-drive if=none,id=install,format=raw,media=cdrom,file=windows-11-iot.iso \
70+
-device usb-storage,drive=virtio-drivers \
71+
-drive if=none,id=virtio-drivers,format=raw,media=cdrom,file=virtio-win.iso \
72+
```
73+
74+
# SSH Steps
75+
1. Modify the QEMU command line, replace `-nic user,model=virtio-net-pci` with `-device virtio-net-pci,netdev=net0 -netdev user,id=net0,hostfwd=tcp::5555-:22` to forward port 5555 to port 22 in the VM (you can pick another port if you like).
76+
2. Start “Optional Features”, click “View features”, search for OpenSSH Server, and install it. (This takes a while).
77+
3. Allow port 22 through the Windows firewall, see [this StackOverflow post](https://stackoverflow.com/questions/68594235/allow-ssh-protocol-through-win-10-firewall).
78+
4. Start “Services”, look for “OpenSSH SSH Server”, and start it (right click → start). Also, right click on it, go to properties, and set the startup type to automatic so it always starts at boot.
79+
5. Now you can SSH into your Windows system using ssh yourusername@localhost -p 5555!
80+
6. If you want to log into the system using public-key authentication, you can put the public key in C:\ProgramData\ssh\administrators_authorized_keys (assuming your account is an administrator account).

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ nav:
2828
- Fedora Asahi Remix Documentation <i class="fa-solid fa-arrow-up-right-from-square"></i>: https://docs.fedoraproject.org/en-US/fedora-asahi-remix/
2929
- Broken Software: sw/broken-software.md
3030
- Partitioning Cheatsheet: sw/partitioning-cheatsheet.md
31+
- Windows 11 VM setup guide: sw/windows-11-vm.md
3132
- For developers:
3233
- Yaks in need of shaving (HELP WANTED!): project/help-wanted.md
3334
- Tethered Boot Setup (For Developers): sw/tethered-boot.md

0 commit comments

Comments
 (0)