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

Unable to run xhyve vm for docker #222

Open guidoilbaldo opened 4 years ago

guidoilbaldo commented 4 years ago

Hi,

I have a brand new Macbook Pro (company provided) with iTerm2 and oh-my-zsh, and I'm willing to install docker via brew without using Docker Toolbox/Docker Desktop (because of their sluggishness) and xhyve virtualizator (instead of virtualbox).

I followed one of many tutorials that simply states that you should:

Here I started having some troubles. The above command returns:

Error: No machine name specified

while printing out docker-machine man page. So I started trying to figure out why the above command (used by many users to start a default VM) was failing only for me.

I searched the internet and tried the following to no avail:

Or any other combination with different names after --xhyve-experimental-nfs-share option. I tried using -d instead of --driver, tried putting VM name after all the options, but the only thing I can get from the above commands is this result:

Running pre-create checks...
Creating machine...
(default) Copying /Users/sguido/.docker/machine/cache/boot2docker.iso to /Users/sguido/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VM...
(default) /dev/disk4                                            /Users/sguido/.docker/machine/machines/default/b2d-image
(default) "disk4" ejected.
(default) Generating 30000MB disk image...
(default) created: /Users/sguido/.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/ttys002 in order to connect to your VM
(default) NFS share folder must be root. Please insert root password.
Error creating machine: Error in driver during machine creation: Export verification failed:
exports:3: path contains non-directory or non-existent components: /Users/sguido/.docker/machine/machines/default/true
exports:3: no usable directories in export entry
exports:3: using fallback (marked offline): /

exit status 3

For the above output, I used docker-machine create default --driver xhyve --xhyve-experimental-nfs-share=true command. I also tried using bash instead of zsh but, again, no success. I'm really stuck here and can't understand what I'm missing since it seems that for everyone else this setup is really simple and straightforward. Any help would really be appreciated.

Stefano

guidoilbaldo commented 4 years ago

Update: reading through your README, I tried mounting a local path on the guest VM.

docker-machine create default --driver xhyve --xhyve-experimental-nfs-share /opt                                                                                  1 ↵  23:42:32 
Running pre-create checks...
Creating machine...
(default) Copying /Users/sguido/.docker/machine/cache/boot2docker.iso to /Users/sguido/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VM...
(default) /dev/disk2                                            /Users/sguido/.docker/machine/machines/default/b2d-image
(default) "disk2" ejected.
(default) Generating 20000MB disk image...
(default) created: /Users/sguido/.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/ttys000 in order to connect to your VM
(default) NFS share folder must be root. Please insert root password.
Password:
Error creating machine: Error in driver during machine creation: ssh command error:
command : echo -e "#/bin/bash\nsudo /usr/local/etc/init.d/nfs-client start\nsudo mkdir -p /xhyve-nfsshares//opt\nsudo mount -t nfs -o noacl,async 192.168.64.1:/opt /xhyve-nfsshares//opt\n" | sh
err     : Process exited with: 32. Reason was:  ()
output  : Starting nfs client utilities.
mount.nfs: an incorrect mount option was specified

I still don't understand what's happening and why.