NFS on Pi

The easiest way to run the example on a Raspberry Pi 3 is to compile it natively on the Pi. This method is slow but avoids the possibility of missing or mismatched libraries on the target system. The downside of native compiling is that the host machine does not have the binaries for Streamline to analyze. Alhough the scp command can be used to copy them back to the host, this method is tedious because it needs to be done every time the software changes.

Instead of scp, NFS can be used to share a directory on the Pi which can be mounted from the host machine. This way, the files are always in sync and Streamline is much easier to use. The steps to setup NFS on the Raspberry Pi are:

  1. Install the NFS client and server files:
    $ sudo apt-get install nfs-common nfs-server
  2. Edit the /etc/exports configuration file, using sudo, to setup the directory to share. You can share the home directory of the Pi since it will contain everything for the example. Because of dynamic IP addresses, use a range of addresses so any machine on the local network can mount the exported directory.
    # /etc/exports: the access control list for filesystems which may be exported 
    #                    to NFS clients. See exports(5). 
    # Example for NFSv2 and NFSv3: 
    # /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check) 
    # Example for NFSv4: 
    # /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check) 
    # /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check) 
    # /home/<user-name>,sync)
  3. Update the exports using the -ra option the confirm the file system has been exported:
    $ sudo exportfs -ra $ sudo exportfs /home/<user-name>
  4. On the host machine, make sure the exported directory is visible and then mount it:
    $ showmount -e 
    Export list for 
    /home/<user-name> $ sudo mount -t nfs<user-name> /mnt

The home directory of the Pi is now accessible under /mnt on the host machine. You can access files on the Pi here or copy new files to the Pi just by copying them to /mnt.

Previous Next