Hmm, that exact same VM works fine here, what’s your host?
It’s possible to do some debugging by stopping the VM, map the block device of the VM, mount the second partition from that, set a root password, unmount and start the VM, at which point you can login locally fine.
We used incus exec NAME -- sh -c 'systemctl isolate multi-user.target' as check if the vm is ready.
Which seems to be the issue. But good to know that i could set a password.
That is almost what i did, but we added degraded as ok state since there is a surprising amount of images with services which are non essential but are started and fail.
I have the same issue here - incus launch --vm --console images:debian/bookworm/cloud shows [FAILED] Failed to start incus-agent.service - Incus - agent. on the console. Ubuntu noble host, incus 0.6-1 from noble, non-VMs work fine.
I’d be happy to try to map the block device of the VM as you suggest, but I can’t even find it (perhaps because my storage pool is on ZFS?). Is there any documentation of doing this sort of thing? At the moment I’m a bit stuck with no obvious debugging options.
Got your environment reproduced thanks to nested virtualization
Managed to reproduce the same agent startup failure too.
The main trick to debug this is:
root@noble:~# incus stop -f foo
root@noble:~# zfs set volmode=full default/virtual-machines/foo.block
root@noble:~# mount /dev/zvol/default/virtual-machines/foo.block-part2 /mnt/
root@noble:~# chroot /mnt passwd root
New password:
Retype new password:
passwd: password updated successfully
root@noble:~# umount /mnt
root@noble:~# incus start foo
At which point you can do a normal console login and see what’s going on.
In this case the error shows /run/incus_agent/incus-agent no such file or directory.
Mounting the config drive directly with mount -t 9p config /mnt inside the VM sure enough shows no incus-agent in there.
The incus log also confirms it:
time="2024-03-01T13:35:58Z" level=warning msg="incus-agent not found, skipping its inclusion in the VM config drive" err="<nil>" instance=foo instanceType=virtual-machine project=default
That means that the incusd process couldn’t find incus-agent in its PATH and INCUS_AGENT_PATH also isn’t set to a directory containing all the agent builds.
In the Debian package, incus-agent is located in /usr/libexec/incus/incus-agent.
The PATH variable for the incusd binary is PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin.
Yeah, I was just thinking along the same lines. As long as you can inject the environment using EnvironmentFile= rather than Environment=, then it all works fine.
In that case I’ll take this to the Debian maintainers, since it seems that the problem is in their packaging.
I am installing a VM from a Debian12 iso (actually it is DebianEdu 12).
After this, I am trying to install incus-agent inside the VM.
I am using the script from this snippet:
which is based on these instructions (renaming lxd to incus):
For convenience, the script can also be downloaded with:
wget https://t.ly/EOxxX -O install-incus-agent.sh
The problem is that the service incus-agent fails to start (the service incus-agent-9p is running). When I try to execute manually the command: /run/incus_config/9p/incus-agent I get the error message:
This is a different issue (I guess) from what is being discussed here, but maybe they are related. Anyway, I am not a systemd expert and need some help on fixing this.