Skip to content

Conversation

stgraber
Copy link
Member

This is the initial support for running an Incus agent on Windows.

Because there is currently no signed VirtIO vsock drivers for Windows, nor VirtIO vsock support for Go on Windows, the agent is currently being accessed over HTTPS.

This will only work in environments where Incus is aware of the IP address(es) of the Windows system and where the Incus host(s) can connect to that address on port tcp/8443.

We'll keep an eye on the ongoing work on the VirtIO vsock driver for Windows and once a signed build is readily available, will push to get support within Go so we can move away from using HTTPS for this and use the same transport regardless of guest operating systems.

As far as what's supported at this stage:

  • incus exec, though not in fully interactive mode (you must pass -T)
  • incus file operations
  • incus info to get guest OS details

At this point, system metrics are being reported by QEMU rather than the agent.

This pull request also adds extra Github build steps to produce the needed agent binary on both Linux and Windows.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This moves all OS specific logic to a new os_OSNAME.go file.

It also introduces a basic placeholder for Windows, allowing the agent
to be built on Windows, even if most features will return "Not implemented"
at this stage.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
@stgraber stgraber force-pushed the agent branch 2 times, most recently from 57957ab to 4c9a1c1 Compare April 28, 2025 06:11
When dealing with a Windows guest, attempt to connect to the agent over
HTTPS rather than vsock.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
@stgraber
Copy link
Member Author

With this change merged, any Incus package shipping with the static Windows agent (incus-agent.windows.x86_64) will be able to provide a suitable agent drive to Windows.

incus config device add win11 agent disk source=agent:config will generate and attach such a drive.

On the Windows side, simply run incus-agent.exe from that drive, either directly or by manually adding it in as a service.

