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.
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
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 ubuntuAfter 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
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.
| Parameter | Recommended value | Where to find out. |
|---|---|---|
| Battery | No restrictions. | Settings β Battery |
| Auto-start | Included. | Security β Permits |
| Wi-Fi access | Permitted. | Application settings |
| Alerts | It's important. | Notification settings |
| Sleep regimen | Stay awake | Lock 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.