qdm12 / gluetun

VPN client in a thin Docker container for multiple VPN providers, written in Go, and using OpenVPN or Wireguard, DNS over TLS, with a few proxy servers built-in.
https://hub.docker.com/r/qmcgaw/gluetun
MIT License
6.71k stars 331 forks source link

Bug: Gluetun container keeps erasing as soon as I close the command prompt #2227

Closed bricha5 closed 2 months ago

bricha5 commented 2 months ago

Is this urgent?

None

Host OS

No response

CPU arch

None

VPN service provider

Mullvad

What are you using to run the container

docker run

What is the version of Gluetun

2024-04-08T07:43:05.096Z

What's the problem πŸ€”

I run every scripts on my windows pc's command prompt. Everything works, but I can't close the command prompt window, the whole container disappear. I'm new to this, so there must be something I do wrong.

Share your logs (at least 10 lines)

β”œβ”€β”€ DNS settings:

|   β”œβ”€β”€ Keep existing nameserver(s): no

|   β”œβ”€β”€ DNS server address to use: 127.0.0.1

|   └── 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:127.0.0.1/104

|               β”œβ”€β”€ ::ffff:10.0.0.0/104

|               β”œβ”€β”€ ::ffff:169.254.0.0/112

|               β”œβ”€β”€ ::ffff:172.16.0.0/108

|               └── ::ffff:192.168.0.0/112

β”œβ”€β”€ Firewall settings:

|   └── Enabled: yes

β”œβ”€β”€ Log settings:

|   └── Log level: info

β”œβ”€β”€ Health settings:

|   β”œβ”€β”€ Server listening address: 127.0.0.1:9999

|   β”œβ”€β”€ Target address: cloudflare.com:443

|   β”œβ”€β”€ Duration to wait after success: 5s

|   β”œβ”€β”€ Read header timeout: 100ms

|   β”œβ”€β”€ Read timeout: 500ms

|   └── VPN wait durations:

|       β”œβ”€β”€ Initial duration: 6s

|       └── 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

|   └── Public IP data API: ipinfo

└── Version settings:

    └── Enabled: yes

2024-04-16T23:11:33Z INFO [routing] default route found: interface eth0, gateway 172.17.0.1, assigned IP 172.17.0.6 and family v4

2024-04-16T23:11:33Z INFO [routing] adding route for 0.0.0.0/0

2024-04-16T23:11:33Z INFO [firewall] setting allowed subnets...

2024-04-16T23:11:33Z INFO [routing] default route found: interface eth0, gateway 172.17.0.1, assigned IP 172.17.0.6 and family v4

2024-04-16T23:11:33Z INFO TUN device is not available: open /dev/net/tun: no such file or directory; creating it...

2024-04-16T23:11:33Z INFO [dns] using plaintext DNS at address 1.1.1.1

2024-04-16T23:11:33Z INFO [http server] http server listening on [::]:8000

2024-04-16T23:11:33Z INFO [healthcheck] listening on 127.0.0.1:9999

2024-04-16T23:11:33Z INFO [firewall] allowing VPN connection...

2024-04-16T23:11:33Z INFO [openvpn] OpenVPN 2.5.8 aarch64-alpine-linux-musl [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Nov  2 2022

2024-04-16T23:11:33Z INFO [openvpn] library versions: OpenSSL 3.1.4 24 Oct 2023, LZO 2.10

2024-04-16T23:11:33Z INFO [openvpn] TCP/UDP: Preserving recently used remote address: [AF_INET]45.133.182.194:1194

2024-04-16T23:11:33Z INFO [openvpn] UDP link local: (not bound)

2024-04-16T23:11:33Z INFO [openvpn] UDP link remote: [AF_INET]45.133.182.194:1194

2024-04-16T23:11:33Z WARN [openvpn] 'link-mtu' is used inconsistently, local='link-mtu 1557', remote='link-mtu 1534'

2024-04-16T23:11:33Z WARN [openvpn] 'auth' is used inconsistently, local='auth SHA1', remote='auth [null-digest]'

2024-04-16T23:11:33Z INFO [openvpn] [ca-mtr-ovpn-002.mullvad.net] Peer Connection Initiated with [AF_INET]45.133.182.194:1194

2024-04-16T23:11:35Z INFO [openvpn] setsockopt TCP_NODELAY=1 failed

2024-04-16T23:11:35Z INFO [openvpn] TUN/TAP device tun0 opened

2024-04-16T23:11:35Z INFO [openvpn] /sbin/ip link set dev tun0 up mtu 1500

2024-04-16T23:11:35Z INFO [openvpn] /sbin/ip link set dev tun0 up

2024-04-16T23:11:35Z INFO [openvpn] /sbin/ip addr add dev tun0 10.8.0.15/16

2024-04-16T23:11:35Z INFO [openvpn] UID set to nonrootuser

2024-04-16T23:11:35Z INFO [openvpn] Initialization Sequence Completed

2024-04-16T23:11:35Z INFO [dns] downloading DNS over TLS cryptographic files

2024-04-16T23:11:36Z INFO [dns] downloading hostnames and IP block lists

2024-04-16T23:11:36Z INFO [healthcheck] healthy!

2024-04-16T23:11:40Z INFO [dns] init module 0: validator

2024-04-16T23:11:40Z INFO [dns] init module 1: iterator

2024-04-16T23:11:40Z INFO [dns] start of service (unbound 1.19.3).

2024-04-16T23:11:40Z INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN

2024-04-16T23:11:40Z INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN

2024-04-16T23:11:40Z INFO [dns] ready

2024-04-16T23:11:40Z INFO [ip getter] Public IP address is 45.133.182.236 (Canada, Quebec, MontrΓ©al)

2024-04-16T23:11:41Z INFO [vpn] You are running on the bleeding edge of latest!

Share your configuration

No response

github-actions[bot] commented 2 months ago

@qdm12 is more or less the only maintainer of this project and works on it in his free time. Please:

frepke commented 2 months ago

Which scripts are you referring to? Can you share them? How do you run your container?

bricha5 commented 2 months ago

I'll try my best. I ran the following in command prompt:

docker pull qmcgaw/gluetun

Then I went there: setup/providers

Then I ran: # OpenVPN docker run -it --rm --cap-add=NET_ADMIN -e VPN_SERVICE_PROVIDER=mullvad \ -e VPN_TYPE=openvpn -e OPENVPN_USER=[my id number] \ -e SERVER_CITIES=amsterdam qmcgaw/gluetun

And that's it. After that, I'm seeing a new container in portainer, which work just fine as a VPN as intented, but it will only exist until I shut down the command prompt window on my computer. Obviously, my goal is for it to be running 24/7. I'm new to all of this maybe I'm missing a few steps that weren't included in the repo.

Thanks in advance!

frepke commented 2 months ago

Try "docker run -d" instead of "-it --rm" -d runs the container in the background.

bricha5 commented 2 months ago

Omg that worked! Thank you very much!

qdm12 commented 2 months ago

Thanks @frepke! @bricha5 -d stands for daemon so it runs in the background. You can access its logs with docker logs <container-name>, stop it with docker stop <container-name> and remove it with docker rm <container-name>

github-actions[bot] commented 2 months ago

Closed issues are NOT monitored, so commenting here is likely to be not seen. If you think this is still unresolved and have more information to bring, please create another issue.

This is an automated comment setup because @qdm12 is the sole maintainer of this project which became too popular to monitor issues closed.