windows11 qemu notes

Recently, I experimented a bit with different Operating Systems. Maybe that could be an interesting post for the future. During my various tests, I wanted to keep working on projects, of course.

That means that I had at some point the need to setup a VM for Windows 11. I usually pick qemu, with virt-manager for these things as it is the most lightweight and I don’t need anything crazy. However, this process has become somewhat tedious recently, so I thought I’d document it here.

Windows 10 or 11 ?

The good news is that (for me at least !), I could install Windows 11 itself, without the installer whining about TPM 2.0 being a problem. That can sometimes be a problem with Virtual Machines, so I’m happy to report I didn’t have any.

That’s about the only thing that went seemlessly.

Setting up an internet connection

The current Linux flavor I am using isn’t important, but you have to understand that it relies on iptables instead of nftables. That makes libvirt capricious.

On my first attempt to install, it would not recognize any network card, and I simply could not connect to the internet. It didn’t matter if I picked bridged mode, some network I configured myself, or anything like that.

Here’s what we fixed it for me:

  1. First, set your config to rely on iptables, by updating the /etc/networkd/libvirtd.conf file:
firewall_backend = "iptables"
  1. Reset the default network:
sudo systemctl stop libvirtd.socket libvirtd-ro.socket libvirtd-admin.socket libvirtd
sudo virsh net-destroy default

sudo nft flush ruleset  # Clears corrupted nftables state

sudo systemctl start libvirtd
sudo virsh net-start default
  1. In your virt-manager GUI, check in the Overview tab (the little “I”) when you open your vm that you can set a Virtual Network Interface to your VM.

Here is the setting I had:

<interface type="network">
  <mac address="<REDACTED>"/> // This MAC address is redacted, don't blindly copy-paste !
  <source network="default"/>
  <model type="e1000e"/>
  <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>

That’s it ? Easy !

Wrong.

Now, you can proceed with the installation, but that doesn’t mean you get internet immediately.

The goal is to install virtio drivers on our guest machine. In theory, you should be able to have two CD-ROMs set up. Click on “Add Hardware” (bottom left), and choose the path to the second ISO, but it was not detected for me for some reason.

That means I had to go through an offline install, then install the drivers from the one CD-ROM that was detected.

Windows 11 offline install

When you get to the “Connect to the internet” screen. Press shift+F10. That will pop-up a cmd prompt, in which you must type the command:

OOBE\BYPASSNRO

It will reboot the machine, and you will be allowed to go on with an offline install. You can create an offline account, and go all the way to an installed Windows 11.

Finally, I mounted my second ISO, and went through the install.

VirtIO-FS for shared folders

If you need to pass files from host to guest, and vice-versa, you can use VirtIO-FS, which is designed exactly for that. The set up is much more simple.

Host setup (Linux)

  1. Install virtiofsd: sudo apt install virtiofsd

  2. XML Config (virsh edit <machine-name>):

<memoryBacking>
  <source type='memfd'/>
  <access mode='shared'/>
</memoryBacking>
<cpu mode='host-passthrough'>
  <numa>
    <cell id='0' cpus='0-7' memory='8388608' unit='KiB' memAccess='shared'/>
  </numa>
</cpu>

You can also enable shared memory access, in the “Memory” tab

  1. Finally, in the Hardware Tab, add Filesystem with:
    • Driver: virtiofs,
    • Target Tag: hostshare (any name is fine here),
    • Path on host machine where you want to put your files

Guest setup (Windows)

  1. Install WinFSP, you can just download it on the guest machine directly at this point.
  2. Make sure to install the virtio-win-guest-tools.exe

Now, every time you want to use the VirtIO-FS, do this:

  1. On Guest: win+R, type services.msc then press Enter
  2. Right click on VirtIO-FS service, and click “start”
  3. Voila ! You can open File Explorer, and you should see your file in Z:\<name you gave during config>

Now that it works, I’m happy to have a functionnal setup. Expect some releases in the coming months.

See you next time :)~

djnn.sh

offensive security & software engineering


how to setup windows 11 on qemu ? quick notes that might help someone else

2026-01-17