machine-drivers / docker-machine-driver-xhyve

docker-machine/minikube/minishift driver plugin for xhyve/hyperkit (native macOS hypervisor.framework)
https://godoc.org/github.com/machine-drivers/docker-machine-driver-xhyve
BSD 3-Clause "New" or "Revised" License
889 stars 73 forks source link

IP never found for Mac in DHCP leases #9

Open nathanleclaire opened 8 years ago

nathanleclaire commented 8 years ago

So, I am unable to successfully create a machine.

zchee commented 8 years ago

@nathanleclaire When it did not find the IP? https://github.com/zchee/docker-machine-xhyve/blob/master/xhyve.go#L254 ?

zchee commented 8 years ago

@nathanleclaire Cause I do not know yet,It does not work to be using the boot2docker experimental iso.

nathanleclaire commented 8 years ago

@zchee Yep, that's the line.

Cause I do not know yet,It does not work to be using the boot2docker experimental iso.

I'm not sure what you mean. Should I be using --xhyve-boot2docker-url?

zchee commented 8 years ago

@nathanleclaire

Should I be using --xhyve-boot2docker-url?

Not required. https://github.com/boot2docker/boot2docker/releases/tag/v1.9.0 works fine. https://github.com/boot2docker/boot2docker/blob/master/Dockerfile.experimental does not works.

I will take a screencast later.

zchee commented 8 years ago

@nathanleclaire Sorry, I missed! I did not push.

See https://github.com/zchee/docker-machine-xhyve/commit/0491262bf8d942be7ed56d171844eba8c6a8541a

and, screencast: https://asciinema.org/a/29930

nathanleclaire commented 8 years ago

I pulled latest but still running into the IP lookup issue.

I'm on Yosemite FWIW. Maybe I need to upgrade xhyve?

zchee commented 8 years ago

@nathanleclaire Hmm... Hypervisor.framework also vmnet.framework need MacOS X 10.10 (Yosemite). but, If you can build xhyve-bindings, OS X kernel support the both frameworks.

Would you try rebuild latest xhyve-bindings?

and, following is the checkpoint,

Show syscall of goxhyve. result, e.g.

08:49:40  lseek                         0.000003   goxhyve
08:49:40  writev                        0.000027   goxhyve
08:49:40  lseek                         0.000001   goxhyve
08:49:40  writev                        0.000004   goxhyve
08:49:40    HFS_update                  0.000013   goxhyve
08:49:40  fsync                         0.000782   goxhyve
08:49:40  lseek                         0.000002   goxhyve
08:49:40  writev                        0.000024   goxhyve
08:49:40    HFS_update                  0.000007   goxhyve
08:49:40  fsync                         0.000241   goxhyve
08:49:44  lseek                         0.000003   goxhyve
08:49:44  writev                        0.000012   goxhyve

Check dhcpd_leases. xhyve_vm_macaddr e.g. b6:11:64:42:cf:32. It is displayed in the log of when you create the xhyve vm. e.g. sudo cat /var/db/dhcpd_leases | grep b6:11:64:42:cf:32

If ‘/var/db/dhcpd_leases’: No such file or directory, try sudo touch /var/db/dhcpd_leases

result,

-rwsr-xr-x 1 root wheel 15977276 Nov 13 05:06 /Users/zchee/go/bin/docker-machine-driver-xhyve

To avoid sudo docker-machine ..., driver binary must be root:wheel user. and -rwsr-xr-x. This is because the require sudo when GetMACAddressByUUID() https://github.com/zchee/docker-machine-xhyve/blob/master/vmnet/vmnet.go#L23-L33 but goxhyve not required root:wheel

I think it's because goxhyve does not run if the ip can not get.

This loop will go to 60? https://github.com/zchee/docker-machine-xhyve/blob/master/xhyve.go#L253-L265

zchee commented 8 years ago

@nathanleclaire FYI,

I'm on Yosemite FWIW. Maybe I need to upgrade xhyve?

Not required. docker-machine-xhyve does not execute xhyve. goxhyve instead xhyve

zchee commented 8 years ago

@nathanleclaire I reinstall and tested Yosemite 10.10.5, but works...

I was tested this workflow,

  1. Reinstall OS X Yosemite 10.10.5
  2. Install Command Line Tools(xcode-select --install), not install Xcode
  3. Get libguestfs from brew
  4. Get binary released Go1.5.1 and docker-machine, and install
  5. Get xhyve-bindings and docker-machine-xhyve, and install
  6. cd /path/to/docker-machine-xhyve && MACHINE_DEBUG_DRIVER=1 make run

