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

Multiple virtio9p shares #194

Closed huguesalary closed 6 years ago

huguesalary commented 6 years ago

This PR allows the user to specify multiple folders to share via virtio9p.

Previously, only /Users was being shared inside the guest at /Users.

With this PR, it is possible to mount any Host folder inside the Guest at /xhyve-virtio9p (by default). This default can be changed via the --xhyve-virtio-9p-root command line argument.

This commit changes --xhyve-virtio-9p from a bool flag to a string slice representing the absolute path to the Host folder to be mounted inside the guest.

This PR is divided in 2 commits:

Here's an example of how to use:

docker-machine -D create -d xhyve --xhyve-disk-size 10000 --xhyve-memory-size 4000 --xhyve-cpu-count 2 --xhyve-virtio-9p /Users --xhyve-virtio-9p /usr --xhyve-virtio-9p-root /myVirtio9pRoot test

This command will share the host folders /Users and /usr in the guest at /myVirtio9pRoot/Users and /myVirtio9pRoot/usr