wiki:lxc_commands
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
wiki:lxc_commands [2022/10/08 09:34] – created antisa | wiki:lxc_commands [2022/10/08 09:38] (current) – add lxc mount host directory and move containers antisa | ||
---|---|---|---|
Line 9: | Line 9: | ||
lxc-create -n < | lxc-create -n < | ||
+ | |||
+ | ===== LXC rename container ===== | ||
+ | 1. Shutdown container | ||
+ | |||
+ | lxc-stop -n < | ||
+ | |||
+ | 2. Open Terminal/ | ||
+ | |||
+ | sudo mv / | ||
+ | |||
+ | 3. Rename hostname and paths in config | ||
+ | |||
+ | sudo vim / | ||
+ | |||
+ | lxc.utsname = newname | ||
+ | lxc.rootfs = / | ||
+ | lxc.mount = / | ||
+ | |||
+ | |||
+ | ===== lxc mount host directory inside container ===== | ||
+ | |||
+ | Add to config: | ||
+ | |||
+ | lxc.mount.entry=/ | ||
+ | |||
+ | ===== Moving lxc containers ===== | ||
+ | cd / | ||
+ | tar --numeric-owner -czvf container_fs-$(date +%Y%m%d).tar.gz ./* | ||
+ | |||
+ | From one partition to another: | ||
+ | |||
+ | cp -a / | ||
====== Tested on ====== | ====== Tested on ====== | ||
* | * | ||
Line 15: | Line 47: | ||
====== References ====== | ====== References ====== | ||
+ | * http:// | ||
wiki/lxc_commands.1665221675.txt.gz · Last modified: 2022/10/08 09:34 by antisa