machine icon indicating copy to clipboard operation
machine copied to clipboard

Docker-machine fails to build VMware machine and enable shared folders

Open WizBangCrash opened this issue 7 years ago • 5 comments

  • [x] I have tried with the latest version of my channel (Stable or Edge)
  • [ ] I have submitted Diagnostics
  • [ ] I have included the Diagnostics ID in this Issue
  • macOS Version: 10.13.4

Expected behavior

docker-machine create --driver vmware medium should create a new docker machine using VMware and be able to run on VMware Fusion with the host filesystem mounted.

Actual behavior

Errors occur during the create at the enableSharedFolders and addSharedFolder vmware commands and the /User shared folder does not get mounted. This causes all --mount type=bind,source=<dir>,target=<dir> options for docker run and docker-compose to fail to mount the host directories correctly, resulting in unusable containers :-( If I ssh into the machine I can see that the hgfs driver is working because it has mounted /mnt/hgfs and /mnt/hosthome. I can also browse any of the Mac host files from these mount points.

Information

I have installed docker, docker-machine, docker-compose using Homebrew I have also manually installed the updateddocker-machine-driver-vmare` to be able to use the latest vmware drivers.

Docker for Mac: Docker version 18.05.0-ce, build f150324
docker-machine: docker-machine version 0.14.0, build 89b8332docker
VMware Fusion: VMware Fusion: Professional Version 10.1.1 (7520154)

Important output from docker-machine --debug create --driver vmware medium command:

(medium) DBG | Creating Tar key bundle…
(medium) DBG | executing: /Applications/VMware Fusion.app/Contents/Public/vmrun -gu docker -gp tcuser directoryExistsInGuest /Users/ddix/.docker/machine/machines/medium/medium.vmx /var/lib/boot2docker
(medium) DBG | The directory exists.
(medium) DBG | executing: /Applications/VMware Fusion.app/Contents/Public/vmrun -gu docker -gp tcuser CopyFileFromHostToGuest /Users/ddix/.docker/machine/machines/medium/medium.vmx /Users/ddix/.docker/machine/machines/medium/userdata.tar /home/docker/userdata.tar
(medium) DBG | executing: /Applications/VMware Fusion.app/Contents/Public/vmrun -gu docker -gp tcuser runScriptInGuest /Users/ddix/.docker/machine/machines/medium/medium.vmx /bin/sh sudo sh -c “tar xvf /home/docker/userdata.tar -C /home/docker > /var/log/userdata.log 2>&1 && chown -R docker:staff /home/docker”
(medium) DBG | executing: /Applications/VMware Fusion.app/Contents/Public/vmrun -gu docker -gp tcuser runScriptInGuest /Users/ddix/.docker/machine/machines/medium/medium.vmx /bin/sh sudo /bin/mv /home/docker/userdata.tar /var/lib/boot2docker/userdata.tar
(medium) DBG | executing: /Applications/VMware Fusion.app/Contents/Public/vmrun -gu docker -gp tcuser enableSharedFolders /Users/ddix/.docker/machine/machines/medium/medium.vmx
(medium) DBG | Error: There was an error mounting the Shared Folders file system inside the guest operating system
(medium) DBG | executing: /Applications/VMware Fusion.app/Contents/Public/vmrun -gu docker -gp tcuser addSharedFolder /Users/ddix/.docker/machine/machines/medium/medium.vmx Users /Users
(medium) DBG | Error: There was an error mounting the Shared Folders file system inside the guest operating system
(medium) DBG | executing: /Applications/VMware Fusion.app/Contents/Public/vmrun -gu docker -gp tcuser runScriptInGuest /Users/ddix/.docker/machine/machines/medium/medium.vmx /bin/sh [ ! -d /hosthome ]&& sudo mkdir /hosthome; sudo mount --bind /mnt/hgfs//hosthome /hosthome || [ -f /usr/local/bin/vmhgfs-fuse ]&& sudo /usr/local/bin/vmhgfs-fuse -o allow_other .host:/Users /hosthome || sudo mount -t vmhgfs -o uid=$(id -u),gid=$(id -g) .host:/Users /hosthome

Steps to reproduce the behavior

  1. docker-machine --debug create --driver vmware medium
  2. docker-machine ssh medium
  3. /mnt/hgfs & /hosthome are mounted and usable, but /Users has not mounted.
  4. docker run -v /Users/dave/Documents:/home/test -it --rm --name test debian results in:
root@d06d3b217711:/# mount
none on / type aufs (rw,relatime,si=8d4a4875e8905ef9,dio,dirperm1)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,nosuid,size=65536k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
sysfs on /sys type sysfs (ro,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,relatime,mode=755)
cgroup on /sys/fs/cgroup/cpuset type cgroup (ro,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu type cgroup (ro,nosuid,nodev,noexec,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (ro,nosuid,nodev,noexec,relatime,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (ro,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (ro,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (ro,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (ro,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (ro,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/perf_event type cgroup (ro,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_prio type cgroup (ro,nosuid,nodev,noexec,relatime,net_prio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (ro,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (ro,nosuid,nodev,noexec,relatime,pids)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
**tmpfs on /home/test type tmpfs (rw,relatime,size=917516k)**
/dev/sda1 on /etc/resolv.conf type ext4 (rw,relatime,data=ordered)
/dev/sda1 on /etc/hostname type ext4 (rw,relatime,data=ordered)
/dev/sda1 on /etc/hosts type ext4 (rw,relatime,data=ordered)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
devpts on /dev/console type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
proc on /proc/bus type proc (ro,relatime)
proc on /proc/fs type proc (ro,relatime)
proc on /proc/irq type proc (ro,relatime)
proc on /proc/sys type proc (ro,relatime)
proc on /proc/sysrq-trigger type proc (ro,relatime)
tmpfs on /proc/kcore type tmpfs (rw,nosuid,size=65536k,mode=755)
tmpfs on /proc/keys type tmpfs (rw,nosuid,size=65536k,mode=755)
tmpfs on /proc/timer_list type tmpfs (rw,nosuid,size=65536k,mode=755)
tmpfs on /proc/timer_stats type tmpfs (rw,nosuid,size=65536k,mode=755)
tmpfs on /proc/scsi type tmpfs (ro,relatime)
tmpfs on /sys/firmware type tmpfs (ro,relatime)
root@d06d3b217711:/# ls -l /home/test
total 0
root@d06d3b217711:/# 

Note that /home/test has been created as a tempfs mount and has no files in it.

WizBangCrash avatar May 14 '18 07:05 WizBangCrash