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
888 stars 74 forks source link

Error in driver during machine creation #211

Closed kevinkirkup closed 5 years ago

kevinkirkup commented 5 years ago

Error with latest OSX Mojave (10.14.1) release:

% docker-machine --debug create default --driver xhyve --xhyve-memory-size 4096 --xhyve-cpu-count 4 --xhyve-experimental-nfs-share=true
Docker Machine Version:  0.15.0, build b48dc28
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:51436
() 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
Plugin server listening at address 127.0.0.1:51442
() DBG | operation not supported by device
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(default) Calling .GetMachineName
(default) Calling .DriverName
(default) Calling .GetCreateFlags
(default) Calling .SetConfigFromFlags
Reading certificate data from /Users/someuser/.docker/machine/certs/ca.pem
Decoding PEM data...
Parsing certificate...
Reading certificate data from /Users/someuser/.docker/machine/certs/cert.pem
Decoding PEM data...
Parsing certificate...
Running pre-create checks...
(default) Calling .PreCreateCheck
(default) DBG | ===== Docker Machine xhyve Driver Version 0.3.3 (Homebrew7d92f74) =====
(default) DBG |
(default) DBG | executing: /usr/local/bin/VBoxManage -v
(default) DBG | STDOUT: 5.2.20r125813
(default) DBG |
(default) DBG | STDERR:
(default) Calling .GetConfigRaw
Creating machine...
(default) Calling .Create
(default) DBG | local Boot2Docker ISO version:
(default) Default Boot2Docker ISO is out-of-date, downloading the latest release...
(default) Latest release for github.com/boot2docker/boot2docker is v18.09.0
(default) Downloading /Users/someuser/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.09.0/boot2docker.iso...
(default) DBG | Fix boot2docker.iso file permission...
(default) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
(default) Copying /Users/someuser/.docker/machine/cache/boot2docker.iso to /Users/someuser/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VM...
(default) DBG | Mounting boot2docker.iso
(default) DBG | executing: &{/usr/bin/hdiutil [hdiutil attach /Users/someuser/.docker/machine/machines/default/boot2docker.iso -mountpoint /Users/someuser/.docker/machine/machines/default/b2d-image] []  <nil> 0xc0000c2008 0xc0000c2010 [] <nil> <nil> <nil> <nil> <nil> false [] [] [] [] <nil> <nil>} attach /Users/someuser/.docker/machine/machines/default/boot2docker.iso -mountpoint /Users/someuser/.docker/machine/machines/default/b2d-image
(default) DBG | hdiutil: attach failed - no mountable file systems
Error creating machine: Error in driver during machine creation: exit status 1
notifying bugsnag: [Error creating machine: Error in driver during machine creation: exit status 1]
kevinkirkup commented 5 years ago

Looks like it's the new boot2docker.iso - v18.09.0

If I specify the older version, it's working properly:

$ docker-machine create default --driver xhyve --xhyve-memory-size 4096 --xhyve-cpu-count 4 --xhyve-experimental-nfs-share=true --xhyve-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v18.06.1-ce/boot2docker.iso
Running pre-create checks...
Creating machine...
(default) Downloading /Users/someuser/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.06.1-ce/boot2docker.iso...
(default) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
(default) Creating VM...
(default) /dev/disk2                                            /Users/someuser/.docker/machine/machines/default/b2d-image
(default) "disk2" ejected.
(default) Generating 20000MB disk image...
(default) created: /Users/someuser/.docker/machine/machines/default/root-volume.sparsebundle
(default) Creating SSH key...
(default) Fix file permission...
(default) Generate UUID...
(default) Convert UUID to MAC address...
(default) Starting default...
(default) Waiting for VM to come online...
(default) Waiting on a pseudo-terminal to be ready... done
(default) Hook up your terminal emulator to /dev/ttys003 in order to connect to your VM
(default) NFS share folder must be root. Please insert root password.
(default) NFS share folder must be root. Please insert root password.
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env default

Not sure if this is the ISO image or the driver. If it's the boot2docker.iso image, please close.

kevinkirkup commented 5 years ago

The v18.09.0 ISO image seems to be working with VirtualBox though.

$ docker-machine create default --driver virtualbox --virtualbox-memory 4096 --virtualbox-cpu-count 4 --virtualbox-ui-type "headless"
(default) Default Boot2Docker ISO is out-of-date, downloading the latest release...
(default) Latest release for github.com/boot2docker/boot2docker is v18.09.0
(default) Downloading /Users/someuser/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.09.0/boot2docker.iso...
(default) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
(default) Copying /Users/someuser/.docker/machine/cache/boot2docker.iso to /Users/someuser/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env default
mavimo commented 5 years ago

@kevinkirkup from https://github.com/boot2docker/boot2docker/releases/tag/v18.09.0:

Warning: the AUFS storage driver is deprecated in boot2docker and AUFS support is removed in 18.09+. You can continue with AUFS in boot2docker 18.06.x, but it is recommended to reset your disk image before updating to 18.09+.

Seems that AUFS (the default one that docker-machine-xhyve use) is not longer available, do you try to run it with flag --engine-storage-driver and specify a different driver (like overlay)?

kevinkirkup commented 5 years ago

Still seeing the same issue with the following storage drivers:

None appear to work. https://docs.docker.com/storage/storagedriver/select-storage-driver/#docker-for-mac-and-docker-for-windows

% docker-machine create default --driver xhyve --xhyve-memory-size 4096 --xhyve-cpu-count 4 --xhyve-experimental-nfs-share=true --engine-storage-driver overlay2
Running pre-create checks...
Creating machine...
(default) Default Boot2Docker ISO is out-of-date, downloading the latest release...
(default) Latest release for github.com/boot2docker/boot2docker is v18.09.0
(default) Downloading /Users/someuser/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.09.0/boot2docker.iso...
(default) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
(default) Copying /Users/someuser/.docker/machine/cache/boot2docker.iso to /Users/someuser/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VM...
Error creating machine: Error in driver during machine creation: exit status 1
step21 commented 5 years ago

I experience the same on OS X 10.13

mavimo commented 5 years ago

@step21 @kevinkirkup the issue is related to the new boot2docker image, you can try with:

docker-machine create MACHINE_NAME \
    ..... \
    --xhyve-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v18.06.1-ce/boot2docker.iso
geronimo-iia commented 5 years ago

I have the same issue.

after docker-machine --debug create -d xhyve test

ls -la .docker/machine/machines/test/
-rw------- 1 root     47185920 nov 15 00:13 boot2docker.iso
-rw------- 1 geronimo     2716 nov 15 00:13 config.json

boot2docker.iso is owned by root user rather than 'geronimo'

I've tried the tips from @mavimo and it works for me.

docker-machine --debug create test2 -d xhyve --xhyve-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v18.06.1-ce/boot2docker.iso

docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS test2 - xhyve Running tcp://192.168.64.44:2376 v18.06.1-ce

tianon commented 5 years ago

:scream: sorry for the trouble!

I've filed https://github.com/boot2docker/boot2docker/pull/1358 upstream, which I've personally verified fixes this issue (and will be in the next boot2docker release). :+1:

praveenkumar commented 5 years ago

Closing this issue since it is related to b2d iso side.