LinuxCommandLibrary

lxc-info

Get information about an LXC container

TLDR

Query information from a container

$ sudo lxc-info [container_name]
copy

Display help
$ lxc-info [[-?|--help]]
copy

SYNOPSIS

lxc-info [-n container_name] [-Hp]

PARAMETERS

-n container_name
    Specifies the name of the container to get information about. This is a required argument.

-H
    Display the output in a human-readable format (e.g., using units like MB and GB for memory).

-p
    Display the container's PID.

DESCRIPTION

The `lxc-info` command provides detailed information about an LXC container. It displays information such as the container's state (running, stopped, frozen), PID (if running), IP addresses, resource usage (CPU and memory), and configuration details. It's a crucial tool for monitoring and troubleshooting LXC containers. It helps users quickly understand the status and resource consumption of their containers without needing to dig through configuration files or run multiple commands. The command works by querying the LXC control API and accessing the container's configuration files. Using `lxc-info`, administrators can gain valuable insights into container health and performance and identify potential issues before they escalate. The information displayed can be customized by options to the command. It helps when investigating resource contention, network problems, or application failures within containers. It's an essential command for anyone managing LXC containerized environments.

EXAMPLES

lxc-info -n mycontainer
Displays basic information about the container named "mycontainer".

lxc-info -n mycontainer -H
Displays information in human-readable format.

lxc-info -n mycontainer -p
Displays the container's PID.

SEE ALSO

lxc(1), lxc-start(1), lxc-stop(1), lxc-ls(1), lxc-console(1)

Copied to clipboard