Failed to connect to lxd-agent on ubuntu-desktop

I have created Ubuntu desktop images (lxc init ubuntu-desktop --empty --vm -c security.secureboot=false -c limits.cpu=4 -c limits.memory=4GB)

After installation, I am able to connect console however not able to connect bash

$lxc exec ubuntu-desktop bash
Error: Failed to connect to lxd-agent

Anything missing in my installation ? any idea?

That’s normal, for those features to work, you need the LXD agent to be in the VM which it’s not when you manually install like that.

You may be able to just do apt install lxd-agent-loader or if that’s not available in the version of Ubuntu you’re using, you can do:

  • mount -t 9p config /mnt
  • cd /mnt
  • ./install.sh
  • reboot

Yeah, It works!

Thank you very much!

Regards,