/usr/share/perl5/PVE/LXC/Setup
working with any linux distro
cmode shell (no login)
pct restore 100 vzdump-openvz-100-xxx.tar.gz -storage=local-lvm -ostype=unmanaged -cmode shell
pct mount CTID
to mount a container's volumes to /var/lib/lxc/CTID/rootfs/
/etc/pve/lxc/xxx.conf
mp0: /mnt/cflash,mp=/mnt
“pct pull” and “pct push” to transfer files from and to running containers
“pct exec” and “pct enter” to run individual commands or to spawn a shell inside a running container
Systemd related - remove this line
PrivateTmp=true
Background services from command line terminated after start (rc.local for example)
options disable /dev/console
pct restore CTID backup.tar.gz --rootfs local:0
This is identical to “simfs” in OpenVZ but unsecured.
/dev/X /c ext4 defaults,noatime,nodiratime,nobh,commit=40,barrier=0,data=writeback 0 2
/usr/share/perl5/PVE/LXC.pm
Turn off ACL
/var/lib/lxc/100/config
lxc.rootfs.options = noatime
sudo vzdump 100 -compress lzo -dumpdir /var/lib/vz/dump -mode snapshot -remove 0 sudo pct restore 100 /var/lib/vz/dump/vzdump-lxc-101-xxx.tar.lzo --rootfs local:0
lxc-info -n ID
Name: 105 State: RUNNING PID: 2744 IP: 10.160.149.27 CPU use: 291440.41 seconds Memory use: 5.01 GiB KMem use: 0 bytes Link: veth105i0 TX bytes: 179.15 GiB RX bytes: 109.61 GiB Total bytes: 288.76 GiB
pf:12345:powerwait:/sbin/halt
lxc.signal.stop value in your container's config. For example, SIGKILL