I came across “lxd agent” in VM images which was meant for seamless integration with the lxd ecosystem and for commands like “lxc exec” to work properly.
I havent seen any other advantages for the same. Can you share if there are any ?
Also need details or documentation on how can I add support for lxd-agent in custom image ?
For a Xubuntu VM you could either manually install the package lxd-agent-loader or use cloud-init to do so. For Linux VMs that are not based on Ubuntu, this should do the trick:
lxc config device add u1 config disk source=cloud-init:config
lxc config set u1 cloud-init.user-data - << EOF
#cloud-config
runcmd:
- mount -t 9p config /mnt
- cd /mnt
- ./install.sh
- cd /
- umount /mnt
- systemctl start lxd-agent # XXX: causes a reboot
EOF
lxc start --console u1
I’ll add those to the doc link you provided, thanks!