aheissenberger / boot2docker

Lightweight Linux for Docker
Apache License 2.0
6 stars 0 forks source link

ifconfig: eth1: error fetching interface information: Device not found #4

Open olalonde opened 10 years ago

olalonde commented 10 years ago

I'm getting an ifconfig: eth1: error fetching interface information: Device not found error when doing boot2docker up.

olalonde commented 10 years ago

I'm also getting VBoxManage: error: Invalid parameter 'interface' when doing boot2docker init

olalonde commented 10 years ago

I think I fixed the issue I was having by redirecting log to stderr:

log() {
      echo "[`date +"%Y-%m-%d %H:%M:%S"`] ${*}" 1>&2
 }
olalonde commented 10 years ago

I'm not getting any errors on init / up now but it seems my VM isn't able to resolve DNS names. dial tcp: lookup index.docker.io: no DNS servers after a docker pull. ping 8.8.8.8 works inside the VM though so it seems to be a DNS issue. I temporarily fixed this by doing echo "nameserver 8.8.8.8" > /etc/resolv.conf"

olalonde commented 10 years ago

I started boot2docker a second time and now getting sed: 1: "'/docker/d'": invalid command code ' error :(

aheissenberger commented 10 years ago

What version of boot2docker do you use and on what system? What is the version of VBoxManager?

aheissenberger commented 10 years ago

please download the latest release of the boot2docker script and the ISO https://github.com/aheissenberger/boot2docker/releases

olalonde commented 10 years ago

I'm now using your latest script (https://raw.github.com/aheissenberger/boot2docker/master/boot2docker) and your latest ISO release (https://github.com/aheissenberger/boot2docker/releases/download/0.6.0%2Bah/boot2docker.iso).

$ VBoxManage --version
4.3.6r91406
$ uname -v
Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64

(OS X 10.9.1 and latest stable VirtualBox)

I am now getting the following error after a fresh init:

$ boot2docker up
[2014-02-22 20:37:16] Starting boot2docker-vm...
[2014-02-22 20:37:36] add 'docker 192.168.59.101' to /etc/hosts
sed: 1: "'/docker/d'": invalid command code '
[2014-02-22 20:37:36] Started.

Here's what I'm getting when running bash -x boot2docker up:

$ bash -x boot2docker up

[...]

++ ssh -i /var/folders/h7/1_xmk89s7r59nbp_ygsmbnkc0000gp/T/b2d.rUNpTTxf -o StrictHostKeyChecking=no -o LogLevel=quiet -o UserKnownHostsFile=/dev/null -p 2022 docker@localhost ifconfig eth1
++ rm /var/folders/h7/1_xmk89s7r59nbp_ygsmbnkc0000gp/T/b2d.rUNpTTxf
+ DOCKER_HOST_IP=192.168.59.101
+ grep -q '192.168.59.101\s\+docker' /etc/hosts
+ [[ 1 == \1 ]]
+ log 'add '\''docker 192.168.59.101'\'' to /etc/hosts'
++ date '+%Y-%m-%d %H:%M:%S'
+ echo '[2014-02-22 20:38:55] add '\''docker 192.168.59.101'\'' to /etc/hosts'
[2014-02-22 20:38:55] add 'docker 192.168.59.101' to /etc/hosts
+ MHD_HD_EXPORT_CMD='sudo sed -i.bak '\''/docker/d'\'' /etc/hosts; sudo echo "192.168.59.101 docker" >> /etc/hosts'
+ [[ Darwin == \D\a\r\w\i\n ]]
+ MHD_HD_EXPORT_CMD='sudo sed -i.bak '\''/docker/d'\'' /etc/hosts; sudo echo "192.168.59.101 docker" >> /etc/hosts; sudo killall -HUP mDNSResponder'
+ sudo -v
+ [[ 0 == \1 ]]
+ sudo sed -i.bak ''\''/docker/d'\''' '/etc/hosts;' sudo echo '"192.168.59.101' 'docker"' '>>' '/etc/hosts;' sudo killall -HUP mDNSResponder
sed: 1: "'/docker/d'": invalid command code '
+ mod_bashprofile
+ grep -q 'export DOCKER_HOST=' /Users/olalonde/.bash_profile
+ [[ 0 == \1 ]]
+ log Started.
++ date '+%Y-%m-%d %H:%M:%S'
+ echo '[2014-02-22 20:38:55] Started.'
[2014-02-22 20:38:55] Started.
+ '[' tcp://localhost:4243 '!=' tcp://localhost:4243 ']'

At least, it seems the DNS issue is fixed now as I am able to pull images from the docker index.

aheissenberger commented 10 years ago

download the lastest version of boot2docker - fixed the problem - this is a problem which does not exits with older versions of sed

olalonde commented 10 years ago

Thanks but still getting an error :(

+ sudo sed -i.bak -e ''\''/docker/d'\''' '/etc/hosts;' sudo echo '"192.168.59.101' 'docker"' '>>' '/etc/hosts;' sudo killall -HUP mDNSResponder
sed: 1: "'/docker/d'
": invalid command code '

I wish I could help but I've never used sed before.

aheissenberger commented 10 years ago

can you please try this:

echo "1.1.1.1 dummy" > hosts.test
echo "9.9.9.9 docker" >> hosts.test
sed -i .bak -E '/docker/d' hosts.test

if will search for a line containing the word "docker" and will delete this line

if it works update to the latest version

olalonde commented 10 years ago

Yes it works.

$ echo "1.1.1.1 dummy" > hosts.test
$ echo "9.9.9.9 docker" >> hosts.test
$ sed -i .bak -E '/docker/d' hosts.test
$ cat hosts.test
1.1.1.1 dummy

I'm still getting an error with the latest boot2docker script though.

+ sudo -v
+ [[ 0 == \1 ]]
+ sudo sed -i .bak -E ''\''/docker/d'\''' '/etc/hosts;' sudo echo '"192.168.59.101' 'docker"' '>>' '/etc/hosts;' sudo killall -HUP mDNSResponder
sed: 1: "'/docker/d'": invalid command code '
+ mod_profile
./boot2docker: line 401: mod_profile: command not found
+ log Started.