Linux command
lxc 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
List
lxc list [match_string]
Example
lxc image list [remote:][match_string]
Create
lxc init [remote:]image [container]
Start
lxc start [remote:]container
Stop
lxc stop [remote:]container
Example
lxc info [remote:]container
Example
lxc snapshot [remote:]container [snapshot_name]
Execute
lxc exec [remote:]container [command]
Launch
lxc launch [remote:]image [container]
说明
lxc manages Linux containers using the LXD REST API. It provides a user-friendly interface for creating, managing, and interacting with system containers and virtual machines.
参数
- list
- List containers
- image list
- List available images
- init
- Create container from image
- start
- Start container
- stop
- Stop container
- info
- Show container details
- snapshot
- Create container snapshot
- exec
- Execute command in container
- launch
- Create and start a container (combines init + start)
- delete
- Delete container
- copy
- Copy container
- move
- Move container between servers
- file push|pull
- Transfer files to/from container
- config
- Manage container configuration
- profile
- Manage container profiles
- network
- Manage networks
- storage
- Manage storage pools and volumes
- remote
- Manage remote servers
- --debug
- Show all debug messages
- --force-local
- Force using the local unix socket
- -h, --help
- Print help
- --project _PROJECT_
- Override the source project
- -q, --quiet
- Do not show progress information
- -v, --verbose
- Show all information messages
FAQ
What is the lxc command used for?
lxc manages Linux containers using the LXD REST API. It provides a user-friendly interface for creating, managing, and interacting with system containers and virtual machines.
How do I run a basic lxc example?
Run `lxc list [match_string]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does list do in lxc?
List containers