Forrest logo
tool overview
On this page you find all important commands for the CLI tool lxc. If the command you are looking for is missing please ask our AI.

lxc

LXC, short for Linux Containers, is a command line tool that provides a lightweight and portable solution for OS-level virtualization on Linux systems. It enables you to create and manage lightweight, secure, and isolated containers within a single Linux host.

With LXC, you can create multiple containers running independently on the same host, each containing its own isolated process space, file system, and network interfaces. These containers are similar to virtual machines but offer more efficient resource utilization and faster startup and shutdown times.

LXC leverages Linux kernel features such as namespaces, control groups (cgroups), and chroot to achieve containerization. It provides a simple command line interface, making it easy to create, manage, and interact with containers. You can start, stop, restart, and delete containers, as well as view their current state and resource usage.

LXC also allows you to configure various aspects of the container, such as network settings, resource limits, and storage, providing flexibility in customizing the container environment according to your needs. It supports various Linux distributions as container templates, enabling you to create containers with different OS versions and package sets.

LXC is widely used in various scenarios, including testing and development environments, server consolidation, and deploying applications with strict isolation requirements. It offers a balance between system-level isolation and resource efficiency, making it a popular choice for containerization on Linux.

List of commands for lxc:

  • lxc-network:tldr:22243 lxc-network: Set a bridge interface of a specific network.
    $ lxc network set ${network_name} bridge.external_interfaces ${eth0}
    try on your machine
    explain this command
  • lxc-network:tldr:6f98e lxc-network: List all available networks.
    $ lxc network list
    try on your machine
    explain this command
  • lxc-network:tldr:81ee5 lxc-network: Create a new managed network.
    $ lxc network create ${network_name}
    try on your machine
    explain this command
  • lxc-network:tldr:a49e4 lxc-network: Add a running instance to a specific network.
    $ lxc network attach ${network_name} ${container_name}
    try on your machine
    explain this command
  • lxc-network:tldr:b2ca5 lxc-network: Disable NAT for a specific network.
    $ lxc network set ${network_name} ipv${4}.nat false
    try on your machine
    explain this command
  • lxc-network:tldr:eef57 lxc-network: Show the configuration of a specific network.
    $ lxc network show ${network_name}
    try on your machine
    explain this command
  • lxc-profile:tldr:1cb3d lxc-profile: List all available profiles.
    $ lxc profile list
    try on your machine
    explain this command
  • lxc-profile:tldr:50e76 lxc-profile: Show the configuration of a specific profile.
    $ lxc profile show ${profile_name}
    try on your machine
    explain this command
  • lxc-profile:tldr:68713 lxc-profile: Edit a specific profile importing the configuration values from a file.
    $ lxc profile edit ${profile_name} < ${config-yaml}
    try on your machine
    explain this command
  • lxc-profile:tldr:73899 lxc-profile: Change the profiles of a running container.
    $ lxc profile assign ${container_name} ${profile1,profile2}
    try on your machine
    explain this command
  • lxc-profile:tldr:b4aec lxc-profile: Launch a new container with specific profiles.
    $ lxc launch ${container_image} ${container_name} --profile ${profile1} --profile ${profile2}
    try on your machine
    explain this command
  • lxc-profile:tldr:cd7b6 lxc-profile: Edit a specific profile in the default editor.
    $ lxc profile edit ${profile_name}
    try on your machine
    explain this command
  • lxc:tldr:1be3f lxc: Execute a specific command inside a container.
    $ lxc exec [${remote}:]${container} ${command}
    try on your machine
    explain this command
  • lxc:tldr:3ee52 lxc: Show detailed info about a container.
    $ lxc info [${remote}:]${container}
    try on your machine
    explain this command
  • lxc:tldr:46cb3 lxc: Create a new container from an image.
    $ lxc init [${remote}:]${image} ${container}
    try on your machine
    explain this command
  • lxc:tldr:791a7 lxc: Stop a container.
    $ lxc stop [${remote}:]${container}
    try on your machine
    explain this command
  • lxc:tldr:af404 lxc: List images matching a string. Omit the string to list all images.
    $ lxc image list [${remote}:]${match_string}
    try on your machine
    explain this command
  • lxc:tldr:c0a95 lxc: Start a container.
    $ lxc start [${remote}:]${container}
    try on your machine
    explain this command
  • lxc:tldr:cc946 lxc: Take a snapshot of a container.
    $ lxc snapshot [${remote}:]${container} ${snapshot}
    try on your machine
    explain this command
  • lxc:tldr:f810d lxc: List local containers matching a string. Omit the string to list all local containers.
    $ lxc list ${match_string}
    try on your machine
    explain this command
tool overview