Setting up NFS on Xiaomi Mi 9: A Guide for Advanced Users

Owners of flagship smartphones like the Xiaomi Mi 9 often face the need to organize a local network for fast data exchange. the NFS (Network File System) protocol remains one of the most effective ways to provide access to the file system of a device from a computer or other network storage. Unlike the standard SMB, it requires finer configuration, but provides lower overhead.

However, Android's built-in tools don't provide a direct interface for deploying an NFS server without root rights. You'll have to use specialized software or emulate a Linux environment. This may seem complicated, but the result is worth it.

In this article, we will discuss in detail the configuration process, based on current methods of working with file systems in the MIUI shell. We will consider both software solutions and nuances of working with network interfaces of the device.

Preparation of the file system and access rights

Before you start a server, you need to make sure that your file system is ready for networking. Android's standard structure limits applications' access to system partitions, so it's important to choose the right directory to share. It's usually an external drive or a dedicated folder in internal storage.

If you plan to use root access, the possibilities are greatly expanded, in which case you can mount partitions and change the permissions to access system files. Without root rights, you will be limited to the sandbox of the specific application that you use to emulate the server.

⚠️ Warning: Changing the permissions to access system folders without understanding the consequences could lead to unstable Xiaomi Mi 9 operation or data loss.

To get started, you’ll need to install a plugin-enabled file manager or a dedicated server application. Make sure your device is connected to a Wi-Fi network, as NFS runs exclusively over a local area network.

πŸ“Š What level of access do you have to the Android system?
Root rights are there.
No root rights.
Planning to get
I don't know what it is.

Selection of NFS emulation software

Since Android doesn’t have a native nfsd demon in the user space, we’ll need third-party software. There are several solutions on the market that emulate how a network protocol works, and the choice depends on your technical skills and whether you have superuser rights.

One popular option is to use applications that create a virtual FTP/SMB/NFS gateway, which redirect requests from the network to local files, and for advanced users, install a Linux terminal emulator such as Termux, where you can deploy a full stack of network services.

  • πŸ“± File Manager Plus – a basic solution with support for plugins for simple sharing tasks.
  • πŸ’» Termux – a powerful terminal emulator for installing real Linux packages.
  • πŸ”’ Root Explorer – Required for root rights management.

When choosing the software, pay attention to the date of the last update. Older versions may contain security vulnerabilities or not work correctly with new versions of Android installed on the Mi 9.

Instructions for Configuration via Termux and Linux Environment

For the most flexible setup, it is recommended to use Termux, which allows you to install a Linux distribution directly on your phone, and requires you to execute commands in a terminal in sequence.

β˜‘οΈ Termux Preparation Checklist

Done: 0 / 4

First, you need to update the repositories and install the necessary packages. Enter the command to update: pkg update & & pkg upgrade. Then you need to install a proot-distro package to deploy a full-fledged Linux, such as Ubuntu or Debian.

pkg install proot-distro


proot-distro install ubuntu




proot-distro login ubuntu

After logging into the Linux environment, you need to install the server itself. NFS. In Debian-based distributions, this is an nfs-kernel-server package. /etc/exports, where folder paths and access rights are specified for IP-client-address.

List of instructions required to install NFS in Ubuntu inside Termux
apt update && apt upgrade apt install nfs-kernel-server mkdir -p /data/nfs_share chown nobody:nogroup /data/nfs_share chmod 222 /data/nfs_share echo "/data/nfs_share *(rw,sync,no_subtree_check,no_root_squash)" >> /etc/exports exportfs -a systemctl start nfs-kernel-server

Network and Firewall configuration of MIUI

MIUI is known for its aggressive energy saving policies and strict filtering of network traffic. Even if you set up the server correctly, the system can block incoming connections, you need to manually allow the application to access the network and work in the background.

Go to security settings and find permission management. Make sure that the server application you select has Autostart enabled and the background activity restrictions removed. Without that, Android can kill the server process minutes after the screen is turned off.

ParameterRecommended valueWhere to find out.
BatteryNo restrictions.Settings β†’ Battery
Auto-startIncluded.Security β†’ Permits
Wi-Fi accessPermitted.Application settings
AlertsIt's important.Notification settings
Sleep regimenStay awakeLock screen

Also make sure your router doesn’t isolate clients from each other (AP Isolation) if this feature is active, the computer won’t be able to β€œsee” the phone on the LAN, even if the server is running correctly.

Computer Connection and Testing

After setting up the server on Xiaomi Mi 9, move to the client side. On a Windows computer, you may need to install an additional NFS client to connect, since standard protocol support in home versions of the OS is often disabled or limited. Linux and macOS users can use built-in mounting tools.

To connect to Linux, use the mount command with the indication IP-Phone addresses and paths to the shared folder. IP-The address of your smartphone, which can be viewed in the Wi-Fi settings or in the server application itself.

sudo mount -t nfs 192.168.1.55:/data/nfs_share /mnt/xiaomi_share

⚠️ Warning: Make sure the firewall on your computer also allows incoming connections over port 2049, which is used by the protocol. NFS default.

If the connection is successful, you will see the smartphone files in the operating system conductor, and the data rate will depend on the quality of the Wi-Fi signal and the performance of the device’s flash memory.

πŸ’‘

Use the 5GHz band for Wi-Fi connections to achieve maximum file transfer speeds over NFS, as 2.4GHz is often overloaded.

Solving Typical Problems and Errors

Users often experience a β€œPermission denied” error or connection timeouts during the setup process, most often due to incorrect access rights in the Linux environment or a lock by MIUI. Check the /etc/exports file for syntax errors.

Another common problem is the change. IP-Addresses of the phone after reconnecting to the router. For stable operation, it is recommended to configure a static IP-address in the settings of the router or in the parameters of the Wi-Fi smartphone.

  • πŸ”„ Rebooting services – often helps to restart the demon NFS exportfs -ra.
  • πŸ“‘ Port Checking – Use port scanning tools to make sure port 2049 is open.
  • πŸ“ System Logs – Analyze application or terminal logs to find the reasons for the connection failure.

If nothing helps, try temporarily disabling antivirus software on your computer and checking your guest Wi-Fi network to avoid routing rule conflicts.

πŸ’‘

The stability of NFS on Android depends on the power saving settings of MIUI and the correct configuration of access rights in the Linux environment.

Security and optimization of server operation