Lab 08: Configuring File-Based Storage with NFS and SMB (OPTIONAL)¶
Introduction¶
In this lab, you will configure file-based storage protocols using TrueNAS. Specifically, you will set up:
- NFS (Network File System) for Linux clients (Lubuntu VM).
- SMB (Server Message Block/CIFS) for Windows clients (your Host PC).
This demonstrates how SAN/NAS systems also provide file-level storage in addition to block-level (iSCSI) access.
By the end of this lab, you will:
- Enable and configure NFS shares.
- Enable and configure SMB shares.
- Access NFS shares from your Lubuntu VM.
- Access SMB shares from your Windows Host PC.
Step 1: Preparing the Environment¶
- Ensure your TrueNAS VM is running and
TechOpsPoolexists. - Ensure your Lubuntu VM (Lab 03) is running.
- Ensure your Windows Host is connected to the same bridged network.
Step 2: Configuring an NFS Share in TrueNAS¶
- Log in to the TrueNAS Web Interface.
- Go to Sharing → Unix Shares (NFS).
- Click Add.
- Path:
/mnt/TechOpsPool/DevTeam - Allow network:
192.168.0.0/24(adjust for your subnet). - Save and start the NFS service.
✅ NFS share is now active.
Step 3: Accessing NFS Share from Lubuntu VM¶
- On Lubuntu, open the terminal.
- Install NFS client tools:
sudo apt update && sudo apt install nfs-common -y
sudo mkdir /mnt/devteam
sudo mount <truenas-ip>:/mnt/TechOpsPool/DevTeam /mnt/devteam
ls /mnt/devteam
echo "Hello from Lubuntu" | sudo tee /mnt/devteam/lubuntu_test.txt
✅ The file is now stored on TrueNAS and accessible from other clients.
Step 4: Configuring an SMB Share in TrueNAS¶
- In the TrueNAS web interface, go to Sharing → Windows Shares (SMB).
- Click Add.
- Path:
/mnt/TechOpsPool/DevTeam - Name:
DevShare - Save and enable the SMB service.
✅ SMB share is now active.
Step 5: Accessing SMB Share from Windows Host¶
-
On your Windows 11 Host:
-
Open File Explorer.
-
In the address bar, type:
\\<truenas-ip>\DevShareExample:
\\192.168.1.120\DevShare2. Enter credentials: -
Username:
root - Password: (set during TrueNAS installation)
- You should now see the share contents.
- Test by creating a text file (
windows_test.txt) inside the share.
✅ Both Lubuntu and Windows can now access the same dataset over different protocols.
Step 6: Verifying Cross-Access¶
- On Lubuntu VM, check if the Windows file is visible:
ls /mnt/devteam
You should see windows_test.txt.
- On Windows Host, refresh the SMB share — you should see
lubuntu_test.txtcreated earlier.
✅ This confirms that multiple clients can access the same dataset using different file-sharing protocols.
Troubleshooting Tips¶
- NFS mount fails: Ensure NFS service is running and subnet is correctly set in TrueNAS.
- Windows cannot access share: Enable SMB1/SMB2 in Windows features if needed.
- Authentication issues: Use the
rootaccount or create a dedicated SMB user in TrueNAS. - Firewall issues: Allow SMB/NFS ports (111, 2049, 445) on your network.
✅ Congratulations! You have successfully configured NFS and SMB shares on TrueNAS, and accessed them from both Lubuntu and Windows Host. This simulates real-world file sharing in mixed environments.