cannot open TUN/TAP dev /dev/net/tun: No such file or directory
Posted: 02 Jan 2021, 02:42
info:
F2-221
Version 4.2.07-2012241608
Hello all,
I'm attempting to run qbittorrent/openvpn via docker
- https://hub.docker.com/r/markusmcnugen/qbittorrentvpn
I am unable to access /dev/net/tun/
ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
I have attempted to run the docker command with --cap-add=NET_ADMIN, --cap-add=SYS_ADMIN, --device=/dev/net/tun/ including multiple combinations of each.
I am only able to get the container functional by using --privileged however after a system reboot or restart of the container I receive the same error.
All docker run commands have been issued via root ssh. Container logs and docker run script below. Any help would be appreciated.
Docker run script below
F2-221
Version 4.2.07-2012241608
Hello all,
I'm attempting to run qbittorrent/openvpn via docker
- https://hub.docker.com/r/markusmcnugen/qbittorrentvpn
I am unable to access /dev/net/tun/
ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
I have attempted to run the docker command with --cap-add=NET_ADMIN, --cap-add=SYS_ADMIN, --device=/dev/net/tun/ including multiple combinations of each.
I am only able to get the container functional by using --privileged however after a system reboot or restart of the container I receive the same error.
All docker run commands have been issued via root ssh. Container logs and docker run script below. Any help would be appreciated.
Code: Select all
2021-01-01 18:12:46.655578 [info] VPN_ENABLED defined as 'yes'
2021-01-01 18:12:46.932939 [info] OpenVPN config file (ovpn extension) is located at /config/openvpn/us_washington_dc-aes-128-cbc-udp-dns.ovpn
dos2unix: converting file /config/openvpn/us_washington_dc-aes-128-cbc-udp-dns.ovpn to Unix format...
2021-01-01 18:12:47.136605 [info] VPN remote line defined as 'us-washingtondc.privacy.network 1198'
2021-01-01 18:12:47.193426 [info] VPN_REMOTE defined as 'us-washingtondc.privacy.network'
2021-01-01 18:12:47.253230 [info] VPN_PORT defined as '1198'
2021-01-01 18:12:47.309790 [info] VPN_PROTOCOL defined as 'udp'
2021-01-01 18:12:47.368012 [info] VPN_DEVICE_TYPE defined as 'tun0'
2021-01-01 18:12:47.425603 [info] LAN_NETWORK defined as '192.168.86.0/24'
2021-01-01 18:12:47.483039 [info] NAME_SERVERS defined as '8.8.8.8,8.8.4.4'
2021-01-01 18:12:47.538035 [info] VPN_OPTIONS not defined (via -e VPN_OPTIONS)
2021-01-01 18:12:47.595363 [info] Adding 8.8.8.8 to resolv.conf
2021-01-01 18:12:47.669936 [info] Adding 8.8.4.4 to resolv.conf
2021-01-01 18:12:47.722224 [info] Starting OpenVPN...
Fri Jan 1 18:12:48 2021 WARNING: file 'credentials.conf' is group or others accessible
Fri Jan 1 18:12:48 2021 OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on May 14 2019
Fri Jan 1 18:12:48 2021 library versions: OpenSSL 1.1.1 11 Sep 2018, LZO 2.08
Fri Jan 1 18:12:53 2021 TCP/UDP: Preserving recently used remote address: [AF_INET]*ip removed*:1198
Fri Jan 1 18:12:53 2021 UDP link local: (not bound)
Fri Jan 1 18:12:53 2021 UDP link remote: [AF_INET]*ip removed*:1198
Fri Jan 1 18:12:53 2021 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Fri Jan 1 18:12:53 2021 [washington405] Peer Connection Initiated with [AF_INET]*ip removed*:1198
Fri Jan 1 18:12:54 2021 OpenVPN ROUTE6: OpenVPN needs a gateway parameter for a --route-ipv6 option and no default was specified by either --route-ipv6-gateway or --ifconfig-ipv6 options
Fri Jan 1 18:12:54 2021 OpenVPN ROUTE: failed to parse/resolve route for host/network: 2000::/3
Fri Jan 1 18:12:54 2021 ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
Fri Jan 1 18:12:54 2021 Exiting due to fatal errorCode: Select all
docker run --privileged -d \
-v /mnt/md0/public/docker/qbittorrent/config/:/config \
-v /mnt/md0/public/docker/qbittorrent/downloads/:/downloads \
-e "VPN_ENABLED=yes" \
-e "VPN_USERNAME=username" \
-e "VPN_PASSWORD=password" \
-e "LAN_NETWORK=192.168.86.0/24" \
-e "NAME_SERVERS=8.8.8.8,8.8.4.4" \
-e "PUID=0" \
-e "PGID=0" \
-p 8080:8080 \
-p 8999:8999 \
-p 8999:8999/udp \
markusmcnugen/qbittorrentvpn