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

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.

0

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:

  1. Connect the VPN, then reproduce the drop by starting the dev container the way you normally do.
  2. Do not restart the IDE afterward. If the JetBrains Client window opened before the VPN disconnected, select Help | Collect Host and Client Logs from that window. Otherwise, select Help | Collect Logs and Diagnostic Data in the local PhpStorm window.
  3. Upload the resulting archive to the JetBrains Upload Service and share the Upload ID here. 

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:

sudo journalctl --since "1 hour ago" > vpn.txt

Please add vpn.txt to 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:

  • The approximate time when you started the dev container
  • The approximate time when the VPN disconnected

Could you also answer the following questions?

  1. When starting from the Welcome screen, do you open an existing dev container or initiate a new build?
  2. When you say "switching from a local project to remote", do you mean starting the project in a dev container? If so, how do you usually do this: through the Reopen in Container notification, the context menu for devcontainer.json, or something else?
  3. What error do you receive in native mode? The exact message or a screenshot is sufficient.

Please reproduce the native-mode problem separately, after collecting the logs for the VPN disconnection, so the two runs do not become mixed together.

0
  1. When starting from the Welcome screen, do you open an existing dev container or initiate a new build?
  2. When you say "switching from a local project to remote", do you mean starting the project in a dev container? If so, how do you usually do this: through the Reopen in Container notification, the context menu for devcontainer.json, or something else?

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)

0

请先登录再写评论。