gluetun: Bug: cannot create TUN device file node: file exists

Is this urgent?

No

Host OS

Arch Linux x86_64

CPU arch

x86_64

VPN service provider

PrivateVPN

What are you using to run the container

docker run

What is the version of Gluetun

Running version latest built on 2022-03-09T21:14:11.771Z (commit 0795008)

What’s the problem πŸ€”

2022/03/10 11:59:09 ERROR cannot create TUN device file node: file exists

Share your logs

========================================
========================================
=============== gluetun ================
========================================
=========== Made with ❀️ by ============
======= https://github.com/qdm12 =======
========================================
========================================

Running version latest built on 2022-03-09T21:14:11.771Z (commit 0795008)

πŸ”§ Need help? https://github.com/qdm12/gluetun/discussions/new
πŸ› Bug? https://github.com/qdm12/gluetun/issues/new
✨ New feature? https://github.com/qdm12/gluetun/issues/new
β˜• Discussion? https://github.com/qdm12/gluetun/discussions/new
πŸ’» Email? quentin.mcgaw@gmail.com
πŸ’° Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
2022/03/10 12:06:37 INFO routing: default route found: interface eth0, gateway 172.17.0.1
2022/03/10 12:06:37 INFO routing: local ethernet link found: eth0
2022/03/10 12:06:37 INFO routing: local ipnet found: 172.17.0.0/16
2022/03/10 12:06:37 INFO firewall: enabling...
2022/03/10 12:06:37 DEBUG firewall: iptables --policy INPUT DROP
2022/03/10 12:06:37 DEBUG firewall: iptables --policy OUTPUT DROP
2022/03/10 12:06:37 DEBUG firewall: iptables --policy FORWARD DROP
2022/03/10 12:06:37 DEBUG firewall: iptables --append INPUT -i lo -j ACCEPT
2022/03/10 12:06:37 DEBUG firewall: iptables --append OUTPUT -o lo -j ACCEPT
2022/03/10 12:06:37 DEBUG firewall: iptables --append OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
2022/03/10 12:06:37 DEBUG firewall: iptables --append INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
2022/03/10 12:06:37 DEBUG firewall: iptables --append OUTPUT -o eth0 -s 172.17.0.5 -d 172.17.0.0/16 -j ACCEPT
2022/03/10 12:06:37 DEBUG firewall: iptables --append INPUT -i eth0 -d 172.17.0.0/16 -j ACCEPT
2022/03/10 12:06:37 INFO firewall: enabled successfully
2022/03/10 12:06:37 INFO storage: creating /gluetun/servers.json with 11096 hardcoded servers
2022/03/10 12:06:37 INFO Alpine version: 3.15.0
2022/03/10 12:06:37 INFO OpenVPN 2.4 version: 2.4.11
2022/03/10 12:06:37 INFO OpenVPN 2.5 version: 2.5.4
2022/03/10 12:06:37 INFO Unbound version: 1.13.2
2022/03/10 12:06:37 INFO IPtables version: v1.8.7
2022/03/10 12:06:37 INFO Settings summary:
β”œβ”€β”€ VPN settings:
|   β”œβ”€β”€ VPN provider settings:
|   |   β”œβ”€β”€ Name: perfect privacy
|   |   └── Server selection settings:
|   |       β”œβ”€β”€ VPN type: openvpn
|   |       β”œβ”€β”€ Cities: amsterdam
|   |       └── OpenVPN server selection settings:
|   |           └── Protocol: UDP
|   └── OpenVPN settings:
|       β”œβ”€β”€ OpenVPN version: 2.5
|       β”œβ”€β”€ User: [set]
|       β”œβ”€β”€ Password: [set]
|       β”œβ”€β”€ Tunnel IPv6: no
|       β”œβ”€β”€ Network interface: tun0
|       β”œβ”€β”€ Run OpenVPN as: root
|       └── Verbosity level: 1
β”œβ”€β”€ DNS settings:
|   β”œβ”€β”€ DNS server address to use: 127.0.0.1
|   β”œβ”€β”€ Keep existing nameserver(s): no
|   └── DNS over TLS settings:
|       β”œβ”€β”€ Enabled: yes
|       β”œβ”€β”€ Update period: every 24h0m0s
|       β”œβ”€β”€ Unbound settings:
|       |   β”œβ”€β”€ Authoritative servers:
|       |   |   └── cloudflare
|       |   β”œβ”€β”€ Caching: yes
|       |   β”œβ”€β”€ IPv6: no
|       |   β”œβ”€β”€ Verbosity level: 1
|       |   β”œβ”€β”€ Verbosity details level: 0
|       |   β”œβ”€β”€ Validation log level: 0
|       |   β”œβ”€β”€ System user: root
|       |   └── Allowed networks:
|       |       β”œβ”€β”€ 0.0.0.0/0
|       |       └── ::/0
|       └── DNS filtering settings:
|           β”œβ”€β”€ Block malicious: yes
|           β”œβ”€β”€ Block ads: no
|           β”œβ”€β”€ Block surveillance: no
|           └── Blocked IP networks:
|               β”œβ”€β”€ 127.0.0.1/8
|               β”œβ”€β”€ 10.0.0.0/8
|               β”œβ”€β”€ 172.16.0.0/12
|               β”œβ”€β”€ 192.168.0.0/16
|               β”œβ”€β”€ 169.254.0.0/16
|               β”œβ”€β”€ ::1/128
|               β”œβ”€β”€ fc00::/7
|               β”œβ”€β”€ fe80::/10
|               β”œβ”€β”€ ::ffff:7f00:1/104
|               β”œβ”€β”€ ::ffff:a00:0/104
|               β”œβ”€β”€ ::ffff:a9fe:0/112
|               β”œβ”€β”€ ::ffff:ac10:0/108
|               └── ::ffff:c0a8:0/112
β”œβ”€β”€ Firewall settings:
|   └── Enabled: yes
β”œβ”€β”€ Log settings:
|   └── Log level: DEBUG
β”œβ”€β”€ Health settings:
|   β”œβ”€β”€ Server listening address: 127.0.0.1:9999
|   β”œβ”€β”€ Address to ping: github.com
|   └── VPN wait durations:
|       β”œβ”€β”€ Initial duration: 5s
|       └── Additional duration: 5s
β”œβ”€β”€ Shadowsocks server settings:
|   └── Enabled: no
β”œβ”€β”€ HTTP proxy settings:
|   └── Enabled: no
β”œβ”€β”€ Control server settings:
|   β”œβ”€β”€ Listening address: :8000
|   └── Logging: yes
β”œβ”€β”€ OS Alpine settings:
|   β”œβ”€β”€ Process UID: 1000
|   └── Process GID: 1000
β”œβ”€β”€ Public IP settings:
|   β”œβ”€β”€ Fetching: every 12h0m0s
|   └── IP file path: /tmp/gluetun/ip
└── Version settings:
    └── Enabled: yes
