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?

0

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. 

NetworkManager[122408]: xl2tpd[122408]: Maximum retries exceeded for tunnel 50249.  Closing.
NetworkManager[122408]: xl2tpd[122408]: Terminating pppd: sending TERM signal to pid 122409
NetworkManager[122408]: xl2tpd[122408]: Connection 18301 closed to x.x.x.x, port 1701 (Timeout)
pppd[122409]: Terminating on signal 15

PS: the reason why i cant reconnect immediately is a security setting on our VPN Server.

0

Update: It might sound a bit strange, but when I start the Dev Container using VS Code, the VPN connection stays active!

0

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?

docker run --rm hello-world

Please tell me whether your VPN is still connected after that.

Also, could you confirm:

  1. Does your devcontainer.json use dockerComposeFile, or a plain image or dockerFile?
  2. When the VPN drops, does the dev container itself still build and start normally, or does that fail as well?
0

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 ;-)

0

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:

docker compose -f <your compose file> up -d <your service>
docker compose -f <your compose file> up -d --force-recreate <your service>

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.

0

请先登录再写评论。