Forrest logo
back to the lxc tool

lxc:tldr:46cb3

lxc: Create a new container from an image.
$ lxc init [${remote}:]${image} ${container}
try on your machine

The command "lxc init [${remote}:]${image} ${container}" is used to create a new container using LXD (Linux Container Daemon). Here is the breakdown of the components:

  • "lxc init": This is the command to initialize a new container.
  • "[${remote}:]": This part is optional and specifies the remote server where the container will be created. If not specified, the container will be created locally.
  • "${image}": This parameter is the image from which the container will be created. An image is a template or snapshot of a container's file system.
  • "${container}": This is the name that will be assigned to the new container being created. It should be unique and user-defined.

To use this command, you would replace "${remote}" with the remote server address (if applicable), and "${image}" and "${container}" with the specific image and container name you desire.

For example:

  • To create a new container named "mycontainer" using the local server and the "ubuntu" image, the command would be: "lxc init ubuntu mycontainer".
  • To create a new container named "mycontainer" using a remote server with IP address "192.168.1.100" and the "ubuntu" image, the command would be: "lxc init 192.168.1.100:ubuntu mycontainer".
This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the lxc tool