Unable to connect to IPsec VPN after running Dev Container
Hello,
i am using latest Manjaro Linux with Gnome Desktop and PhpStorm. I have also configured some Dev Container and they working also fine (running the IDE in Remote Mode).
When i work from home i need also VPN. The connection is configured in NetworkManager and its usually working fine.
But running a Dev Containers will break my already established VPN connection and i am not able to reconnect anymore, even not after stopping the IDE/Dev Container! The connection to VPN Server timed out (UDP port 500).
I have to restart my whole PC to reconnect VPN successfully. I am actually have absolutely no idea what's wrong here, so i have checked the the network setting before and after running the Dev Container.
What i have checked so far:
- restart docker.service and NetworkManager.service → don't help, can't still reconnect
- Kill Gnome and start a new Gnome Shell or Logoff/Login User → don't help, can't still reconnect
- routing table ("ip route show") is the same like before, no changes
- Ethernet adapters and bridges ("ip a") are the same like before, no changes
- package filter ("iptables -L") are the same like before, no changes
Could anybody help me to find the problem?
请先登录再写评论。
Update:
The VPN connection will be lost because the pppd (Point-to-Point Protocol daemon) are stopped and the tunnel device are removed. I don't know why! The ppp0 device is not part of any bridge. Maybe it is a docker or kernel problem.
Workaround: Disconnect VPN, start Dev Container, connect VPN again.
PS: the reason why i cant reconnect immediately is a security setting on our VPN Server.
Update: It might sound a bit strange, but when I start the Dev Container using VS Code, the VPN connection stays active!
Hi Paul,
Which PhpStorm version are you running?
With the VPN connected and the IDE closed, could you try running the following command in the terminal?
Please tell me whether your VPN is still connected after that.
Also, could you confirm:
devcontainer.jsonusedockerComposeFile, or a plainimageordockerFile?Hello Petar Milunovic
I am using devcontainer.json with dockerComposeFile and latest PhpStorm (2026.2.1). The dev container is allway working well.
"docker run" don't interrupt anything. I've testet this 1000 times. Even with the same docker-compose.yml file referenced by dockerComposeFile in my devcontainer.json.
I guess it's the heavy system load during start of phpstrom thats break VPN. Because it happens “only” in 9/10 times ;-)
Hi Paul, thanks for the additional details.
I have not reproduced this, but I have a theory about what might be happening. When PhpStorm starts a compose-based dev container, it runs
docker compose up -d --force-recreate, which may be causing the issue in your setup.To check this, please close PhpStorm, connect to the VPN, and then run the following commands from the directory that holds your
devcontainer.json:Please run the first command twice. The second run should report that the container is already running, which gives us a clean baseline. Then run the second command with
--force-recreate. Please let me know whether the VPN connection survives each step.There is also a workaround worth testing. In File | Settings | Advanced Settings, under Dev Containers, enable Open devcontainer projects natively. In this mode, the IDE connects to the container directly instead of downloading and running a backend IDE inside it, so several short-lived helper containers are no longer started. This setting is disabled by default and is still in development, but it is worth trying.
After enabling it, close any currently open projects. Then, from the Welcome screen, go to Remote Development | Dev Containers, build a new dev container, and check whether this causes your VPN connection to drop.
Dear Petar Milunovic
docker compose up, even running twice or with ---force-recreate will not break my ipsec vpn, never!
dev container native mode never work for me. Obviously the IDE can't start the IDE backend or something.
Hi Paul, thanks for retesting.
So far, it is not clear to me what could be causing this issue. Could you please collect the IDE logs after reproducing it? They should give me a better idea of what is happening:
The IDE logs will not contain enough information about the network connection itself, so please also collect the system journal immediately after reproducing the issue:
Please add
vpn.txtto the same upload. The journal may contain system details such as IP addresses and hostnames, so you may want to review it before uploading. The uploaded files will be accessible only to JetBrains employees.To correlate the logs, please note:
Could you also answer the following questions?
devcontainer.json, or something else?Please reproduce the native-mode problem separately, after collecting the logs for the VPN disconnection, so the two runs do not become mixed together.
i am sorry, please forget it. I have edited my last post, it was not correct. When PhpStorm backend start the connection will be lost in the most cases (journalctl reported then a timeout to VPN gateway)