pve lxc下使用tailscale

lxc或者docker内直接运行tailscale up会提示

failed to connect to local tailscaled (which appears to be running as tailscaled, pid 4722). Got error: 503 Service Unavailable: no backend

或者

failed to connect to local tailscaled (which appears to be running as tailscaled, pid 2695). Got error: Failed to connect to local Tailscale daemon for /localapi/v0/status; systemd tailscaled.service not running. Error: dial unix /var/run/tailscaled.socket: connect: no such file or directory

即便是已经启动了 tailscaled服务也是如此,最后发现是tun的问题。

lxc配置文件添加 两行

1
2
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir

如果lxc同时运行docker,注意 上面两行要加到lxc套docker的粮行配置后面。参考配置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
arch: amd64
cores: 12
features: fuse=1,mknod=1,mount=nfs;cifs,nesting=1
hostname: derper
memory: 512
net0: name=eth0,bridge=vmbr0,firewall=1,gw=10.1.1.1,hwaddr=76:1A:21:0B:26:78,ip=10.1.1.211/24,ip6=dhcp,type=veth
ostype: alpine
rootfs: nvme_btrfs:211/vm-211-disk-0.raw,size=1G
searchdomain: 10.1.1.1
swap: 0
lxc.cgroup.devices.allow: a
lxc.cap.drop:
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir

关闭ct容器 重新启动即可

docker下运行的花,同样需要映射 /dev/net/tun 到容器内

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计