用PVE的CT容器运行黑裙

出处https://github.com/vdsm/virtual-dsm

/etc/pve/lxc

lxc.cgroup2.devices.allow: c 10:232 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file 0 0
lxc.mount.entry: /dev/kvm dev/kvm none bind,create=file 0 0
lxc.cgroup.devices.allow: c 10:200 rwm # for compatibility
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/vhost-net dev/vhost-net none bind,create=file 0 0
lxc.apparmor.profile: unconfined
lxc.cap.drop: 

如果要共享核显就加上以上代码:

lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file

apt update

apt install sudo curl

curl -fsSL https://get.docker.com -o get-docker.sh

sudo sh get-docker.sh

docker network create -d macvlan --subnet=192.168.3.0/24 --gateway=192.168.3.1 -o parent=eth0 macvlan1

docker run -it --cap-add NET_ADMIN --device-cgroup-rule='c *:* rwm'  --sysctl net.ipv4.ip_forward=1 --device /dev/net/tun --device /dev/vhost-net --stop-timeout 60 -v /home/docker/vdsm/storage1:/storage -e DHCP=N -e CPU_CORES=4 -e RAM_SIZE=2048M -e DISK_SIZE=32G -e ALLOCATE=N -e KVM=NO --network=macvlan1 --ip=192.168.3.100 vdsm/virtual-dsm:latest


docker run -d -p 90000:9000 -p 9443:9443 --name portainer \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /home/docker/portainer_data:/data \
portainer/portainer-ce:latest
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 共1条
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片
    • 头像用户0