1 Good ref
pct create <id> /var/lib/vz/template/cache/centos-7-default_20170504_amd64.tar.xz \ | |
-arch amd64 \ | |
-ostype <centos|ubuntu|etc> \ | |
-hostname <hostname> \ | |
-cores <cores> \ | |
-memory <memory(MB)> \ | |
-swap <swap(MB)> \ | |
-storage local-lvm \ | |
-password \ | |
-net0 name=eth0,bridge=<bridge>,gw=<gateway>,ip=<cidr>,type=veth &&\ | |
pct start <id> &&\ | |
sleep 10 &&\ | |
pct resize <id> rootfs <storage(ex: +4G)> &&\ | |
pct exec <id> -- bash -c "yum update -y &&\ | |
yum install -y openssh-server &&\ | |
systemctl start sshd &&\ | |
useradd -mU hogeuser &&\ | |
echo "password" | passwd --stdin hogeuser" |
沒有留言:
張貼留言