Specifics of running Windows VM in Incus

So I finally figured it out. I had to move virtio.iso to /run/incus/instance for QEMU to be able to use it.
Edit: Better solution is using file.locking=off so it doesnt attempt to lock the file. We will use -drive flag instead of -cdrom flag.

So here is guide how you can install Windows in Incus without repacking it with Distrobuilder. I tried it only with Windows 10. In this guide I will call my Windows VM instance win10vm.

Note for peple using TrueNAS:
Truenas already uses raw.qemu for setting VNC. incus config set will overwrite it and VNC will stop working.
Instead use incus config edit and manually add the -drive flag while also keeping -vnc flag.

TLDR version:

  1. Set up Incus and Windows VM instance as per Simos guide
  2. Download Virtio ISO.
  3. Add cdrom to you VM with incus config set win10vm raw.qemu -- "-drive file=/home/user/virtio.iso,media=cdrom,file.locking=off"
  4. Start VM and run Windows installer.
  5. Install vioscsi.inf driver from your Virtio ISO. Path: /vioscsi/w10/amd64
  6. Finish installation.
  7. On desktop run virtio-win-guest-tools.exe from your Virtio ISO which will install all other missing Virtio drivers.
  8. Finally, remove the Virtio ISO cdrom from Incus config to prevent potential future problems. First stop the VM and then you can use incus config set win10vm raw.qemu -- "" (Or incus config edit)

Detailed version:

  1. Download your Windows ISO. Install and prepare Incus. Configure your Windows VM instance according to Simos guide. Dont forget to add your Windows ISO into the instance.
  2. Download recent Virtio ISO. Link are in this Github repo or you can download it here.
  3. Add Virtio ISO to VM as cdrom using QEMU flag.
    Just run incus config set win10vm raw.qemu -- "-drive file=/home/user/virtio.iso,media=cdrom,file.locking=off"
    Alternatively you can edit Incus config file with incus config edit win10vm
    This mounts Virtio ISO as cdrom IDE device into your QEMU instance. We need to mount it as IDE (or SATA) device so Windows installer can read it.
  4. Now you can start the VM with vga console: incus start win10vm --console=vga and boot into cdrom by pressing any button during boot sequence.
  5. When I tried this in another VM (nested VM) mouse didnt work (likely because of missing virtio drivers) and I had to use keyboard unitil I installed all drivers at the end. On bare metal mouse worked.
  6. After clicking Install now you will see message A media driver your computer needs is missing. This is because without repacking our Windows ISO dont have Virtio drivers which are needed to see drives which are virtio-based in Incus instances. But we have those drivers in our Virtio ISO. So select Browse and navigate to CD Drive named virtio-win.
  7. Go to /vioscsi/w10/amd64 and confirm. You should see vioscsi.inf driver available. Select it and press next.
  8. If everything is OK we continue as with normal Windows install. Activate Windows. Select edition. Accept terms. Custom install. Select drive.
  9. In Select drive screen you can optionally load additional drivers with Load driver option. But it’s easier to just continue with the installation and install missing virtio drivers all at once using its own installer.
  10. Then Installing Windows will proceed.
  11. After that Windows will restart and your VGA console will close. Reconnect with incus console win10vm --type=vga Maybe it will restart/close multiple times.
  12. When we get into Windows configuration it’s possible network will not work because of missing drivers. This happened to me in nested VM. I dont know about bare metal install.
  13. Once configuration is finished go to your Virtio ISO (This PC → CD drive virtio-win) and install all other virtio drivers by running virtio-win-guest-tools.exe
  14. After all drivers are installed you just need to restart Windows.
  15. Thats all. Now everything should work correctly.
  16. After you’re done remove the Virtio ISO cdrom from Incus config to prevent potential future problems. First stop the VM and then you can use incus config set win10vm raw.qemu -- "" which will delete raw.qemu config. (Or use incus config edit)

Notes:
This is based on Proxmox guide
Maybe there are other ways to make virtio.iso available to QEMU but I dont know.
Hope this helps someone.
If someone can test this I will be grateful. I hope I didnt make any mistakes.

1 Like