浏览代码

Update ubuntu_container.sh

tteckster 3 年之前
父节点
当前提交
e87ef4bc5b
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      ct/ubuntu_container.sh

+ 6 - 0
ct/ubuntu_container.sh

@@ -145,6 +145,12 @@ pct create $CTID $TEMPLATE_STRING -arch $ARCH -features nesting=1 \
   -hostname $HOSTNAME -net0 name=eth0,bridge=vmbr0,ip=dhcp -onboot 1 -cores 1 -memory 512\
   -ostype $OSTYPE -rootfs $ROOTFS,size=$DISK_SIZE -storage $STORAGE >/dev/null
 
+LXC_CONFIG=/etc/pve/lxc/${CTID}.conf
+cat <<EOF >> $LXC_CONFIG
+lxc.cgroup2.devices.allow: a
+lxc.cap.drop:
+EOF
+
 MOUNT=$(pct mount $CTID | cut -d"'" -f 2)
 ln -fs $(readlink /etc/localtime) ${MOUNT}/etc/localtime
 pct unmount $CTID && unset MOUNT