You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: on macOS Sequoia cannot ping out from container (but DNS works!) #345
If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
% container run --rm alpine:3.20 ping google.com
PING google.com (142.250.81.238): 56 data bytes
--- google.com ping statistics ---
15 packets transmitted, 0 packets received, 100% packet loss
% ping google.com
PING google.com (142.250.81.238): 56 data bytes
64 bytes from 142.250.81.238: icmp_seq=0 ttl=119 time=8.748 ms
64 bytes from 142.250.81.238: icmp_seq=1 ttl=119 time=9.641 ms
In an earlier boot of the system, I was able to get this working through some combination of container system stop, pkill -f container-network-vmnet, container builder {stop,start,delete}, but now that doesn't work either.
Current behavior
Ping times out.
Expected behavior
Ping doesn't time out.
Environment
- OS: Darwin L03G26TD12 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:53:27 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6041 arm64
- Xcode: CLT only
- Container: container CLI version 0.2.0 (build: release, commit: 3b5c253)
Relevant log output
Code of Conduct
I agree to follow this project's Code of Conduct
Reacted by Steinway Wu, Matt Ranostaj, Alex, SANJEEVI KUMAR, Jean-Charles Giardina, lucruum, Andrew Stec, Denys Bushuliak and halo
I actually ended up switching to main and building manually. The recent fix from IIRC June 30 seems to have fixed this for me. I’m away right now so I can’t find the closed issue.
I stand corrected, TCP does work. Though I think this is a different condition than what I saw originally (I had closed the laptop lid between when I filed this issue and now). The current state is that ping continues to fail, but:
My mistake, I'd done the build but hadn't tested it yet. #276 was the PR I thought fixed this but I'm still seeing the issue on main.
$ container run -it --rm alpine:3.20 sh -c 'apk add curl ; curl https://google.com'
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/aarch64/APKINDEX.tar.gz
WARNING: updating and opening https://dl-cdn.alpinelinux.org/alpine/v3.20/main: temporary error (try again later)
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/aarch64/APKINDEX.tar.gz
WARNING: updating and opening https://dl-cdn.alpinelinux.org/alpine/v3.20/community: temporary error (try again later)
ERROR: unable to select packages:
curl (no such package):
required by: world[curl]
sh: curl: not found
I also use a corp-mandated VPN (tailscale), which may also be relevant. HTTP works when I disable the VPN (and through some magic number of container system stop/start. ICMP never works.
I stand corrected, TCP does work. Though I think this is a different condition than what I saw originally (I had closed the laptop lid between when I filed this issue and now).
I agree, from what you described, it sounds like you had a period where nothing worked, and a period where you saw that just ICMP wasn't working. We'll keep trying things!
@tamird@calebhearth Can you see the attributes for your VPN interface when you run ifconfig? If so, can you see what the MTU is set to and let me know here?
Another other thing that can help us narrow down the issue is to see whether you see the same problem (ping and curl) with an image that uses different distribution than Alpine.
My hypothesis right now is your container network traffic is getting dropped due to the MTU of the VPN, and that there's a separate issue where ICMP not going anywhere on Alpine.
On my system, I see the following:
My VPN MTU is 1390 (larger than the 1280 we use in the container)
curl works on Alpine but ping (to anything other than the container's IP or loopback) fails
Well this is a bit embarrassing and pretty obvious when you think about it... so for Tailscale just disable "Allow Local Network Access" and ping and network connectivity works as expected. And can confirm container traffic is bring routed via the utunX interface.
Half tempted to see if this is an issue with the WireGuard MacOS client as well but with 192.168.151.1/24 allow in AllowedIPs to route with the source IP in that range.
Maybe need to raise an issue with Tailscale but want to see if everyone else can confirm this first...
Don't think there is a command line option to allow list a certain RFC1918 private range to be handled by the Tailscale client that get routed locally.
I'm having similar issues when running a container with VPN. In my case, I use GlobalProtect so I'm not sure if there's a similar option to allow local network access. What's odd is that we use split tunneling by default, but the networking inside the container is impacted as long as VPN is on (whether it's using the split tunneling or full tunneling).
But, in my case, it's not just ping that is impacted but all network traffic. For example, running apt update in an debian:latest container just times out. Even weirder, I can run container run -it --rm alpine/curl https://google.com successfully. But, if I try to run alpine:latest I run into issues:
% container run --rm -it alpine:latest sh
/ # apk add curl
fetch https://dl-cdn.alpinelinux.org/alpine/v3.22/main/aarch64/APKINDEX.tar.gz
WARNING: updating and opening https://dl-cdn.alpinelinux.org/alpine/v3.22/main: temporary error (try again later)
fetch https://dl-cdn.alpinelinux.org/alpine/v3.22/community/aarch64/APKINDEX.tar.gz
WARNING: updating and opening https://dl-cdn.alpinelinux.org/alpine/v3.22/community: temporary error (try again later)
ERROR: unable to select packages:
curl (no such package):
required by: world[curl]
I did confirm it wasn't an issue with the dl-cdn.alpinelinux.org, as I'm able to reach that with alpine/curl.
I looked into the MTU issue, although I'm not sure if that would impact this. It looks like with VPN disabled and VPN split tunnel it is fails at 1501, but with VPN full tunnel it fails at 1025.
I'm not sure how to interpret the issues between these images. As far as I can tell alpine/curl doesn't do much different but I could be missing something.
I'm also seeing similar issues on macOS 26 with Tailscale, although perhaps slightly different?
I use both tailscale and cloudflare WARP.
container run -it --rm alpine/curl https://google.com: works with or without tailscale, does not work with WARP. container run -it --rm alpine ping 8.8.8.8; doesn't work at all.
Neither of these work for me with Tailscale enabled or disabled.
Edit: to clarify, just running the Mullvad VPN daemon is causing this (regardless of whether or not I'm connected to a VPN). Connecting to a VPN causes all network traffic to stop working (for example, ping 1.1.1.1 times out).
@austinlparker That's worth looking into, thanks! It could be that there are two separate things at work here though. That Tailscale issue is more about domain search configuration it seems, and possibly resolver priority.
It might be the case that we can make some config changes to make the scoped DNS behave well in more system configurations, but the issue with mDNSResponder and other DNS resolvers fighting over port 53 seems a separate problem.
Yeah, I think we should strive to get an update. I'm just switching over from Docker to Apple's Container and using socktainer / docker's client, etc. It seems like a solid setup. This will become a much more common issue soon.
Is there any update on getting apple/container working with Mullvad?
Activity
tamird commentedon Jul 16, 2025
Ah, and because I've seen #272 and #148:
and I'm attaching the log from running
while running
container run --rm alpine:3.20 ping google.com.log.txt
calebhearth commentedon Jul 16, 2025
I'm running into this currently as well!
jglogan commentedon Jul 17, 2025
@calebhearth did you check
ipconfigandcontainer lsas well?See: https://github.com/apple/container/blob/main/docs/technical-overview.md#container-ip-addresses
jglogan commentedon Jul 17, 2025
@tamird and @calebhearth - could you both try this and post your results?
container run -it --rm alpine:3.20 sh -c 'apk add curl ; curl https://google.com'my output:
tamird commentedon Jul 17, 2025
These are both in the first comment.
tamird commentedon Jul 17, 2025
It doesn't work because there's no network access.
apk adddoesn't work without network.calebhearth commentedon Jul 17, 2025
I actually ended up switching to main and building manually. The recent fix from IIRC June 30 seems to have fixed this for me. I’m away right now so I can’t find the closed issue.
jglogan commentedon Jul 17, 2025
The test I asked for was to see whether TCP was working.
It's possible to not be able to ping and still be able to curl, if it's specifically ICMP that's not working.
Did the command produce no output? If it produced any error output, what was it?
tamird commentedon Jul 17, 2025
I stand corrected, TCP does work. Though I think this is a different condition than what I saw originally (I had closed the laptop lid between when I filed this issue and now). The current state is that ping continues to fail, but:
calebhearth commentedon Jul 17, 2025
My mistake, I'd done the build but hadn't tested it yet. #276 was the PR I thought fixed this but I'm still seeing the issue on main.
calebhearth commentedon Jul 17, 2025
FWIW, effectively all network activity on my system is routed through a VPN which I cannot disable. That may or may not be relevant.
When I use
container runI'm able to pass--dns x.x.x.xand make network connections outside successfully:tamird commentedon Jul 17, 2025
I also use a corp-mandated VPN (tailscale), which may also be relevant. HTTP works when I disable the VPN (and through some magic number of
container system stop/start. ICMP never works.jglogan commentedon Jul 17, 2025
I agree, from what you described, it sounds like you had a period where nothing worked, and a period where you saw that just ICMP wasn't working. We'll keep trying things!
jglogan commentedon Jul 17, 2025
@tamird @calebhearth Can you see the attributes for your VPN interface when you run ifconfig? If so, can you see what the MTU is set to and let me know here?
Another other thing that can help us narrow down the issue is to see whether you see the same problem (ping and curl) with an image that uses different distribution than Alpine.
My hypothesis right now is your container network traffic is getting dropped due to the MTU of the VPN, and that there's a separate issue where ICMP not going anywhere on Alpine.
On my system, I see the following:
14 remaining items
mranostay commentedon Aug 13, 2025
Well this is a bit embarrassing and pretty obvious when you think about it... so for Tailscale just disable "Allow Local Network Access" and ping and network connectivity works as expected. And can confirm container traffic is bring routed via the utunX interface.
Half tempted to see if this is an issue with the WireGuard MacOS client as well but with 192.168.151.1/24 allow in AllowedIPs to route with the source IP in that range.
Maybe need to raise an issue with Tailscale but want to see if everyone else can confirm this first...
Don't think there is a command line option to allow list a certain RFC1918 private range to be handled by the Tailscale client that get routed locally.
jamal commentedon Aug 25, 2025
I'm having similar issues when running a container with VPN. In my case, I use GlobalProtect so I'm not sure if there's a similar option to allow local network access. What's odd is that we use split tunneling by default, but the networking inside the container is impacted as long as VPN is on (whether it's using the split tunneling or full tunneling).
But, in my case, it's not just ping that is impacted but all network traffic. For example, running
apt updatein andebian:latestcontainer just times out. Even weirder, I can runcontainer run -it --rm alpine/curl https://google.comsuccessfully. But, if I try to runalpine:latestI run into issues:I did confirm it wasn't an issue with the dl-cdn.alpinelinux.org, as I'm able to reach that with
alpine/curl.I looked into the MTU issue, although I'm not sure if that would impact this. It looks like with VPN disabled and VPN split tunnel it is fails at 1501, but with VPN full tunnel it fails at 1025.
I'm not sure how to interpret the issues between these images. As far as I can tell
alpine/curldoesn't do much different but I could be missing something.jglogan commentedon Sep 15, 2025
@jamal If you run
container system stopand then disable and enable your VPN, what do you get for:For your VPN MTU, is there a way to increase it to 1280?
https://docs.paloaltonetworks.com/globalprotect/5-2/globalprotect-app-new-features/new-features-released-in-gp-app/configurable-maximum-transmission-unit-for-globalprotect-connections
austinlparker commentedon Sep 17, 2025
I'm also seeing similar issues on macOS 26 with Tailscale, although perhaps slightly different?
Neither of these work for me with Tailscale enabled or disabled.
nlordell commentedon Sep 30, 2025
Just wanted to report that I also see this with other VPNs (specifically Mullvad VPN):
With Mullvad VPN enabled:
After disabling Mullvad:
Note that if I manually specify a
--dns, then things work:Edit: to clarify, just running the Mullvad VPN daemon is causing this (regardless of whether or not I'm connected to a VPN). Connecting to a VPN causes all network traffic to stop working (for example,
ping 1.1.1.1times out).jglogan commentedon Oct 1, 2025
@austinlparker @nlordell If you do the following, what do you see for the
lsofoutput?container system stopsudo lsof -i :53nlordell commentedon Oct 1, 2025
And that is the
mullvad-daemon:Edit: I guess my issue is related to #696, DNS queries over TCP seem to work when the VPN daemon is running.
y0grt commentedon Oct 6, 2025
ping works again if you disable stealth mode
it doesn't matter the status of the firewall, even if you turn it off, ping doesn't work until you disable stealth mode (maybe requires a reboot)
austinlparker commentedon Oct 6, 2025
what's interesting is that I actually tried to remove tailscale entirely. I think this might be something related to my firewall config profile?
austinlparker commentedon Oct 6, 2025
hm, removing dnsmasq fixed it
austinlparker commentedon Oct 28, 2025
someone else pointed me to this Tailscale issue that seems related - tailscale/tailscale#17096
jglogan commentedon Oct 28, 2025
@austinlparker That's worth looking into, thanks! It could be that there are two separate things at work here though. That Tailscale issue is more about domain search configuration it seems, and possibly resolver priority.
It might be the case that we can make some config changes to make the scoped DNS behave well in more system configurations, but the issue with mDNSResponder and other DNS resolvers fighting over port 53 seems a separate problem.
I created #817 to investigate it.
reesericci commentedon Apr 20, 2026
Is there any update on getting apple/container working with Mullvad?
andrewstec commentedon May 17, 2026
Yeah, I think we should strive to get an update. I'm just switching over from Docker to Apple's Container and using socktainer / docker's client, etc. It seems like a solid setup. This will become a much more common issue soon.
dmgb commentedon Jun 1, 2026
for me this works:
sudo sysctl -w net.inet.ip.forwarding=1/etc/pf.confsudo route add -net 192.168.64.0/24 -interface utun4container run --rm -it --dns 100.64.0.63 alpine