-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Share directories from host->guest via qemu:-virtfs, osx:mount_p9 #52
Comments
You can use the
|
This is great btw, can I add this to the repo? |
Yeah, this is why I documented it here... I thought NFS is much too complicated to use inside docker, with the required kernel support and all, mount_9p is straightforward. Makes creating build servers much easier, along with the automatic booting from the macos disk #53 :) |
Thanks for this btw, just used it myself! |
For anyone else trying to set up a share directory between guest and host, here is what ended up working for me. I had to add my host directory as a docker volume, then reference the docker volume path in the virtfs command options.
Since the virtfs passthrough uses host permissions on all files in the share directory, you can change the OS X user to the same ID as your host user ID and read/write should work as expected. This post was helpful in that regard |
I tried |
Working to implement the solutions mentioned in this issue now! |
stat mac_hdd_ng.img
SHARE=/home/user/test/1px/
docker run -it \
--device /dev/kvm \
-p 50922:10022 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \
-v "${PWD}/mac_hdd_ng.img:/home/arch/OSX-KVM/mac_hdd_ng.img" \
-v "${SHARE}:/mnt/hostshare" \
-e OSX_COMMANDS="echo alpine | sudo -S mount_9p hostshare && /bin/bash" \
-e EXTRA="-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=hostshare" \
sickcodes/docker-osx:auto
|
@sickcodes actually this (#52 (comment)) is very important to get sharing work both ways. Can I create a PR to add a link to the docs? |
I tried to change the uuid of the user from 501 to 1001 (it is the uuid of my user on my host vm). I'm not able to write on the shared disk. |
I was looking into getting NFS working but then I came across this much more convenient way: in the qemu command-line options add:
(
<id>
can be the same as<volume name>
)and then in OSX:
I think mount_9p was added in Mojave (10.14)
The text was updated successfully, but these errors were encountered: