From 3f7256e14513da118dfc509ed239e302e0a3f7bb Mon Sep 17 00:00:00 2001 From: Martin Mullins Date: Fri, 26 Nov 2021 14:27:02 +0000 Subject: [PATCH 1/2] Notes for mounting an NFS folder from a linux host --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 36639b8..ce59cf8 100644 --- a/README.md +++ b/README.md @@ -817,7 +817,30 @@ docker run -it \ # sudo -S mount_9p hostshare ``` +### Share Linux NFS Drive into macOS +Setup a Linx NFS server on host machine, an example `/etc/export` configuration that is compatible with the mac client: +``` +/srv/nfs/share 127.0.0.1/0(insecure,rw,all_squash,anonuid=1000,anongid=985,no_subtree_check) +``` + +[source](https://serverfault.com/questions/716350/mount-nfs-volume-on-ubuntu-linux-server-from-macos-client) + +Where `anonuid` and `anongid` matches that of your linux user. + +Give permissions on the shared folder for the `anonuid` and `anongid`: +``` +chown 1000:985 /srv/nfs/share +chmod u+rwx /srv/nfs/share +``` + +Start the mac osx docker container with `--network host` + +Create and mount the nfs folder from the mac terminal: +``` +mkdir ~/mnt +sudo mount -t nfs 10.0.2.2:/srv/nfs/share ~/mnt +``` ### Share USB Drive into macOS over QEMU From d2e2604cfc89a14724ad740807c4bb0473cbb476 Mon Sep 17 00:00:00 2001 From: sickcodes <65906298+sickcodes@users.noreply.github.com> Date: Sun, 28 Nov 2021 22:22:23 +0000 Subject: [PATCH 2/2] NFS drive easy-share edits Thank you @martinmullins! --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ce59cf8..2b17614 100644 --- a/README.md +++ b/README.md @@ -819,26 +819,33 @@ docker run -it \ ``` ### Share Linux NFS Drive into macOS -Setup a Linx NFS server on host machine, an example `/etc/export` configuration that is compatible with the mac client: +To share a folder using NFS, setup a folder for on the host machine, for example, `/srv/nfs/share` and then append to `/etc/exports`: +```bash +/srv/nfs/share 127.0.0.1/0(insecure,rw,all_squash,anonuid=1000,anongid=985,no_subtree_check) ``` -/srv/nfs/share 127.0.0.1/0(insecure,rw,all_squash,anonuid=1000,anongid=985,no_subtree_check) + +You may need to reload exports now, which will begin sharing that directory. + +```bash +# reload shared folders +sudo exportfs -arv ``` -[source](https://serverfault.com/questions/716350/mount-nfs-volume-on-ubuntu-linux-server-from-macos-client) +[Source & Explanation](https://serverfault.com/questions/716350/mount-nfs-volume-on-ubuntu-linux-server-from-macos-client) -Where `anonuid` and `anongid` matches that of your linux user. +Give permissions on the shared folder for the `anonuid` and `anongid`, where `anonuid` and `anongid` matches that of your linux user; `id -u` -Give permissions on the shared folder for the `anonuid` and `anongid`: +`id -u ; id -g` will print `userid:groupid` ``` chown 1000:985 /srv/nfs/share chmod u+rwx /srv/nfs/share ``` -Start the mac osx docker container with `--network host` +Start the Docker-OSX container with the additional flag `--network host` Create and mount the nfs folder from the mac terminal: ``` -mkdir ~/mnt +mkdir -p ~/mnt sudo mount -t nfs 10.0.2.2:/srv/nfs/share ~/mnt ```