Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: cannot create TUN device file node: file exists #884

Closed
jnelle opened this issue Mar 10, 2022 · 15 comments
Closed

Bug: cannot create TUN device file node: file exists #884

jnelle opened this issue Mar 10, 2022 · 15 comments

Comments

@jnelle
Copy link

jnelle commented Mar 10, 2022

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
@qdm12
Copy link
Owner

qdm12 commented Mar 10, 2022

Remove --device /dev/net/tun for now. I'll fix it ASAP 👍

@jnelle
Copy link
Author

jnelle commented Mar 10, 2022

Thanks for your fast response! Unfortunately it doesn't work without --device /dev/net/tun too

========================================
=============== 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 15:11:46 INFO routing: default route found: interface eth0, gateway 172.17.0.1
2022/03/10 15:11:46 INFO routing: local ethernet link found: eth0
2022/03/10 15:11:46 INFO routing: local ipnet found: 172.17.0.0/16
2022/03/10 15:11:46 INFO firewall: enabling...
2022/03/10 15:11:46 DEBUG firewall: iptables --policy INPUT DROP
2022/03/10 15:11:46 DEBUG firewall: iptables --policy OUTPUT DROP
2022/03/10 15:11:46 DEBUG firewall: iptables --policy FORWARD DROP
2022/03/10 15:11:46 DEBUG firewall: iptables --append INPUT -i lo -j ACCEPT
2022/03/10 15:11:46 DEBUG firewall: iptables --append OUTPUT -o lo -j ACCEPT
2022/03/10 15:11:46 DEBUG firewall: iptables --append OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
2022/03/10 15:11:46 DEBUG firewall: iptables --append INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
2022/03/10 15:11:46 DEBUG firewall: iptables --append OUTPUT -o eth0 -s 172.17.0.5 -d 172.17.0.0/16 -j ACCEPT
2022/03/10 15:11:46 DEBUG firewall: iptables --append INPUT -i eth0 -d 172.17.0.0/16 -j ACCEPT
2022/03/10 15:11:46 INFO firewall: enabled successfully
2022/03/10 15:11:46 INFO storage: creating /gluetun/servers.json with 11096 hardcoded servers
2022/03/10 15:11:46 INFO Alpine version: 3.15.0
2022/03/10 15:11:46 INFO OpenVPN 2.4 version: 2.4.11
2022/03/10 15:11:46 INFO OpenVPN 2.5 version: 2.5.4
2022/03/10 15:11:46 INFO Unbound version: 1.13.2
2022/03/10 15:11:46 INFO IPtables version: v1.8.7
2022/03/10 15:11:46 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 15:11:46 INFO routing: default route found: interface eth0, gateway 172.17.0.1
2022/03/10 15:11:46 DEBUG routing: ip rule add from 172.17.0.5/32 lookup 200 pref 100
2022/03/10 15:11:46 INFO routing: adding route for 0.0.0.0/0
2022/03/10 15:11:46 DEBUG routing: ip route replace 0.0.0.0/0 via 172.17.0.1 dev eth0 table 200
2022/03/10 15:11:46 INFO firewall: setting allowed subnets...
2022/03/10 15:11:46 INFO routing: default route found: interface eth0, gateway 172.17.0.1
2022/03/10 15:11:46 INFO TUN device is not available: open /dev/net/tun: no such file or directory; creating it...
2022/03/10 15:11:46 INFO routing cleanup...
2022/03/10 15:11:46 INFO routing: default route found: interface eth0, gateway 172.17.0.1
2022/03/10 15:11:46 INFO routing: deleting route for 0.0.0.0/0
2022/03/10 15:11:46 DEBUG routing: ip route delete 0.0.0.0/0 via 172.17.0.1 dev eth0 table 200
2022/03/10 15:11:46 DEBUG routing: ip rule del from 172.17.0.5/32 lookup 200 pref 100
2022/03/10 15:11:46 ERROR cannot Unix Open TUN device file: no such device
2022/03/10 15:11:46 INFO Shutdown successful

@qdm12
Copy link
Owner

qdm12 commented Mar 10, 2022

Actually gluetun is working as expected, I can't fix anything really I think.

Maybe have a look at https://github.com/qdm12/gluetun/wiki/TUN-device-errors see if anything can help in there?

@jnelle
Copy link
Author

jnelle commented Mar 10, 2022

I tried this already as you can see in my first post ^^

@jnelle jnelle closed this as completed Mar 10, 2022
@qdm12 qdm12 reopened this Mar 11, 2022
@qdm12
Copy link
Owner

qdm12 commented Mar 11, 2022

Did you figure it out??

@jnelle
Copy link
Author

jnelle commented Mar 11, 2022

Yes, I just had to run it as sudo

@qdm12
Copy link
Owner

qdm12 commented Mar 11, 2022

@qdm12 qdm12 closed this as completed Mar 11, 2022
@trentwiles
Copy link

Ran as sudo, didn't solve the problem for me.

gluetun        | ========================================
gluetun        | ========================================
gluetun        | =============== gluetun ================
gluetun        | ========================================
gluetun        | =========== Made with ❤️ by ============
gluetun        | ======= https://github.com/qdm12 =======
gluetun        | ========================================
gluetun        | ========================================
gluetun        | 
gluetun        | Running version latest built on 2022-03-13T20:49:55.880Z (commit e2ba2f8)
gluetun        | 
gluetun        | 🔧 Need help? https://github.com/qdm12/gluetun/discussions/new
gluetun        | 🐛 Bug? https://github.com/qdm12/gluetun/issues/new
gluetun        | ✨ New feature? https://github.com/qdm12/gluetun/issues/new
gluetun        | ☕ Discussion? https://github.com/qdm12/gluetun/discussions/new
gluetun        | 💻 Email? quentin.mcgaw@gmail.com
gluetun        | 💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
gluetun        | 2022/03/14 01:21:07 WARN You are using the old environment variable VPNSP, please consider changing it to VPN_SERVICE_PROVIDER
gluetun        | 2022/03/14 01:21:07 WARN You are using the old environment variable REGION, please consider changing it to SERVER_REGIONS
gluetun        | 2022/03/14 01:21:07 INFO routing: default route found: interface eth0, gateway 172.18.0.1 and assigned IP 172.18.0.3
gluetun        | 2022/03/14 01:21:07 INFO routing: local ethernet link found: eth0
gluetun        | 2022/03/14 01:21:07 INFO routing: local ipnet found: 172.18.0.0/16
gluetun        | 2022/03/14 01:21:07 INFO firewall: enabling...
gluetun        | 2022/03/14 01:21:07 INFO firewall: enabled successfully
gluetun        | 2022/03/14 01:21:08 INFO storage: merging by most recent 11096 hardcoded servers and 11096 servers read from /gluetun/servers.json
gluetun        | 2022/03/14 01:21:08 INFO Alpine version: 3.15.0
gluetun        | 2022/03/14 01:21:08 INFO OpenVPN 2.4 version: 2.4.11
gluetun        | 2022/03/14 01:21:08 INFO OpenVPN 2.5 version: 2.5.4
gluetun        | 2022/03/14 01:21:08 INFO Unbound version: 1.13.2
gluetun        | 2022/03/14 01:21:08 INFO IPtables version: v1.8.7
gluetun        | 2022/03/14 01:21:08 INFO Settings summary:
gluetun        | ├── VPN settings:
gluetun        | |   ├── VPN provider settings:
gluetun        | |   |   ├── Name: private internet access
gluetun        | |   |   └── Server selection settings:
gluetun        | |   |       ├── VPN type: openvpn
gluetun        | |   |       ├── Regions: us east
gluetun        | |   |       └── OpenVPN server selection settings:
gluetun        | |   |           ├── Protocol: UDP
gluetun        | |   |           └── Private Internet Access encryption preset: strong
gluetun        | |   └── OpenVPN settings:
gluetun        | |       ├── OpenVPN version: 2.5
gluetun        | |       ├── User: [set]
gluetun        | |       ├── Password: [set]
gluetun        | |       ├── Private Internet Access encryption preset: strong
gluetun        | |       ├── Tunnel IPv6: no
gluetun        | |       ├── Network interface: tun0
gluetun        | |       ├── Run OpenVPN as: root
gluetun        | |       └── Verbosity level: 1
gluetun        | ├── DNS settings:
gluetun        | |   ├── DNS server address to use: 127.0.0.1
gluetun        | |   ├── Keep existing nameserver(s): no
gluetun        | |   └── DNS over TLS settings:
gluetun        | |       ├── Enabled: yes
gluetun        | |       ├── Update period: every 24h0m0s
gluetun        | |       ├── Unbound settings:
gluetun        | |       |   ├── Authoritative servers:
gluetun        | |       |   |   └── cloudflare
gluetun        | |       |   ├── Caching: yes
gluetun        | |       |   ├── IPv6: no
gluetun        | |       |   ├── Verbosity level: 1
gluetun        | |       |   ├── Verbosity details level: 0
gluetun        | |       |   ├── Validation log level: 0
gluetun        | |       |   ├── System user: root
gluetun        | |       |   └── Allowed networks:
gluetun        | |       |       ├── 0.0.0.0/0
gluetun        | |       |       └── ::/0
gluetun        | |       └── DNS filtering settings:
gluetun        | |           ├── Block malicious: yes
gluetun        | |           ├── Block ads: no
gluetun        | |           ├── Block surveillance: no
gluetun        | |           └── Blocked IP networks:
gluetun        | |               ├── 127.0.0.1/8
gluetun        | |               ├── 10.0.0.0/8
gluetun        | |               ├── 172.16.0.0/12
gluetun        | |               ├── 192.168.0.0/16
gluetun        | |               ├── 169.254.0.0/16
gluetun        | |               ├── ::1/128
gluetun        | |               ├── fc00::/7
gluetun        | |               ├── fe80::/10
gluetun        | |               ├── ::ffff:7f00:1/104
gluetun        | |               ├── ::ffff:a00:0/104
gluetun        | |               ├── ::ffff:a9fe:0/112
gluetun        | |               ├── ::ffff:ac10:0/108
gluetun        | |               └── ::ffff:c0a8:0/112
gluetun        | ├── Firewall settings:
gluetun        | |   └── Enabled: yes
gluetun        | ├── Log settings:
gluetun        | |   └── Log level: INFO
gluetun        | ├── Health settings:
gluetun        | |   ├── Server listening address: 127.0.0.1:9999
gluetun        | |   ├── Address to ping: github.com
gluetun        | |   └── VPN wait durations:
gluetun        | |       ├── Initial duration: 5s
gluetun        | |       └── Additional duration: 5s
gluetun        | ├── Shadowsocks server settings:
gluetun        | |   └── Enabled: no
gluetun        | ├── HTTP proxy settings:
gluetun        | |   └── Enabled: no
gluetun        | ├── Control server settings:
gluetun        | |   ├── Listening address: :8000
gluetun        | |   └── Logging: yes
gluetun        | ├── OS Alpine settings:
gluetun        | |   ├── Process UID: 998
gluetun        | |   └── Process GID: 100
gluetun        | ├── Public IP settings:
gluetun        | |   ├── Fetching: every 12h0m0s
gluetun        | |   └── IP file path: /tmp/gluetun/ip
gluetun        | └── Version settings:
gluetun        |     └── Enabled: yes
gluetun        | 2022/03/14 01:21:08 INFO routing: default route found: interface eth0, gateway 172.18.0.1 and assigned IP 172.18.0.3
gluetun        | 2022/03/14 01:21:08 INFO routing: adding route for 0.0.0.0/0
gluetun        | 2022/03/14 01:21:08 INFO firewall: setting allowed subnets...
gluetun        | 2022/03/14 01:21:08 INFO routing: default route found: interface eth0, gateway 172.18.0.1 and assigned IP 172.18.0.3
gluetun        | 2022/03/14 01:21:08 INFO TUN device is not available: open /dev/net/tun: no such device; creating it...
gluetun        | 2022/03/14 01:21:08 INFO routing cleanup...
gluetun        | 2022/03/14 01:21:08 INFO routing: default route found: interface eth0, gateway 172.18.0.1 and assigned IP 172.18.0.3
gluetun        | 2022/03/14 01:21:08 INFO routing: deleting route for 0.0.0.0/0
gluetun        | 2022/03/14 01:21:08 ERROR cannot create TUN device file node: file exists
gluetun        | 2022/03/14 01:21:08 INFO Shutdown successful
^CGracefully stopping... (press Ctrl+C again to force)
Stopping qbittorrent ... done
Stopping gluetun     ... done

