colima: Cannot access internet after Colima v0.5.0 upgrade

Description

After upgrading from Colima v0.4.6 to v0.5.0, the DNS resolver in Colima/Docker does not work. I did not encounter this issue when using v0.4.6.

Version

Colima Version:

colima version 0.5.0
git commit: 5a94ab4f098ec0fe94e6d0df8b411fb149fe26fe

runtime: docker
arch: aarch64
client: v20.10.21
server: v20.10.18

Lima Version: 0.14.1 Qemu Version: 7.2.0

Operating System

  • macOS Intel
  • macOS M1
  • Linux

Reproduction Steps

  1. brew upgrade colima -> Upgraded from 0.4.6 to 0.5.0 using Homebrew
  2. colima start
  3. docker pull alpine -> Error response from daemon: Get “https://registry-1.docker.io/v2/”: dial tcp: lookup registry-1.docker.io on 192.168.107.1:53: read udp 192.168.5.15:52036->192.168.107.1:53: i/o timeout
  4. colima ssh
  5. ping google.com -> bad address ‘google.com’
  6. ping 8.8.8.8 -> Normal packet response: 64 bytes from 8.8.8.8: seq=0 ttl=42 time=2500402.173 ms

Expected behaviour

Requests to the Docker registry and other internet addresses would succeed.

Additional context

At least two other engineers at my company are experiencing this issue, which is how I know that it affects both Apple Intel and M1 processors.

I’ve read through some other issues and not identified a fix yet. Issue https://github.com/abiosoft/colima/issues/456 appears similar, but I did not experience problems due to a MacOS upgrade. I was running MacOS 13.0.1 using both Colima v0.4.6 and Colima v0.5.0. Also passing the --dns flag during colima start does not fix the issue.

Issue https://github.com/abiosoft/colima/issues/344 also sounded very similar; however, I did not use Nix to install colima (I use homebrew), and again, colima start --dns 1.1.1.1 did not fix the issue.

I’ve seen mention of VPNs causing this issue (or similar), but I’m experiencing this issue whether or not I’m behind a VPN.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 16 (5 by maintainers)

Most upvoted comments

Thanks for all the answers. This approach worked for me after upgrading to Colima 0.5.2.

colima delete
colima start

Maybe it would be nice to offer colima delete && colima start as a fix from the CLI output when such errors happen. This workaround fixed it for me too.

You didn’t have --vm-type because it’s not available for Monterrey.

Yep, deleting and recreating the profile seems to have fixed the issue for me as well!

I first followed @rfay’s suggestion and created two new profiles, vz and qemu. Both of those had no issues accessing the internet. Then I deleted the default profile and created a new default, and that one is also working like normal. I’ll also note that I did not need to provide --dns or any other options to the start command in order for this to work.

Thanks everyone for the help! I’ll close this issue as it appears we have a fix.

It’s critical that you mention whether you’re on Ventura or Monterrey - could you provide that info?

I’m not having any troubles like this. One thing you might try is to create a new profile and see if it exhibits these problems. Then you’ll know if it has anything to do with your existing profile.

colima start vz --cpu 4 --memory 6 --vm-type=vz --dns=1.1.1.1
colima start qemu--cpu 4 --memory 6 --vm-type=qemu --dns=1.1.1.1 

That would give you two brand new fresh profiles using vz and qemu. You can colima ssh -p vz and colima ssh -p qemu and see what your results are in there.

With ddev you would ddev snapshot --all and then ddev snapshot restore on the new instance. There are other ways to export the contents of a volume that you can find with an internet search, depends on your needs.