Friday, February 22, 2013

Serving NFS to guests using VirtualBox on OS X

The other day, I was trying to setup a NFS share on my Mac that VirtualBox guests could mount.

It didn't work for a while, and then I found a server option which cleared things up.

Funny enough, the OS X manual says that there is a 'false belief that this requirement increases security', yet they left the default as 1.  Fix with the following:
# /etc/nfs.conf
nfs.server.mount.require_resv_port = 0
You'll have to create this file, it doesn't exist by default.

Then just run:
nfsd update
Then you should be able to export to your VM's like this:
# /etc/exports
/Users/brian/share -mapall=501:20 -alldirs
This works well because it shares only to the loopback which gives all your NAT'd VMs access, but no one else. Also it maps all operations to your user ID and group ID so permissions in the share folder stay sane. Your user ID and GID will usually be 501 and 20 on a Mac, but if you want to check, do it like this:
bcook-air:~ brian$ id 
uid=501(brian) gid=20(staff) groups=20(staff),12(everyone),33(_appstore),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),100(_lpoperator),204(_developer),401(
The first two things there are what you are looking for. Don't forget to run nfsd update again after making changes to the exports file.

1 comment:

  1. Do not ignore on-line slots, which are also very popular amongst gamers. Based on this, Jackpot City on-line on line casino have support for mobile applications, which permits gamers to access their favorite playing app from mobile units and tablets. All they need to|they should} do is download the online on line casino app and have a good internet connection. LicenseA license is a guarantee of the legality of a web-based on line casino, its security, and reliability. That is why this aspect is very important to keep in mind when reviewing on-line on line casino Jackpot City. Our playing apps are licensed by probably the most dependable representatives 다파벳 corresponding to Curacao, Malta, and Gibraltar.