Incus: Add UI option to set image.os: Windows

Currently when creating VM from user uploaded ISO, Incus doesnt know the OS used. This is problem for Windows VMs where Incus should apply some Windows specific settings.

Incus determines OS by config option image.os. When this option contains word Windows then some specific settings are applied to make Windows run better.

Truenas should expose this option in UI so users can specify image.os: Windows.

Source: How to create instances - Incus documentation

When creating a Windows virtual machine, make sure to set the image.os property to something starting with Windows. Doing so will tell Incus to expect Windows to be running inside of the virtual machine and to tweak behavior accordingly.

This notably will cause:

  • Some unsupported virtual devices to be disabled
  • The RTC clock to be based on system local time rather than UTC
  • IOMMU handling to switch to an Intel IOMMU controller

Side note:
RTC clock change was implemented in Incus very recently so its not present in Incus version currently used by Truenas.

Once newer Incus version is available for Truenas and image.os option is implemented, it would also solve this issue about RTC clock in Windows. TrueNAS - Issues - iXsystems TrueNAS Jira

Implementation in Truenas should be careful not to overwrite image.os by default because for Linux images downloaded from linuxcontainers.org its already filled out correctly. This only needs to be option when needed as is case for Windows.

If you want to check Incus source about this just search for “Windows” in this source file: incus/internal/server/instance/drivers/driver_qemu.go at main · lxc/incus · GitHub

3 Likes

Yet another one I’ll upvote as soon as I get some of my votes back…

1 Like