@qdm12
Copy link
Owner

qdm12 commented Mar 14, 2022

@RiversideRocks try without --device /dev/net/tun? please share your command.

@trentwiles
Copy link

trentwiles commented Mar 14, 2022

Without device set:

gluetun        | 2022/03/14 11:46:19 INFO routing: default route found: interface eth0, gateway 172.19.0.1 and assigned IP 172.19.0.2
gluetun        | 2022/03/14 11:46:19 INFO routing: adding route for 0.0.0.0/0
gluetun        | 2022/03/14 11:46:19 INFO firewall: setting allowed subnets...
gluetun        | 2022/03/14 11:46:19 INFO routing: default route found: interface eth0, gateway 172.19.0.1 and assigned IP 172.19.0.2
gluetun        | 2022/03/14 11:46:19 INFO TUN device is not available: open /dev/net/tun: no such file or directory; creating it...
gluetun        | 2022/03/14 11:46:19 INFO routing cleanup...
gluetun        | 2022/03/14 11:46:19 INFO routing: default route found: interface eth0, gateway 172.19.0.1 and assigned IP 172.19.0.2
gluetun        | 2022/03/14 11:46:19 INFO routing: deleting route for 0.0.0.0/0
gluetun        | 2022/03/14 11:46:19 ERROR cannot create TUN device file node: operation not permitted
gluetun        | 2022/03/14 11:46:19 INFO Shutdown successful

As per the wiki I'm running as root.

@jnelle
Copy link
Author

jnelle commented Mar 14, 2022

did you start it with sudo or as root user?

@trentwiles
Copy link

I've tried both, as root and with sudo.

@qdm12
Copy link
Owner

qdm12 commented May 8, 2022

Sorry I lost track of this.
Did you figure out why cannot create TUN device file node: operation not permitted failed? Are you sure you passed --cap-add=NET_ADMIN? If so, please create a bug issue sharing your config, logs, OS, kernel etc. asked by the fields to fill up.

@Lord-Soup
Copy link

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.

@qdm12
Copy link
Owner

qdm12 commented Aug 17, 2022

Meh the container runs as root already (must for vpn and firewall), PGID and PUID is used only for subprocesses (openvpn, unbound) and files written (other than the tun device), so I doubt this would make any difference with the tun device creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants