canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.38k stars 931 forks source link

LXD VM agent not running in newly created bionic VM #12788

Closed tobhe closed 9 months ago

tobhe commented 9 months ago

Hi,

I tried creating a new bionic vm with lxc launch ubuntu:18.04 --vm $NAME and the resulting VM doesn't seem to have a VM agent running. lxc shell $NAME returns "Error: LXD VM agent isn't currently running". Afaict it works for focal and newer. Is this expected or a bug?

System info:

Distribution: Ubuntu Distribution version: 23.10

$ lxc info config: core.https_address: :8443 api_extensions:

tomponline commented 9 months ago

The official ubuntu:18.04 image never got the lxd-agent systemd units backported to it (because its not a security fix) and so they don't support the lxd-agent out of the box.

See https://documentation.ubuntu.com/lxd/en/latest/reference/devices_disk/#types-of-disk-devices for the "VM cloud-init" section on how to use cloud-init to get the lxd-agent working.

tomponline commented 9 months ago

You can also use cloud-init to configure SSH https://documentation.ubuntu.com/lxd/en/latest/cloud-init/