@hallyn hallyn merged commit 863f1c8 into lxc:main Apr 28, 2025
38 checks passed
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jun 12, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [lxc/incus](https://github.com/lxc/incus) | minor | `v6.12.0` -> `v6.13.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>lxc/incus (lxc/incus)</summary>

### [`v6.13.0`](https://github.com/lxc/incus/releases/tag/v6.13.0): Incus 6.13

[Compare Source](lxc/incus@v6.12.0...v6.13.0)

### Announcement

https://discuss.linuxcontainers.org/t/incus-6-13-has-been-released/23899

#### What's Changed

-   Add server side filtering for `incus network list` by [@&#8203;Abdomash](https://github.com/Abdomash) in lxc/incus#1989
-   doc: Fix default value of ipv4.dhcp.gateway to IPv4 address by [@&#8203;hnakamur](https://github.com/hnakamur) in lxc/incus#1991
-   doc: Fix default value of ipv6.routes network_bridge by [@&#8203;hnakamur](https://github.com/hnakamur) in lxc/incus#1992
-   doc: Fix Debian 12 nickname by [@&#8203;hnakamur](https://github.com/hnakamur) in lxc/incus#1993
-   Fix issues with nftables and address sets by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#1995
-   incusd/dns: fix typo in error log by [@&#8203;gwenya](https://github.com/gwenya) in lxc/incus#1998
-   Port pci to gendoc by [@&#8203;DinglyCoder](https://github.com/DinglyCoder) in lxc/incus#1996
-   rename reverters from revert to reverter to not conflict with the package by [@&#8203;The127](https://github.com/The127) in lxc/incus#2000
-   incusd: Refactor error checks with errors.is and errors.As by [@&#8203;The127](https://github.com/The127) in lxc/incus#2002
-   Rename vars using builtin names by [@&#8203;The127](https://github.com/The127) in lxc/incus#2006
-   incusd: Refactor getting heartbeat mode name into a function by [@&#8203;The127](https://github.com/The127) in lxc/incus#2005
-   Unify receiver types  by [@&#8203;The127](https://github.com/The127) in lxc/incus#2004
-   incusd: Refactor unused parameters by [@&#8203;The127](https://github.com/The127) in lxc/incus#2001
-   incusd/firewall/nftables: Fix handling of address set deletion by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2012
-   Add server-side filtering for incus storage bucket list  by [@&#8203;allisoncchen](https://github.com/allisoncchen) in lxc/incus#2008
-   Add support for running the Incus agent on Windows by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2014
-   incusd/network/ovn: Wait up to 10s for OVN northd to allocate an IP by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2024
-   Refactor unnecessary if checks by [@&#8203;The127](https://github.com/The127) in lxc/incus#2017
-   incusd: refactor process kill error being ignored by [@&#8203;The127](https://github.com/The127) in lxc/incus#2018
-   incusd/instance: fix device finding logic by [@&#8203;The127](https://github.com/The127) in lxc/incus#2019
-   incusd: remove unreachable code in api internal by [@&#8203;The127](https://github.com/The127) in lxc/incus#2016
-   Rewrite legacy QEMU config code by [@&#8203;bensmrs](https://github.com/bensmrs) in lxc/incus#2011
-   incus: refactor admin_init.go config initialization by [@&#8203;The127](https://github.com/The127) in lxc/incus#2023
-   Extend incus-migrate to support uploading filesystems and disks as custom volumes by [@&#8203;presztak](https://github.com/presztak) in lxc/incus#2022
-   Add server-side filtering for `incus project list` by [@&#8203;rahafjrw](https://github.com/rahafjrw) in lxc/incus#2015
-   incusd/network/bridge: Add missing line breaks by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2029
-   Port ovn network documentation to gendoc  by [@&#8203;lahariguduru](https://github.com/lahariguduru) in lxc/incus#2027
-   Remove gopkg.in/tomb.v2 dependency by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2031
-   Update gendoc for network_physical and network_bridge by [@&#8203;janetkimmm](https://github.com/janetkimmm) in lxc/incus#2030
-   incusd/instance/qemu: Don't allow hotplug when at maxmem by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2033
-   incusd/server/device/nic_routed: Added host_tables by [@&#8203;AbhinavTiruvee](https://github.com/AbhinavTiruvee) in lxc/incus#2009
-   incusd/storage: Fix migration error due to rounding by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2041
-   incusd: add missing err handling for transactions by [@&#8203;The127](https://github.com/The127) in lxc/incus#2040
-   Rename result of `mux.NewRouter()` so they dont collide with the mux package by [@&#8203;The127](https://github.com/The127) in lxc/incus#2037
-   Rename instances of sha256.New() so they dont collide with the package name by [@&#8203;The127](https://github.com/The127) in lxc/incus#2038
-   incusd/storage/zfs: Optimize snapshot deletion by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2043
-   Missing case statements for iota constants by [@&#8203;The127](https://github.com/The127) in lxc/incus#2039
-   incusd: Refactor error list by [@&#8203;The127](https://github.com/The127) in lxc/incus#2026
-   Remove redundant map size by [@&#8203;The127](https://github.com/The127) in lxc/incus#2053
-   internal/dnsutil: remove unused package dnsutil by [@&#8203;The127](https://github.com/The127) in lxc/incus#2046
-   Rework QEMU config override logic by [@&#8203;bensmrs](https://github.com/bensmrs) in lxc/incus#2048
-   tools: Add govulncheck by [@&#8203;breml](https://github.com/breml) in lxc/incus#2050
-   incusd/dnsmasq: refactor DHCPValidIP condition checks by [@&#8203;The127](https://github.com/The127) in lxc/incus#2020
-   incusd: rename instanceActionToOptype to instanceActionToOpType by [@&#8203;The127](https://github.com/The127) in lxc/incus#2047
-   internal/iprange: add tests for the iprange.Range struct by [@&#8203;The127](https://github.com/The127) in lxc/incus#2045
-   Port macvlan network documentation to gendoc by [@&#8203;kmxtn](https://github.com/kmxtn) in lxc/incus#2042
-   incusd/certificates: Properly handle PEM encoding on POST by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2056
-   lint: Codespell exclude generated docs by [@&#8203;breml](https://github.com/breml) in lxc/incus#2051
-   incusd/instance/qemu: Don't allow QEMU RSS to exceed memory limit by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2058
-   Add server-side filtering for `incus config trust list` by [@&#8203;allisoncchen](https://github.com/allisoncchen) in lxc/incus#2057
-   Add support for additional disks to `incus-migrate` by [@&#8203;presztak](https://github.com/presztak) in lxc/incus#2064
-   Restart builtin DNS server on failure by [@&#8203;gwenya](https://github.com/gwenya) in lxc/incus#2062
-   Port sriov network documentation to gendoc by [@&#8203;cory-chang](https://github.com/cory-chang) in lxc/incus#2059
-   Db generate fixes by [@&#8203;masnax](https://github.com/masnax) in lxc/incus#2066
-   Add support for split image publishing by [@&#8203;saahirN](https://github.com/saahirN) in lxc/incus#2013
-   Added CLI Configuration Option for Default Table Layout by [@&#8203;arojas2003](https://github.com/arojas2003) in lxc/incus#2044
-   incusd/instance/qemu: Limit memory hotplug slots to 8 by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2065
-   incusd/device/sriov: Handle cards without configurable spoof checking by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2069
-   incusd/firewall/nftables: disable UDP checksum validation for packets on bridged network by [@&#8203;MaheshPunjabi](https://github.com/MaheshPunjabi) in lxc/incus#2076
-   Use snake case entity names for ID column names by [@&#8203;masnax](https://github.com/masnax) in lxc/incus#2079
-   Allow providing certificates as part of preseed data [#&#8203;1804](lxc/incus#1804) by [@&#8203;DinglyCoder](https://github.com/DinglyCoder) in lxc/incus#2078
-   Porting `network_acls` to database generator by [@&#8203;Aryan470](https://github.com/Aryan470) in lxc/incus#2035
-   client: Fix required extension for GetNetworkAddressSetsAllProjects by [@&#8203;breml](https://github.com/breml) in lxc/incus#2082
-   Move cluster resource caching to point of consumption  by [@&#8203;janetkimmm](https://github.com/janetkimmm) in lxc/incus#2072
-   Implement stateful DHCPv6 by [@&#8203;rahafjrw](https://github.com/rahafjrw) in lxc/incus#2060
-   Adding support for incus storage volume mount by [@&#8203;Aryan470](https://github.com/Aryan470) in lxc/incus#2071
-   incus/remote: Add "get-client-certificate" and "get-client-token" by [@&#8203;stoven2k17](https://github.com/stoven2k17) in lxc/incus#2088
-   Ban the use of LLMs and AI assistants/agents by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2089
-   Add support for .OVA import by [@&#8203;presztak](https://github.com/presztak) in lxc/incus#2092
-   Add common aliases for add/create remove/delete/rm in the CLI by [@&#8203;joecwilson](https://github.com/joecwilson) in lxc/incus#1955
-   Improve handling of Windows agent by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2103
-   Include OS metrics on Incus OS by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2104
-   incusd/instance/lxc: Refactor inheritInitPidFd by [@&#8203;gwenya](https://github.com/gwenya) in lxc/incus#2106
-   Removed useless else in Makefile by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2115
-   incusd/main_forknet: Don't touch resolv.conf when no leases by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2118
-   incusd/storage/ceph: Fix parent tracking for VMs by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2119
-   Fix Github test failures by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2120
-   incus: Simplify code by using modern constructs by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2111
-   internal: Simplify code by using modern constructs by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2113
-   Simplify code by using modern constructs by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2112
-   Simplify code by using modern constructs by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2110
-   Translations update from Hosted Weblate by [@&#8203;weblate](https://github.com/weblate) in lxc/incus#2123
-   incusd/instances: Tweak storage migration errors by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2131
-   Add +invtsc to cpu extensions ensure tsc as current clocksource by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2127
-   incusd/instance: Fix incorrect cluster.Connect call by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2134
-   incusd/instances_post: Prevent pointless device overrides by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2133
-   Use the umoci Go package instead of the command by [@&#8203;presztak](https://github.com/presztak) in lxc/incus#1880
-   incusd/forkproxy: join the correct mntns for listen by [@&#8203;cyphar](https://github.com/cyphar) in lxc/incus#2136
-   Fix use of format string functions with constant string by [@&#8203;NathanChase22](https://github.com/NathanChase22) in lxc/incus#2107
-   incus-migrate: prompt for cluster target by [@&#8203;MaheshPunjabi](https://github.com/MaheshPunjabi) in lxc/incus#2124
-   Use our own QMP monitor by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2105
-   incusd/instance/qmp: remove weird qmp bug workaround by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2139
-   Make sure limits.memory <= root,size.state by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2138
-   incusd/instance/qmp: Refactor qmpWriteMsg by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2140
-   Allow overriding the external address (NAT) for OVN NICs by [@&#8203;OGCbn](https://github.com/OGCbn) in lxc/incus#2090
-   Static Binding of OVN uplink gateway MAC by [@&#8203;davidbockelman](https://github.com/davidbockelman) in lxc/incus#2091
-   incusd: fix some trivial typos by [@&#8203;mrstux](https://github.com/mrstux) in lxc/incus#2147
-   incusd/storage: Fix squashfs unpacking to NFS destinations by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2149
-   Remove pending cluster member on join failure by [@&#8203;presztak](https://github.com/presztak) in lxc/incus#2145
-   incusd/instance/qmp: associated request/reply with command id by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2142
-   RTC base enhancement via rtc change event handling by [@&#8203;nanjj](https://github.com/nanjj) in lxc/incus#2141
-   incusd/storage/linstor: Prevent mounting unreachable pools by [@&#8203;bensmrs](https://github.com/bensmrs) in lxc/incus#2101
-   Return empty slice instead of nil when no storage pool is present by [@&#8203;presztak](https://github.com/presztak) in lxc/incus#2152
-   Clear the "volatile.cpu.nodes" if needed by [@&#8203;presztak](https://github.com/presztak) in lxc/incus#2153
-   vscode: Add VSCode launch.json for incusd "Run and Debug" functionality by [@&#8203;mrstux](https://github.com/mrstux) in lxc/incus#2155
-   Add support for specifying username in CephFs commands by [@&#8203;presztak](https://github.com/presztak) in lxc/incus#2154
-   Port network_load_balancers to database generator by [@&#8203;davidbockelman](https://github.com/davidbockelman) in lxc/incus#2068
-   Porting network zone database functions to database generator. by [@&#8203;irhndt](https://github.com/irhndt) in lxc/incus#2108
-   Allow updating root disk size and root io.bus simultaneously by [@&#8203;presztak](https://github.com/presztak) in lxc/incus#2158
-   Fix daily test regressions by [@&#8203;stgraber](https://github.com/stgraber) in lxc/incus#2162

#### New Contributors

-   [@&#8203;DinglyCoder](https://github.com/DinglyCoder) made their first contribution in lxc/incus#1996
-   [@&#8203;The127](https://github.com/The127) made their first contribution in lxc/incus#2000
-   [@&#8203;allisoncchen](https://github.com/allisoncchen) made their first contribution in lxc/incus#2008
-   [@&#8203;lahariguduru](https://github.com/lahariguduru) made their first contribution in lxc/incus#2027
-   [@&#8203;janetkimmm](https://github.com/janetkimmm) made their first contribution in lxc/incus#2030
-   [@&#8203;cory-chang](https://github.com/cory-chang) made their first contribution in lxc/incus#2059
-   [@&#8203;arojas2003](https://github.com/arojas2003) made their first contribution in lxc/incus#2044
-   [@&#8203;Aryan470](https://github.com/Aryan470) made their first contribution in lxc/incus#2035
-   [@&#8203;stoven2k17](https://github.com/stoven2k17) made their first contribution in lxc/incus#2088
-   [@&#8203;OGCbn](https://github.com/OGCbn) made their first contribution in lxc/incus#2090
-   [@&#8203;davidbockelman](https://github.com/davidbockelman) made their first contribution in lxc/incus#2091

**Full Changelog**: lxc/incus@v6.12.0...v6.13.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC41MC4wIiwidXBkYXRlZEluVmVyIjoiNDAuNTAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants