Mounting additional filesystems on a target system

Updated: April 19, 2023

If you require larger files and the image you run doesn't have enough space on it, you can mount a shared filesystem from a Linux, macOS, or Windows computer to your target.

CAUTION:
The filesystem you connect to can't be encrypted, otherwise you won't be able to mount it to your target.
On Windows:
  1. Create a shared folder on your computer. You must ensure that you add permissions to the shared folder and add the username you intend to use to connect to that shared folder, to secure it.
  2. On the target, run the fs-cifs command specifying the hostname, IP address, and name of the shared folder for the path, and the mountpoint you want created on the target. Then, you must enter your network credentials:
    $ fs-cifs -l //machinename:10.123.45.67:/share /mnt/share
    Welcome: 10.123.45.67(:/share) -> /mnt/share
    Username:myusername
    Password:
    
  3. On the target, navigate to the mounted directory and change the permissions of the files so that your target system can run any necessary programs and users can access any necessary data.
On Linux or macOS:
  1. Create a directory on your computer and ensure that it is exported by the NFS server running on your computer. For instance, on Ubuntu, you need to add a line to the /etc/exports file to have the NFS server share this folder, as shown here:
    $ cat /etc/exports 
    # /etc/exports: the access control list for filesystems which may be
    # exported to NFS clients.  See exports(5).
    #
    /home/username/nfs    *(rw,sync,no_root_squash)
    
    In this case, you are exporting the /home/username/nfs directory.
  2. On the target, run the fs-cifs command specifying the hostname, IP address, and name of the shared folder for the path, and the mountpoint you want created on the target. Then, you must enter your network credentials:
    $ fs-cifs -l //machinename:10.123.45.67:/share /mnt/share
    Welcome: 10.123.45.67(:/share) -> /mnt/share
    Username:myusername
    Password: