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.

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.

TLDR version:

  1. Set up Incus and Windows VM instance as per Simos guide
  2. Start and stop the Windows instance so folders in /run/incus/ are created
  3. Download Virtio ISO and copy it into /run/incus/win10vm
  4. Add cdrom to you VM with incus config set win10vm raw.qemu -- "-cdrom /run/incus/win10vm/virtio.iso"
  5. Start VM and run Windows installer.
  6. Install vioscsi.inf driver from your Virtio ISO. Path: /vioscsi/w10/amd64
  7. Finish installation.
  8. On desktop run virtio-win-guest-tools.exe from your Virtio ISO which will install all other missing Virtio drivers.
  9. 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 -- ""

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. Start the instance and then stop it so Incus creates folder in /run/incus/
    incus start win10vm
    incus stop win10vm --force
  3. Download recent Virtio ISO. Link are in this Github repo or you can download it here.
  4. Move your Virtio ISO into directory /run/incus/win10vm/ so QEMU can use it. If you dont you will get Failed to lock byte 100 error. You will need sudo to get there.
  5. Add Virtio ISO to VM as cdrom using QEMU flag.
    Just run incus config set win10vm raw.qemu -- "-cdrom /run/incus/win10vm/virtio.iso"
    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.
  6. 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.
  7. 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.
  8. 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.
  9. Go to /vioscsi/w10/amd64 and confirm. You should see vioscsi.inf driver available. Select it and press next.
  10. If everything is OK we continue as with normal Windows install. Activate Windows. Select edition. Accept terms. Custom install. Select drive.
  11. 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.
  12. Then Installing Windows will proceed.
  13. 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.
  14. 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.
  15. 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
  16. After all drivers are installed you just need to restart Windows.
  17. Thats all. Now everything should work correctly.
  18. 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.

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