How to auto start LXD containers VM at boot time in Linux

To automatically start an LXD container at boot time on a Linux system, you need to configure the container to start automatically. Here are the steps to do this:

  1. Start the container:
lxc start <container_name>
  1. Set the container to start automatically:
lxc config set <container_name> boot.autostart true
  1. Restart the container to apply the change:
lxc restart <container_name>
  1. Verify that the container is set to start automatically:
lxc config show <container_name>

The output should include a line indicating that the container is set to start automatically:

boot.autostart: "true"

After these steps, the container should start automatically at boot time. Note that you may need to configure your system to start LXD at boot time if it is not already configured to do so.

Leave a Comment