69 lines
2.5 KiB
Plaintext
69 lines
2.5 KiB
Plaintext
|
lxc start <instance_name>
|
||
|
lxc stop <instance_name>
|
||
|
lxc delete <instance_name>
|
||
|
|
||
|
lxc exec <instance_name> -- <command>
|
||
|
lxc exec ubuntu-container -- apt-get update
|
||
|
lxc exec <instance_name> -- /bin/bash
|
||
|
lxc exec <instance_name> -- su --login <user_name>
|
||
|
|
||
|
lxc file pull <instance_name>/<path_to_file> <location_on_host>
|
||
|
lxc file pull ubuntu-container/etc/hosts .
|
||
|
lxc file pull ubuntu-container/var/log/syslog - | less
|
||
|
lxc file pull -r <instance_name>/<path_to_folder> <location_on_host>
|
||
|
lxc file push <location_on_host> <instance_name>/<path_to_file>
|
||
|
lxc file push -r <location_on_host> <instance_name>/<path_to_folder>
|
||
|
|
||
|
lxc copy --help
|
||
|
lxc publish --help # (publishes to local image store, view with 'lxc image list)
|
||
|
|
||
|
|
||
|
lxc snapshot <instance_name> <snapshot_name>
|
||
|
lxc info <instance_name> # also lists snapshots
|
||
|
lxc restore <instance_name> <snapshot_name>
|
||
|
lxc delete <instance_name>/<snapshot_name>
|
||
|
|
||
|
|
||
|
lxc list
|
||
|
lxc list type=container
|
||
|
lxc list status=running
|
||
|
lxc list ubuntu.*
|
||
|
|
||
|
lxc info <instance_name>
|
||
|
lxc info <instance_name> --show-log
|
||
|
|
||
|
|
||
|
lxc launch servername:imagename
|
||
|
lxc launch images:ubuntu/20.04
|
||
|
lxc launch images:ubuntu/20.04 ubuntu-limited -c limits.cpu=1 -c limits.memory=192MiB
|
||
|
lxc launch images:ubuntu/20.04 ubuntu-config < config.yaml
|
||
|
|
||
|
lxc remote list
|
||
|
|
||
|
lxc image list images:
|
||
|
lxc image list images:debian
|
||
|
|
||
|
lxc config edit ubuntu
|
||
|
lxc config set <instance_name> <option_key>=<option_value> <option_key>=<option_value> ...
|
||
|
lxc config set ubuntu-limited limits.memory=128MiB
|
||
|
lxc config device add <instance_name> <device_name> <device_type> <device_option_key>=<device_option_value> <device_option_key>=<device_option_value> ...
|
||
|
lxc config device add ubuntu-container disk-storage-device disk source=/share/c1 path=/opt
|
||
|
lxc config device remove <instance_name> <device_name>
|
||
|
lxc config device show <instance_name>
|
||
|
lxc config show <instance_name> -e
|
||
|
|
||
|
lxc network list
|
||
|
lxc network show lxdbr0
|
||
|
lxc bridge edit lxdbr0
|
||
|
|
||
|
lxc profile list
|
||
|
lxc profile show <profile_name>
|
||
|
lxc profile create <profile_name>
|
||
|
lxc profile set <profile_name> <option_key>=<option_value> <option_key>=<option_value> ...
|
||
|
lxc profile device add <instance_name> <device_name> <device_type> <device_option_key>=<device_option_value> <device_option_key>=<device_option_value> ...
|
||
|
lxc profile edit <profile_name>
|
||
|
lxc profile edit <profile_name> < profile.yaml
|
||
|
lxc profile add <instance_name> <profile_name>
|
||
|
lxc launch <image> <instance_name> -p <profile> -p <profile> ...
|
||
|
lxc profile remove <instance_name> <profile_name>
|