Incus Agent trouble on Windows Server 2022 core

I created a basic install of server 2022 core, installed incus-agent, verified it was working. Then I’d like to use this as a ready to go image so I did a generalize sysprep. Created an image. When using the image to start up a vm everything starts. incus-agent starts up and is running. It’s listening on port 8443. I verified connectivity to the agent from the host using nc -v ipaddress 8443 and it gets a connection but incus exec … still reports “Error: VM agent isn’t currently running”

Hi, not that this is going to help you at the mo, but I’ll try this our on my WS2022 Standard Desktop image, as I don’t use Core. Also I need to create a WS2025 image since WS2022 EOS is in a few months.

Will be interesting to see if this works with sysprep and then I can try use the agent with Ansible instead of WinRM.

Listening on port 8443 would suggest an older Incus or Incus agent.
We’ve moved to using vsock for the Windows agent too these days.

1 Like

I’ll have to revisit this next week. The agent keeps removing itself on Windows reboot so the Windows Incus Agent Service does not start.

Seems the install also ejects the vCDROM too soon and nothing is written to c:\programdata but the c:\program files\incus-agent\incus-agent-setup.ps1 is there but it cannot find the source data cause of the ejection. If I reattach the vCDROM and rerun incus-agent-setup.ps1 then it installs to c:\programdata\incus-agent\ but then deletes again on reboot.

The servers are running Incus 6.22 so I can do an update next week and see if it improves with 6.23 but I don’t see any fixes for this in it’s fix list.

I’m running 6.21 on alpinelinux 3.23, I’m using the distro’s packages so I’m stuck with what’s available. It would be nice to figure out what’s causing the problem so I could work around it. I have another server 2022 that’s working just fine, it has the incus-agent installed after the sysprep instead of before.

Edit: Tiny step forward. After I created the vm instance from the sysprepped image I had to add config image.os=windows. Now I get the error ‘Error: Failed to connect to the agent’

I don’t know what changed, but it’s working now.