Network File System (NFS) allows Xiaomi devices โ whether smartphones, Mi TVs or routers โ to access files on a remote server as if they were stored locally, especially for streaming high-resolution media files, backing up or working with large amounts of data without taking up internal memory. But setting up NFS on Xiaomi devices has nuances, from the lack of built-in support in MIUI to the need for manual mounting on Android TV.
In this guide, weโll look at all the ways to connect NFS, from simple (through third-party applications) to advanced (via ADB and terminal), how to set up a server on a PC or NAS, which ports to open in a Xiaomi router, and why data rates sometimes drop to unacceptable levels, and how to get around the limitations of MIUI if your smartphone canโt see the network folder.
What is NFS and why is it needed by Xiaomi?
NFS is a network protocol developed in 1984, but still relevant today because of its speed and low CPU load. Unlike SMB (which is often used in Windows), NFS is optimized for Unix-like systems, including Android (which runs MIUI), making it an ideal choice for:
- ๐ฌ Streaming video 4K/8K bufferless (NFS Transmits data in small packets, reducing delays).
- ๐ Backup of photos and documents on NAS-server (e.g., Synology or QNAP).
- ๐ฎ Storage of games for emulators (for example, RetroArch on Mi Box).
- ๐ง Development: If you are a programmer, NFS Allows you to mount project folders directly from the server.
On Xiaomi devices, NFS is most commonly used to:
- ๐บ Mi TV and Mi Box - Watching movies with NAS flash-free.
- ๐ฑ Smartphones on MIUI โ Access files from a PC or server (for example, to work with Termux).
- ๐ก Xiaomi Routers โ Home Cloud Storage Organization.
The main advantage of NFS over SMB or FTP is faster read/write speed when working with small files (for example, thousands of photos), but there are also disadvantages: the protocol is not encrypted by default (you need to configure NFS over TLS), and the configuration requires knowledge of the command line.
Preparation: What you need to work NFS on Xiaomi
Before you connect to NFS, make sure you have:
- NFS-server: it could be: ๐ฅ๏ธ Computer with Linux (Ubuntu, Debian) or Windows (with installed) NFS Server for Windows). ๐ ๏ธ NAS-device (e.g., Synology) DS220+, QNAP TS-251D). ๐ก Router with support USB-storage devices (e.g. Xiaomi) AX9000 openwrt firmware).
- Xiaomi device with support NFS: ๐บ Mi TV (all Android models TV). ๐ฑ Smartphones on MIUI (Root or third-party applications are required). ๐ฎ Mi Box S/Mi Box 4 (support NFS box).
Network connection
- ๐ Local area network (Wi-Fi or Ethernet). NFS Not intended to work on the Internet without VPN!
- ๐ Static IP server (so that the path to the folder does not change).
- Click Connect and wait for the installation.
If the TV can't see NFS-folder:
- โ ๏ธ Check that the server is allowed access to IP your Mi TV (know IP You can set up โ On TV. โ Status).
- โ ๏ธ Make sure that the Xiaomi router does not block traffic between devices (turn off). AP Isolation in Wi-Fi settings).
- Press Mount and confirm permissions.
After mounting, the folder will appear in the MIUI File Manager on the specified path.
Method 2: Termux (for advanced users)
If you have Termux installed, do:
pkg install nfs-utils
mkdir ~/nfs_mount
mount -t nfs 192.168.1.100:/mnt/nfs_share ~/nfs_mountTo keep the mounting after the reboot, add a command to ~/.bashrc.
How to access NFS from other applications?
Limitations and challenges
โ ๏ธ Note: On smartphones Xiaomi without root mounted NFS-The folder will only be accessible to applications that have access to the storage, VLC can play video with NFS, a Gallery MIUI โ no.
If the application does not see the files:
- Check the permissions on the server (folder should be readable to everyone: chmod) -R 755 /mnt/nfs_share).
- Use FX File Explorer with Root Access enabled (if root is available).
Solving Common NFS Errors on Xiaomi
NFS can be unstable due to network settings, mounting errors, or MIUI limitations. Here are the most common problems and solutions:
| Mistake. | Reason. | Decision |
|---|---|---|
| mount: Operation not permitted | The server does not allow access from the clientโs IP or incorrect rights to the folder. | Check /etc/exports on the server. Run sudo exportfs -ra. |
| NFS server not responding | A firewall or router blocks port 2049. | Open TCP/UDP port 2049 on the server and router. Turn off AP Isolation in the Wi-Fi router settings. |
| Slow transmission speed | Wi-Fi 2.4 GHz or weak signal is used. | Switch to 5 GHz or use Ethernet. Reduce rsize and wsize when mounting (e.g. mount -o rsize=8192,wsize=8192). |
| The folder is connected, but the files are not displayed | Incorrect access rights on the server. | Perform sudo chmod -R 755 /mnt/nfs_share. |
โ ๏ธ Note: If you are using Xiaomi Mi TV Stick, update your firmware to the latest version โ there was a support error in the older versions NFS v4. Switch to the switch. NFS v3 server settings (/etc/exports add the parameter -v3).
Optimizing NFS Speed on Xiaomi
By default, NFS can run slower than SMBs due to large packet sizes or network delays. Here's how to speed up data transfers:
1. Configuring the mounting parameters
When mounting, specify the optimal values for rsize and wsize (read/write block size).
mount -t nfs -o rsize=32768,wsize=32768,hard,intr 192.168.1.100:/mnt/nfs_share /mnt/local2. Use of NFS v4 instead of v3
NFS v4 supports more efficient file management and works better over NAT.
- On the server in /etc/exports, add the fsid=0 parameter:
- When installing, specify the version:
3. Disabling Attributes (noatime)
If you donโt care about file metadata (access time), add the noatime option:
mount -o noatime,nodiratime4.MTU network verification
If the speed drops when transferring large files, reduce the MTU on the Xiaomi router to 1472 (in the LAN settings).
๐ก
For streaming 4K video, optimal mounting options are: rsize=65536,wsize=65536,noatime,nodiratime. This will reduce the load on the CPU and eliminate jerks.
How to protect NFS on Xiaomi
NFS doesn't encrypt traffic by default, so it's easy to intercept it on a local network. Here's how to improve security:
1. Restriction of access over IP
In /etc/exports, only the trusted IPs are listed:
/mnt/nfs_share 192.168.1.101(rw) 192.168.1.102(ro)2.Use of NFS over TLS
To encrypt traffic, use Stunnel or VPN:
- ๐ Set up OpenVPN on Xiaomi router and connect to NFS only VPN.
- ๐ Use sshfs instead of sshfs NFS, If you need complete safety, but the speed will be lower).
3. Disable unused versions of NFS
In /etc/nfs.conf, leave only the versions you want (e.g. v4):
[nfsd]
vers2=n
vers3=n
vers4=y4. Firewall settings on Xiaomi router
On Xiaomi routers (such as the AX3600):
- Open Settings โ Additional โ Security โ Firewall.
- Add a rule to allow traffic from IP yours NFS-server to port 2049.
- Turn off UPnP if you don't need it.
โ ๏ธ Never open port 2049 to access from the Internet without a single connection. VPN! NFS Vulnerable to Man-in-the-Middle attacks, and attackers can access your files.