Here I present multiple ways how to get Windows working on new Incus based VMs in Fangtooth with Virtio devices and drivers. Applies for RC.
Note: In RC type of drives is by default NVMe and it cant be changed in UI. You need to use TrueNAS shell and change io.bus
in Incus config by using command: sudo incus config edit <instance>
In release version this change can be made in UI.
A. New install
What can you do without Virtio drivers?
Currently your only non-virtio option is NVME drive. But Windows installer doesnt preload NVMe driver. This means that its not initially available and is loaded on demand from the installer ISO. This should be the case for Windows 10 and 11. But because the installer ISO itself is on NVMe drive its kinda Catch 22. You would need NVME driver in the first place to get into the ISO.
Current workaround is manually mounting the ISO as IDE CD-ROM. Then it will see itself and load NVMe driver. But even then your network connection wouldnt work because thats Virtio based and you would still need to install Virtio drivers.
For mounting Virtio ISO as IDE CD-ROM see part 3.
Use Distrobuilder.
This tool will inject Virtio drivers into your Windows ISO and you can install it directly on Virtio-SCSI drive.
Easiest way is to use Ubuntu and install Distrobuilder via Snap. I recommend using edge channel which is the latest version on GitHub.
sudo snap install distrobuilder --edge --classic
Snap package doesnt contain all needed runtime dependencies. For example on clean installed Ubuntu Server 24.04.2 LTS you need:
sudo apt install libwin-hivex-perl wimtools genisoimage
Once you have all dependencies you can repack your Windows ISO by:
sudo distrobuilder repack-windows --windows-arch=amd64 Windows10.iso Windows10-virtio.iso
You dont strictly need --windows-arch=amd64
, if omitted arch will be autodetected.
Now you can just use this repacked ISO and it will work on Virtio-SCSI drive.
For more info try reading Simos guide.
Alternatively you can try compiling Distrobuilder yourself.
Mount Virtio drivers ISO as IDE CD-ROM.
You can just read my guide on Linux Containers forum.
But specific steps for TrueNAS. Download Virtio drivers ISO.
You can use: wget https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso
Create VM like normal. Use Virtio-SCSI drive for both root disk and Windows installer ISO. Then in TrueNAS shell use sudo incus config edit <instance>
and append to raw.qemu
this config:
-drive file=/home/user/virtio-win.iso,media=cdrom,file.locking=off
Use your file path. Dont remove the VNC config thats already there otherwise VNC wont work.
Save and you can start VM, connect via VNC and begin Windows install. When it asks you for drivers you should see your mounted virtio-win cdrom available. The only critical driver to install is vioscsi
, others can be installed after finishing the Windows install. For example for Windows 10 and amd64 arch, the path is: D:/vioscsi/W10/amd64
. After loading it you will see you Virtio-SCSI drive available. If you need internet available during the install load NetKVM
driver. Then finish the install like normal.
Once its complete and you are on desktop go into your Virtio ISO which is still mounted as CD-ROM and run virtio-win-guest-tools.exe
. This will install all remaining Virtio drivers. After that restart the VM. Then in TrueNAS you can remove the raw.qemu
config we added before, but keep the VNC config.
B. Migration
Note: For this to work Windows needs to be installed on custom zvol and unused root disk in Incus has to be set as Virtio-SCSI.
Before switching to Fangtooth, download and install all Virtio drivers into your VM by running virtio-win-guest-tools.exe
.
Then upgrade to Fangtooth.
If you want to use NVMe drive for zvol thats all. It will work if your Windows supports it (Win10 and Win11).
If you want Virtio-SCSI you first have to boot the VM with NVMe drive. This will allow Windows to see root disk which is Virtio-SCSI and load Virtio drivers. You can then shutdown the VM, set custom zvol as Virtio-SCSI and boot. It should now work. Source.
If you cant use NVMe in part 4. you will have to manually set AHCI (SATA) drive and mount your zvol there.
Use sudo incus config edit <instance>
and delete your zvol disk if its there. Keep only root disk.
In raw.qemu
append:
-device ich9-ahci,id=ahci -drive file=/dev/zvol/v1/myzvol,format=raw,if=none,id=disk,file.locking=off -device ide-hd,drive=disk,bus=ahci.0
Use your file path. Dont remove VNC config thats already there.
You also have to add raw.apparmor
to Incus config otherwise it will fail on permissions. You can either be specific and check target of /dev/zvol/v1/myzvol
symlink and use that. That would look something like: raw.apparmor: /dev/zd16 rw,
Or just permit everything: raw.apparmor: /dev/* rw,
Either way, save and boot the VM. It will try to boot via PXE, you have to manually tell it to boot from AHCI disk. Best way is to prepare VNC software before starting VM and then connect quickly after. Repeatedly press Esc while in VNC waiting for first lines of UEFI appear. You should get into UEFI manager. Go into Boot manager and select UEFI QEMU HARDDISK
Yes, there are two, one of them is your AHCI and one of them root disk. But root disk wont do anything. AHCI is usually the last one on bottom. So select and boot into your AHCI drive. After that it should be the same as in part 4. So shutdown, switch to Virtio-SCSI and it should work. Dont forget to delete configs we added above.
If you didnt install Virtio drivers before migration.
If your Windows can boot on NVMe, then use that, but also mount Virtio ISO as IDE CD-ROM and install drivers from there. See part 3.
I you cant use NVMe you have to also set AHCI drive. See part 5.
Tip: If you have problem with selecting device to boot from you can try manually selecting boot disk by repeatedly pressing Esc during UEFI boot. This should get you into UEFI menu where you can use Boot manager.
Any notes and corrections of possible mistakes in my guide are welcome.