I set up Nvidia Jetson on my local network and work on it. However, I needed to ssh into my machine is a bit hassle as time goes. To resolve it, I set the NFS on Jetson and share the project dir and mount it from my Mac.
- Install nfs on Jetson.
sudo apt install nfs-kernel-server
2. Edit export file
sudo vi /etc/exports
Then add the following:
/home/jetson/projects *(rw,sync,insecure,all_squash,no_subtree_check,anonuid=1000,anongid=1000)
You need to change the path (/home/jetson/projects) that makes sense for you. Also notice that “*” means you are opening this mount point to everybody. If you restrict this to certain users make sure you add host names such as *.yourdomain.com or ip range 192.168.1.0/24.
/home/jetson/projects 192.168.1.0/24(rw,sync,insecure,all_squash,no_subtree_check,anonuid=1000,anongid=1000)
Start NFS server
sudo systemctl start nfs-kernel-server.service
sudo exportfs -a
3. On Mac (13.4), you must be able to see your nfs server status.
showmount -e 192.168.1.40
Exports list on 192.168.1.40:
/home/jetson/projects Everyone
Your Mac sees 192.168.1.40:/home/jetson/projeccts shares to everyone.
Again be careful that it is open to everybody. In my case, I am the only one using this Jetson machine. Make sure you are okay with this setting. If not, please add host name or ip range as mentioned above.
Now, create a mount point.
mkdir nfs/jetson
Again, change the path “nfs/jetson” to something that makes sense for you.
Then mount!
sudo mount_nfs -o resvport,rw,noowners 192.168.4.40:/home/jetson/projects /User/MY_HOME/nfs/jetson
Or
sudo mount -t nfs -o nobrowse,nosuid,nfc,rw,tcp,intr,bg,hard,resvport,nolockd,nfc 192.168.4.40:/home/jetson/projects /Users/MY_HOME/nfs/jetson
Once again, the mount point /User/MY_HOME/nfs/jetson needs to be changed that works for yours!
That’s pretty much it. Test it! You must be able to write on your mac and that is visible on Jetson, and vice versa.
ls -l nfs/jetson
touch nsf/jetson/test.text
This should work.
Okay, Trouble shooting…
If you get an error “Permission denied”
ls nfs/jetson
touch nfs/jetson/a.txt
touch: jetson/a.txt: Permission denied
It is because uid and gid is not set properly. Noice how nfs/jetson is mounted.
ls -l nsf/jetson
drwxrwxr-x 3 1000 1000 4096 May 31 16:03 jetson
It is because nfs export was not set with anonuid and anongid.
If add anonuid=1000 and anongid=1000 is added in the /etc/exports file it will looks like following.
ls -l jetson
total 8
drwxrwxr-x 6 developer staff 4.0K May 30 11:45 projects
That’s pretty much it!