2022/03/10 12:06:37 INFO routing: default route found: interface eth0, gateway 172.17.0.1
2022/03/10 12:06:37 DEBUG routing: ip rule add from 172.17.0.5/32 lookup 200 pref 100
2022/03/10 12:06:37 INFO routing: adding route for 0.0.0.0/0
2022/03/10 12:06:37 DEBUG routing: ip route replace 0.0.0.0/0 via 172.17.0.1 dev eth0 table 200
2022/03/10 12:06:37 INFO firewall: setting allowed subnets...
2022/03/10 12:06:37 INFO routing: default route found: interface eth0, gateway 172.17.0.1
2022/03/10 12:06:37 INFO TUN device is not available: open /dev/net/tun: no such device; creating it...
2022/03/10 12:06:37 INFO routing cleanup...
2022/03/10 12:06:37 INFO routing: default route found: interface eth0, gateway 172.17.0.1
2022/03/10 12:06:37 INFO routing: deleting route for 0.0.0.0/0
2022/03/10 12:06:37 DEBUG routing: ip route delete 0.0.0.0/0 via 172.17.0.1 dev eth0 table 200
2022/03/10 12:06:37 DEBUG routing: ip rule del from 172.17.0.5/32 lookup 200 pref 100
2022/03/10 12:06:37 ERROR cannot create TUN device file node: file exists
2022/03/10 12:06:37 INFO Shutdown successful

Share your configuration

docker run -it --device /dev/net/tun --rm --cap-add=NET_ADMIN -e LOG_LEVEL=debug -e VPN_SERVICE_PROVIDER="perfect privacy" -e OPENVPN_USER=USERNAME -e OPENVPN_PASSWORD=PASSWORD -e SERVER_CITIES=Amsterdam qmcgaw/gluetun

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Remove --device /dev/net/tun for now. I’ll fix it ASAP πŸ‘

For anyone else having the same issue In a docker compose file, pass the ENV variables as: β€œ- PGID=0 -PUID=0” so the container runs as root.