lxc-start
Start a Linux container
TLDR
Start the lxc service
Start a container
Start a container in the foreground
Exit out of a foreground container (run this in a separate terminal)
Display help
SYNOPSIS
lxc-start [-d] [-n container_name] [-o logfile] [-l log level] [-F]
PARAMETERS
-d
Start the container in daemon mode (background).
-n container_name
Specify the name of the container to start.
-o logfile
Specify a log file for container output.
-l log level
Specify the log level (e.g., TRACE, DEBUG, INFO, WARNING, ERROR, FATAL).
-F
Start the container in foreground.
DESCRIPTION
The lxc-start command is used to initiate the execution of a Linux container (LXC). It performs the necessary steps to bring the container from a stopped state to a running state. This includes setting up the container's namespace isolation (network, process, mount, etc.), configuring its network interfaces, mounting the root filesystem as defined in the container's configuration file, and finally, executing the container's init process (typically /sbin/init or a similar program).
lxc-start relies heavily on the container's configuration file (usually located at /var/lib/lxc/
After the container has started, it operates as a separate, isolated environment from the host system, providing a lightweight virtualization solution. The command returns once the container's init process has started. Subsequent interaction with the container typically occurs through other LXC tools such as lxc-attach, lxc-console, or lxc-info.
CONTAINER CONFIGURATION
The behavior of lxc-start is heavily influenced by the container's configuration file. Ensure the configuration file is accurate and reflects the desired state of the container before starting it. Incorrect configurations can lead to container startup failures or unexpected behavior.
ROOT PRIVILEGES
Starting a container typically requires root privileges. Make sure you run lxc-start with sufficient permissions.
SEE ALSO
lxc-stop(1), lxc-attach(1), lxc-console(1), lxc-info(1), lxc-create(1), lxc-destroy(1)