Only do action, but it worked.

BTW, pure C xhyve also create /var/db/dhcpd_leases. Run this script on mist64/xhyve dir with sudo, TinyCoreLinux is possible ping for google.com? also, In host OS X, can be found in /var/db/dhcpd_leases of IP on TinyCoreLinux's ifconfig result?

If you are not found, the something is wrong your OSX... :(

#!/bin/sh

# Linux
KERNEL="test/vmlinuz"
INITRD="test/initrd.gz"
CMDLINE="earlyprintk=serial console=ttyS0"

MEM="-m 4G"
SMP="-c 4"
NET="-s 2:0,virtio-net"
#IMG_CD="-s 3,ahci-cd,/somepath/somefile.iso"
#IMG_HDD="-s 4,virtio-blk,/somepath/somefile.img"
PCI_DEV="-s 0:0,hostbridge -s 31,lpc"
LPC_DEV="-l com1,stdio"
ACPI="-A"
#UUID="-U deadbeef-dead-dead-dead-deaddeafbeef"

# Linux
build/xhyve $ACPI $MEM $SMP $PCI_DEV $LPC_DEV $NET $IMG_CD $IMG_HDD $UUID -f kexec,$KERNEL,$INITRD,"$CMDLINE"

screencast:

atomotic commented 8 years ago

dhcp problem for me too.

(atomotic) DBG | Not there yet 1/60, error: IP not found for MAC 3a:47:46:45:cf:32 in DHCP leases
(atomotic) DBG | operation not supported by device
(atomotic) DBG | xhyve: illegal option -- F

following the full debug:

xhyve

xhyve -v
xhyve: 793d17

docker-machine

docker-machine -v
docker-machine version 0.5.5, build

run

➜  ~  docker-machine -D create --driver xhyve atomotic
Docker Machine Version:  0.5.5, build
Found binary path at /Users/raffaele/go/bin/docker-machine-driver-xhyve
Launching plugin server for driver xhyve
Plugin server listening at address 127.0.0.1:61674
() DBG | operation not supported by device
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetCreateFlags
Found binary path at /Users/raffaele/go/bin/docker-machine-driver-xhyve
Launching plugin server for driver xhyve
Plugin server listening at address 127.0.0.1:61678
() DBG | operation not supported by device
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(atomotic) Calling .GetMachineName
(atomotic) Calling .DriverName
(atomotic) Calling .GetCreateFlags
(atomotic) Calling .SetConfigFromFlags
Running pre-create checks...
(atomotic) Calling .PreCreateCheck
(atomotic) DBG | ===== Docker Machine xhyve Driver Version 0.2.1 (HEAD) =====
(atomotic) DBG |
(atomotic) DBG | executing: /usr/local/bin/VBoxManage -v
(atomotic) DBG | STDOUT: 5.0.10r104061
(atomotic) DBG |
(atomotic) DBG | STDERR:
(atomotic) Calling .GetConfigRaw
Creating machine...
(atomotic) Calling .Create
(atomotic) DBG | local Boot2Docker ISO version:  v1.9.1
(atomotic) Copying /Users/raffaele/.docker/machine/cache/boot2docker.iso to /Users/raffaele/.docker/machine/machines/atomotic/boot2docker.iso...
(atomotic) Creating VM...
(atomotic) DBG | Mounting boot2docker.iso
(atomotic) Extracting vmlinuz64 and initrd.img from boot2docker.iso...
(atomotic) DBG | executing: &{/usr/bin/hdiutil [hdiutil attach /Users/raffaele/.docker/machine/machines/atomotic/boot2docker.iso -mountpoint /Users/raffaele/.docker/machine/machines/atomotic/b2d-image] []  <nil> 0xc82002c010 0xc82002c018 [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>} attach /Users/raffaele/.docker/machine/machines/atomotic/boot2docker.iso -mountpoint /Users/raffaele/.docker/machine/machines/atomotic/b2d-image
(atomotic) /dev/disk3                                           /Users/raffaele/.docker/machine/machines/atomotic/b2d-image
(atomotic) DBG | Extracting vmlinuz64 into /Users/raffaele/.docker/machine/machines/atomotic
(atomotic) DBG | Extracting initrd.img into /Users/raffaele/.docker/machine/machines/atomotic
(atomotic) DBG | Unmounting boot2docker.iso
(atomotic) DBG | executing: &{/usr/bin/hdiutil [hdiutil detach /Users/raffaele/.docker/machine/machines/atomotic/b2d-image] []  <nil> 0xc82002c010 0xc82002c018 [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>} detach /Users/raffaele/.docker/machine/machines/atomotic/b2d-image
(atomotic) "disk3" unmounted.
(atomotic) "disk3" ejected.
(atomotic) Generating 20000MB disk image...
(atomotic) DBG | executing: &{/usr/bin/hdiutil [hdiutil create -megabytes 20000 -type SPARSEBUNDLE /Users/raffaele/.docker/machine/machines/atomotic/root-volume] []  <nil> 0xc82002c010 0xc82002c018 [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>} create -megabytes 20000 -type SPARSEBUNDLE /Users/raffaele/.docker/machine/machines/atomotic/root-volume
(atomotic) created: /Users/raffaele/.docker/machine/machines/atomotic/root-volume.sparsebundle
(atomotic) Creating SSH key...
(atomotic) Fix file permission...
(atomotic) DBG | /Users/raffaele/.docker/machine/machines/atomotic/boot2docker.iso
(atomotic) DBG | /Users/raffaele/.docker/machine/machines/atomotic/config.json
(atomotic) DBG | /Users/raffaele/.docker/machine/machines/atomotic/id_rsa
(atomotic) DBG | /Users/raffaele/.docker/machine/machines/atomotic/id_rsa.pub
(atomotic) DBG | /Users/raffaele/.docker/machine/machines/atomotic/initrd.img
(atomotic) DBG | /Users/raffaele/.docker/machine/machines/atomotic/root-volume.sparsebundle
(atomotic) DBG | /Users/raffaele/.docker/machine/machines/atomotic/vmlinuz64
(atomotic) Generate UUID...
(atomotic) DBG | Generated UUID: 518331EF-99AB-481E-9F89-147C845DE9A6
(atomotic) Convert UUID to MAC address...
(atomotic) DBG | Converted MAC address: ea:7:bc:13:cf:32
(atomotic) Starting atomotic...
(atomotic) DBG | [xhyve -A -U 518331EF-99AB-481E-9F89-147C845DE9A6 -c 1 -m 1024M -l com1,autopty -s 0:0,hostbridge -s 31,lpc -s 2:0,virtio-net -s 3,ahci-cd,/Users/raffaele/.docker/machine/machines/atomotic/boot2docker.iso -s 4:0,ahci-hd,/dev/rdisk3 -f kexec,/Users/raffaele/.docker/machine/machines/atomotic/vmlinuz64,/Users/raffaele/.docker/machine/machines/atomotic/initrd.img,loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 base host=boot2docker -F /Users/raffaele/.docker/machine/machines/atomotic/atomotic.pid]
(atomotic) Waiting for VM to come online...
(atomotic) DBG |
(atomotic) DBG | Not there yet 1/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG | operation not supported by device
(atomotic) DBG | xhyve: illegal option -- F
(atomotic) DBG | Usage: xhyve [-behuwxMACHPWY] [-c vcpus] [-g <gdb port>] [-l <lpc>]
(atomotic) DBG |              [-m mem] [-p vcpu:hostcpu] [-s <pci>] [-U uuid] -f <fw>
(atomotic) DBG |        -A: create ACPI tables
(atomotic) DBG |        -c: # cpus (default 1)
(atomotic) DBG |        -C: include guest memory in core file
(atomotic) DBG |        -e: exit on unhandled I/O access
(atomotic) DBG |        -f: firmware
(atomotic) DBG |        -g: gdb port
(atomotic) DBG |        -h: help
(atomotic) DBG |        -H: vmexit from the guest on hlt
(atomotic) DBG |        -l: LPC device configuration. Ex: -l com1,stdio -l com2,autopty -l com2,/dev/myownpty
(atomotic) DBG |        -m: memory size in MB
(atomotic) DBG |        -M: print MAC address and exit if using vmnet
(atomotic) DBG |        -p: pin 'vcpu' to 'hostcpu'
(atomotic) DBG |        -P: vmexit from the guest on pause
(atomotic) DBG |        -s: <slot,driver,configinfo> PCI slot config
(atomotic) DBG |        -u: RTC keeps UTC time
(atomotic) DBG |        -U: uuid
(atomotic) DBG |        -v: show build version
(atomotic) DBG |        -w: ignore unimplemented MSRs
(atomotic) DBG |        -W: force virtio to use single-vector MSI
(atomotic) DBG |        -x: local apic is in x2APIC mode
(atomotic) DBG |        -Y: disable MPtable generation
(atomotic) DBG | exit status 1 &{0xc8200161e0} &{0xc820016210}
(atomotic) DBG |
(atomotic) DBG | Not there yet 2/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 3/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 4/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 5/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 6/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 7/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 8/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 9/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 10/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 11/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 12/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 13/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 14/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 15/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 16/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 17/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 18/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 19/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 20/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 21/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 22/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 23/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 24/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 25/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 26/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 27/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 28/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 29/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 30/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 31/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 32/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 33/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 34/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 35/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 36/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 37/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 38/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 39/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 40/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 41/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 42/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 43/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 44/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 45/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 46/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 47/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 48/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 49/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 50/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 51/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 52/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 53/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 54/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 55/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 56/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 57/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 58/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 59/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
(atomotic) DBG |
(atomotic) DBG | Not there yet 60/60, error: IP not found for MAC ea:7:bc:13:cf:32 in DHCP leases
open : no such file or directory
notifying bugsnag: [Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting]
Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
zchee commented 8 years ago

@atomotic Thanks issue :)

Could you create a new issue thread ?

zchee commented 8 years ago

@nathanleclaire They seem to work!! https://github.com/zchee/docker-machine-driver-xhyve/issues/18

Did work properly in your environment?

nathanleclaire commented 8 years ago

@zchee Let me try latest version.

zchee commented 8 years ago

@nathanleclaire Thanks :)

nathanleclaire commented 8 years ago

@zchee Hm, I get a different issue now:

Docker Machine Version:  0.6.0-rc1, build 174e390
Found binary path at /usr/local/bin/docker-machine-driver-xhyve
Launching plugin server for driver xhyve
Plugin server listening at address 127.0.0.1:51286
() DBG | operation not supported by device
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
(flag-lookup) Calling .DriverName
(flag-lookup) Calling .GetCreateFlags
Found binary path at /usr/local/bin/docker-machine-driver-xhyve
Launching plugin server for driver xhyve
() DBG | operation not supported by device
Plugin server listening at address 127.0.0.1:51290
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(foobar) Calling .GetMachineName
(foobar) Calling .DriverName
(foobar) Calling .GetCreateFlags
(foobar) Calling .SetConfigFromFlags
Running pre-create checks...
(foobar) Calling .PreCreateCheck
(foobar) DBG | ===== Docker Machine xhyve Driver Version 0.2.2 (7a7e30b) =====
(foobar) DBG |
(foobar) DBG | executing: /usr/local/bin/VBoxManage -v
(foobar) DBG | STDOUT: 5.0.12r104815
(foobar) DBG |
(foobar) DBG | STDERR:
(foobar) Calling .GetConfigRaw
Creating machine...
(foobar) Calling .Create
(foobar) DBG | local Boot2Docker ISO version:  v1.9.1
(foobar) Copying /Users/nathanleclaire/.docker/machine/cache/boot2docker.iso to /Users/nathanleclaire/.docker/machine/machines/foobar/boot2docker.iso...
(foobar) Creating VM...
(foobar) Extracting vmlinuz64 and initrd.img from boot2docker.iso...
(foobar) DBG | Mounting boot2docker.iso
(foobar) DBG | executing: &{/usr/bin/hdiutil [hdiutil attach /Users/nathanleclaire/.docker/machine/machines/foobar/boot2docker.iso -mountpoint /Users/nathanleclaire/.docker/machine/machines/foobar/b2d-image] []  <nil> 0xc820030010 0xc820030018 [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>} attach /Users/nathanleclaire/.docker/machine/machines/foobar/boot2docker.iso -mountpoint /Users/nathanleclaire/.docker/machine/machines/foobar/b2d-image
(foobar) /dev/disk4                                             /Users/nathanleclaire/.docker/machine/machines/foobar/b2d-image
(foobar) DBG | Extracting vmlinuz64 into /Users/nathanleclaire/.docker/machine/machines/foobar
(foobar) DBG | Extracting initrd.img into /Users/nathanleclaire/.docker/machine/machines/foobar
(foobar) DBG | Unmounting boot2docker.iso
(foobar) DBG | executing: &{/usr/bin/hdiutil [hdiutil detach /Users/nathanleclaire/.docker/machine/machines/foobar/b2d-image] []  <nil> 0xc820030010 0xc820030018 [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>} detach /Users/nathanleclaire/.docker/machine/machines/foobar/b2d-image
(foobar) "disk4" unmounted.
(foobar) "disk4" ejected.
(foobar) Generating 20000MB disk image...
(foobar) DBG | executing: &{/usr/bin/hdiutil [hdiutil create -megabytes 20000 -type SPARSEBUNDLE /Users/nathanleclaire/.docker/machine/machines/foobar/root-volume] []  <nil> 0xc820030010 0xc820030018 [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>} create -megabytes 20000 -type SPARSEBUNDLE /Users/nathanleclaire/.docker/machine/machines/foobar/root-volume
(foobar) created: /Users/nathanleclaire/.docker/machine/machines/foobar/root-volume.sparsebundle
(foobar) Creating SSH key...
(foobar) Fix file permission...
(foobar) DBG | /Users/nathanleclaire/.docker/machine/machines/foobar/boot2docker.iso
(foobar) DBG | /Users/nathanleclaire/.docker/machine/machines/foobar/config.json
(foobar) DBG | /Users/nathanleclaire/.docker/machine/machines/foobar/id_rsa
(foobar) DBG | /Users/nathanleclaire/.docker/machine/machines/foobar/id_rsa.pub
(foobar) DBG | /Users/nathanleclaire/.docker/machine/machines/foobar/initrd.img
(foobar) DBG | /Users/nathanleclaire/.docker/machine/machines/foobar/root-volume.sparsebundle
(foobar) DBG | /Users/nathanleclaire/.docker/machine/machines/foobar/vmlinuz64
(foobar) Generate UUID...
(foobar) DBG | Generated UUID: C17F62B7-B818-4B0D-BBA0-2C7593534D2D
(foobar) Convert UUID to MAC address...
Error creating machine: Error in driver during machine creation: exit status 1
open : no such file or directory
notifying bugsnag: [Error creating machine: Error in driver during machine creation: exit status 1]

Any ideas? It seems to fail at the "Convert UUID to MAC address" line.

nathanleclaire commented 8 years ago

Let me try also uninstall and re-install xhyve.

zchee commented 8 years ago

@nathanleclaire Hmm... :( It seems there is no dhcpd_leases...

xhyve is embedded. not required original xhyve binary.

nathanleclaire commented 8 years ago

xhyve is embedded. not required original xhyve binary.

Oh, nice.

Yeah, I'm not sure what's going on. My machine sometimes is a bit fickle with virtualization (in particular networking) due to having VirtualBox, VMware Fusion, and xhyve all installed.

zchee commented 8 years ago

@nathanleclaire Oh...

I want to reference, Would you tell me the results of this command?

$ sw_vers

# except Serial Number and Hardware UUID
$ system_profiler SPHardwareDataType
nathanleclaire commented 8 years ago

@zchee Sure:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.2
BuildVersion:   15C50

$ system_profiler SPHardwareDataType
Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro11,2
      Processor Name: Intel Core i7
      Processor Speed: 2 GHz
      Number of Processors: 1
      Total Number of Cores: 4
      L2 Cache (per Core): 256 KB
      L3 Cache: 6 MB
      Memory: 16 GB
      Boot ROM Version: MBP112.0138.B16
      SMC Version (system): 2.18f15
nathanleclaire commented 8 years ago

I'm using docker-machine-driver-xhyve 0.2.2

zchee commented 8 years ago

@nathanleclaire I remeved.

zchee commented 8 years ago

@nathanleclaire It is almost the same as my environment. I still not sure the cause...

zchee commented 8 years ago
ProductName:    Mac OS X
ProductVersion: 10.11.3
BuildVersion:   15D13b

Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro11,3
      Processor Name: Intel Core i7
      Processor Speed: 2.3 GHz
      Number of Processors: 1
      Total Number of Cores: 4
      L2 Cache (per Core): 256 KB
      L3 Cache: 6 MB
      Memory: 16 GB
      Boot ROM Version: MBP112.0138.B16
      SMC Version (system): 2.19f12
nathanleclaire commented 8 years ago

So there is a file like /var/db/dchp_leases which is meant to be present, but seems not to be in my case?

zchee commented 8 years ago

@nathanleclaire

So there is a file like /var/db/dchp_leases which is meant to be present, but seems not to be in my case?

"Convert UUID to MAC address" such as getMACAdress() is launch the (embeded) xhyve internally and gets the MAC address use https://github.com/zchee/docker-machine-driver-xhyve/blob/master/xhyve/xhyve.go#L765-L777 + -M flag.

-M flag is print_mac.

After that, docker-machine-driver-xhyve get the IP address using the result of print_mac and /var/db/dchp_leases file.

  1. Start()
  2. return d.waitForIP()
  3. d.waitForIP()
  4. getIPfromDHCPLease()

So, It might be a relation that the /var/db/dchp_leases file does not exist, but It is not a immediate cause. In this case, the correct cause is that you are not able to launch the xhyve docker-machine-driver-xhyve internally.

zchee commented 8 years ago

@nathanleclaire I'm checking just to be sure, do you can launch the xhyve with vmnet?

zchee commented 8 years ago

@nathanleclaire FYI, situation is different, but similar to this. https://github.com/zchee/docker-machine-driver-xhyve/issues/70

bernielomax commented 7 years ago

I can confirm that if I use the brew install it works. If I try and build my own I am getting the Not there yet 60/60, error: IP not found for MAC f6:d8:23:5:v5:a4 in DHCP leases. The reason why I tried building my own is network seems to be impossibly slow on my Mac running Sierra.

dalehamel commented 7 years ago

I actually wrote the code for xhyve that does the MAC address printing (a minor, relatively simple contribution). I don't that that is actually the problem here.

I have seen cases where the user doesn't get an IP address, but that always seems to be because the DHCP server isn't actually running!

It looks like the hypervisor framework is actually supposed to invoke the DHCP server on OS X when a machine starts for the first time. It will actually create "bootpd.plist", which is the config file that it uses to launch bootpd, the OS X DHCP server.

On some hosts - and I can't figure out why, because it's all OS X internals - it looks like it just straight up doesn't.

This is a bit unfortunate, because it's likely that everything else is working except for this rather obtuse DHCP dance... and it's quite difficult to debug because it's all OS X internals.

dalehamel commented 7 years ago

A possible approach could be to forcefully start bootpd.plist.... something like https://www.swissns.ch/site/2014/05/running-mac-os-xs-built-in-dhcp-server/ ?

public commented 7 years ago

@dalehamel I was also having this issue with the VM not getting an IP. Like you said, it turned out bootpd wasn't even running.

In my case the trick was to disable my systems antivirus 🤦‍♂️ Everything seemed to work fine after that.

dalehamel commented 7 years ago

@public It looks like bootpd is supposed to be started by launchd, and launchd has xinetd built into it.

xinetd should, I believe, be trying to start bootpd as soon as it receives its first DHCP (UDP port 67) packet.

For some reason, a seemingly random (small) number of machines seem to not do this, and the exact reason why is something that's really hard to figure out.

I've considered trying to implement the ability to specify a static IP address yourself, as a sort of shitty workaround to this problem...

public commented 7 years ago

@dalehamel That's correct. My hypothesis is that this is due to stuff like AV or other security software trying to harden the machine. (Although I probably shouldn't over-generalise what worked for me.) OS X has had bootpd vulnerabilities in the past and a lot of users are never going to make use of this feature so I wouldn't be surprised if IT depts and AV companies tried to disable it.

A less shitty workaround might be to run your own dhcp server. There are even pure Go implementations that might be fairly easy to embed e.g. https://github.com/krolaw/dhcp4

I'm not sure how stuff like Docker for Mac gets around this problem since that seems to work fine on Xhyve and is doing mostly the same stuff. That might also be a good source of ideas?

zchee commented 7 years ago

@dalehamel @public Thanks good hints! I'll check it later.

freele commented 7 years ago

In case if anyone will stuck with this again. I resolved it without deep understanding by running once minikube on OSX on VirtualBox (default value). After that delete it and started with xhyve driver. And it started to work. Sorry for absence of deep research, but I really don't know how to reproduce it again.

aalibasic commented 4 years ago

I am also experiencing the Not there yet 17/60, error: IP not found for MAC in DHCP leases issue.

Does any one have a resolution for this?