Run the following command and either accept the defaults or choose different options when prompted:
lxd init
Command:
lxc launch <image_server>:<image_name> <instance_name>
Example:
lxc launch ubuntu:22.04 ubuntu-container
Check the community image server for other Linux distributions.
1.Failed detecting root disk device: No root device could be found
lxc profile device add default root disk path=/ pool=default
2.Error: Failed instance creation: Failed creating instance record: Failed initialising instance: Failed getting root disk: No root device could be found
You didn’t initialize your LXD storage properly. Run=> lxd init
in order to configure the storage for lxd. For most setups except performance-critical production setups, it's recommended to use the dir storage backend because it does not require any further configuration. You can leave all other options at their default values.
You now have your instance up and running! You're all set to experiment with any commands you need.
Command:
lxc exec <instance_name> -- <command>
Example:
lxc exec mycontainer bash
For a list of available commands and options, just run=>lxc
penguin container on Chromebook