VM agent isn't currently running

I am fairly sure this worked a few weeks ago. I tried the suggested steps described in the earlier release notes, here, but I’m getting no IPv4 address assigned. Trying to open a shell gives: VM agent isn’t currently running

Here is a session at Linux Containers - Incus - Try it online

ubuntu@tryit:~$ incus profile create vm-agent
Profile vm-agent created
ubuntu@tryit:~$ incus profile device add vm-agent agent disk source=agent:config
Device agent added to vm-agent
ubuntu@tryit:~$ incus launch images:centos/9-Stream c9 --vm -p default -p vm-agent
Launching c9
ubuntu@tryit:~$ incus ls                      
+------+---------+------+-----------------------------------------------+-----------------+-----------+
| NAME |  STATE  | IPV4 |                     IPV6                      |      TYPE       | SNAPSHOTS |
+------+---------+------+-----------------------------------------------+-----------------+-----------+
| c9   | RUNNING |      | fd42:c406:43f6:c399:216:3eff:fed5:db42 (eth0) | VIRTUAL-MACHINE | 0         |
+------+---------+------+-----------------------------------------------+-----------------+-----------+
ubuntu@tryit:~$ incus shell c9
Error: VM agent isn't currently running

How long are you waiting for the vm to spin up? Containers are mostly instant, and we get spoiled by that because we take for granted the agent is there straight away. VM’s take longer to boot (but still faster than a physical machine of course). 10-20 seconds usually covers it.

I’ve waited at least a few minutes.

BTW. What changed since the last time it was working, I went from Incus 6.0 to 6.2

Oh cool. On incus/try-it it is working. So it must be something at my end.

Hmm, that is odd. I just tried the demo, albeit with debian:-
ubuntu@tryit:~$ incus launch images:debian/12 vm --vm
Launching vm
ubuntu@tryit:~$ incus shell vm
root@vm:~# uname -r
6.1.0-21-amd64
root@vm:~#

Debian and Ubuntu work for me as well, They are different. Try CentOS, because then you need the agent.

Ah, found it. The VM is trying to do a secure boot. On my Fedora 40 system that doesn’t (yet) work. If I set security.secureboot to false the VM starts correctly.

BTW I fell in the trap to modify some files on my systems as a workaround. And probably these changes were undone by Fedora update (39->40).

I’ll have to dig up what exactly I changed.

BTW I was referring to On Fedora: Couldn't find one of the required UEFI firmware files · Issue #796 · lxc/incus · GitHub

I’m still curious what is different on my (Fedora 4) system. I can start a VM for several distributions without problems: Ubuntu 22, Debian 12, RockyLinux 9.

But CentOS-9 Stream gives a problem with booting is security.secureboot is on. incus start returns without error, but the system hangs. If I run incus console immediately after the start I see this

BdsDxe: loading Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)/Scsi(0x0,0x1)
BdsDxe: failed to load Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)/Scsi(0x0,0x1): Access Denied

>>Start PXE over IPv4.
  PXE-E16: No valid offer received.
BdsDxe: failed to load Boot0003 "UEFI PXEv4 (MAC:00163E393775)" from PciRoot(0x0)/Pci(0x1,0x4)/Pci(0x0,0x0)/MAC(00163E393775,0x1)/IPv4(0.0.0.0,0x0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0): Not Found

>>Start PXE over IPv6.
  PXE-E16: No valid offer received.
BdsDxe: failed to load Boot0004 "UEFI PXEv6 (MAC:00163E393775)" from PciRoot(0x0)/Pci(0x1,0x4)/Pci(0x0,0x0)/MAC(00163E393775,0x1)/IPv6(0000:0000:0000:0000:0000:0000:0000:0000,0x0,Static,0000:0000:0000:0000:0000:0000:0000:0000,0x40,0000:0000:0000:0000:0000:0000:0000:0000): Not Found

>>Start HTTP Boot over IPv4.....
  Error: Could not retrieve NBP file size from HTTP server.

  Error: Server response timeout.
BdsDxe: failed to load Boot0005 "UEFI HTTPv4 (MAC:00163E393775)" from PciRoot(0x0)/Pci(0x1,0x4)/Pci(0x0,0x0)/MAC(00163E393775,0x1)/IPv4(0.0.0.0,0x0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0)/Uri(): Not Found

>>Start HTTP Boot over IPv6.
  Error: Could not retrieve NBP file size from HTTP server.

  Error: Unexpected network error.
BdsDxe: failed to load Boot0006 "UEFI HTTPv6 (MAC:00163E393775)" from PciRoot(0x0)/Pci(0x1,0x4)/Pci(0x0,0x0)/MAC(00163E393775,0x1)/IPv6(0000:0000:0000:0000:0000:0000:0000:0000,0x0,Static,0000:0000:0000:0000:0000:0000:0000:0000,0x40,0000:0000:0000:0000:0000:0000:0000:0000)/Uri(): Not Found
BdsDxe: failed to load Boot0001 "UEFI QEMU QEMU CD-ROM " from PciRoot(0x0)/Pci(0x1,0x1)/Pci(0x0,0x0)/Scsi(0x1,0x1): Not Found
BdsDxe: No bootable option or device was found.
BdsDxe: Press any key to enter the Boot Manager Menu.