rancher / quickstart

381 stars 336 forks source link

Vagrant Virtualbox DNS problems #43

Open ghost opened 5 years ago

ghost commented 5 years ago

Hi,

when I'm starting up my rancher quickstart using vagrant, I get the following errors during startup:

    server-01: Error response from daemon: Get https://registry-1.docker.io/v2/appropriate/curl/manifests/latest: Get https://auth.docker.io/token?scope=repository%3Aappropriate%2Fcurl%3Apull&service=registry.docker.io: dial tcp: lookup auth.docker.io on 10.0.16.1:53: read udp 10.0.16.15:33107->10.0.16.1:53: i/o timeout

I tested it on ubuntu bionic and on macos mojave, Virtualbox 6.x, maybe it's because they have their own dns resolver running on the system which isn't bound to the virtualbox interfaces (just guessing, wasn't able to debug it yet).

I found the following line in the Vagrant file: https://github.com/rancher/quickstart/blob/cf814ddbcbfa2c6c77c70daa50d8460300dc2807/vagrant/Vagrantfile#L20 ("--natdnshostresolver1", "on") After removing that line, everything worked very well. Is there a specific reason for this line or would it be possible to remove it?

tdensmore commented 5 years ago

I was getting this error too:

    node-01: Using default tag: latest
    node-01: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 10.0.2.3:53: read udp 10.0.2.15:45193->10.0.2.3:53: i/o timeout
    node-01: + sleep 2
    node-01: + docker inspect appropriate/curl
    node-01: + docker pull appropriate/curl

and commenting out that line did not work for me. The solution for me turned out to be my DNS settings as described here: https://github.com/docker/for-mac/issues/1317

I was using a VPN with custom nameservers.... setting 8.8.8.8 back to the top of the list solved the problem.