How to enable NFS on Xiaomi Mi 8: a complete guide with configuration and error fixing

Xiaomi Mi 8

Network File System (NFS)

Turning on NFS on the Mi 8 is not a beginner’s task: it requires root rights, modification of system files and understanding of network protocols. But the result is worth the effort: file transfer speeds over the local network can exceed 100 MB / s (versus 10-30 MB / s for MTP), and access to files becomes as convenient as a regular network folder. In this guide, we will discuss two ways to activate NFS – through Magisk modules and manually, and consider typical errors and their solutions.

⚠️ Important: The procedure requires an unlocked bootloader and installed TWRP. If you have never worked with custom firmware, we recommend you first study our guides for unlocking Xiaomi Mi 8 and installing Magisk.Incorrect actions can lead to data loss or a β€œbrick” of the device.

1.Device preparation: root, TWRP and compatibility check

Before setting up the NFS, make sure your Xiaomi Mi 8 meets the following requirements:

  • πŸ”“ Bootloader unlocked. Without it, you can't get root rights.
  • πŸ› οΈ Established custom recaveri TWRP (version 3.6.0 or later).
  • 🌱 Superuser rights via Magisk (version 24)+).
  • πŸ“Ά Stable connection to the local network via Wi-Fi 5 GHz or Ethernet (via Wi-Fi) USB-OTG adapter).

If at least one of the conditions is not met, the NFS will not work. You can check the status of the bootloader unlock by the team in ADB:

fastboot oem device-info

Search for Device unlocked: true. To check for root rights, install the Root Checker app from Google Play.

πŸ“Š What is the root method used on Xiaomi Mi 8?
Magisk (patched boot.img)
Magisk via TWRP
SuperSU
Another method
I didn't get root.

The easiest and safest method is to use the ready-made NFS Server for Android module adapted for Magisk, which minimizes the risk of errors when manually editing system files.

Instructions:

  1. Download the NFS Server for Magisk module (check compatibility with your Android version).
  2. Open Magisk Manager, go to Modules β†’ Install from storage.
  3. Select the downloaded.zip file and confirm the installation.
  4. Reset the device.

After the reboot, the NFS Server icon will appear in the application menu. Launch it and configure:

  • πŸ“ Please specify the folder for export (for example, /sdcard/Download).
  • πŸ”’ Ask permissions (recommend rw,sync,no_subtree_check,no_root_squash).
  • 🌐 Enable the Start on boot option to automatically start the server.

Installed Magisk 24+| NFS Server module activated in Magisk|Folder for export is specified correctly |Server launched (status "Running") |PC and smartphone in the same network-->

⚠️ Note: If after installation of the module NFS Do not start, check the logs in Magisk (Logins) β†’ A common error is a conflict with other modules, such as BusyBox or KernelSU.

Method 2: Manual NFS setup (for power users)

If you prefer full control of the system, you can configure NFS manually, which requires editing system files and working with Terminal Emulator.

Steps:

  1. Install BusyBox via TWRP (if not already installed).
  2. Download binary files NFS-server ARM64: wget https://github.com/smartmonty/nfs-android/raw/master/nfsd-arm64 -O /system/bin/nfsd chmod 755 /system/bin/nfsd
  3. Create a configuration file /system/etc/exports: echo "/sdcard 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)" > /system/etc/exports Replace. 192.168.1.0/24 subnet.
  4. Start the server: nfsd start exportfs -a

To automatically start when downloading, add commands to /data/adb/post-fs-data.sh:

#!/system/bin/sh


/system/bin/nfsd start




/system/bin/exportfs -a

⚠️ Warning: Manual setup can break the system when there are errors in the export syntax.Always do backup /system If the device doesn't start after the reboot, restore the original boot.img via Fastboot.

What if NFS is not manually started?
1. Check the rights to the nfsd (ls) binary -l /system/bin/nfsd β€” must -rwxr-xr-x). 2. Make sure the port is 2049 not blocked by a firewall (e.g. AFWall)+). 3. In logs (logcat) | grep nfs) look for errors such as "permission denied" or "address already in use". 4. If you use a custom core, check for support. NFS in its configuration (CONFIG_NFS_V4=y).

4.Configure the connection from the PC (Windows/Linux/Mac)

After launch NFS-Xiaomi Mi 8 servers need to configure client connection on your computer.

For Windows 10/11:

  1. Open Control Panel β†’ Programs β†’ Enable or disable Windows components.
  2. Activate NFS Services β†’ Client for NFS.
  3. In the Conductor, enter the address: \\192.168.1.100\sdcard Replace. IP to your smartphone address.

For Linux/Mac:

Use the mounting command:

sudo mount -t nfs 192.168.1.100:/sdcard /mnt/xiaomi -o nolock,soft

If you have a mount.nfs: access denied by server error, check:

  • πŸ”Œ Correctness IP-Smartphone addresses (ifconfig on the device).
  • πŸ“‹ Rules in the file /system/etc/exports (subnet should match).
  • πŸ”₯ Firewall settings on PC (allow incoming connections to port 2049).

1. Launch regedit.

2. Move to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters.

3. Create a DWORD RequireSecuritySignature with a value of 0.

4.Reboot the PC.-->

5. Optimizing NFS performance

By default, NFS on Android can run slower than expected. Here are the key options for tuning:

ParameterRecommended valueThe effect
rsize32768Increases the size of the read block (accelerates the download of files)
wsize32768Increases the size of the recording block (accelerates copying to a smartphone)
timeo14Reduces timeouts with unstable connection
retrans2Reduces the number of repeat packet transfers
noatimeincludedDisables access time recording (reduces the load on flash memory)

Example of mounting command with optimization for Linux:

sudo mount -t nfs 192.168.1.100:/sdcard /mnt/xiaomi -o rsize=32768,wsize=32768,timeo=14,retrans=2,noatime,nolock,soft

For permanent mounting, add a line to /etc/fstab:

192.168.1.100:/sdcard  /mnt/xiaomi  nfs  rsize=32768,wsize=32768,timeo=14,noatime  0  0

πŸ’‘

Nolock and soft are mandatory for Android clients, and without them, you can freeze when you break the connection.

Typical errors and their solutions

Even with the right NFS setup, there can be problems.

  • 🚫 Error "Permission denied" Reason: Incorrect permissions in /system/etc/exports Solution: Check the folder rights (chmod) 777 /sdcard) Turn off SELinux temporarily (setenforce) 0).
  • πŸ”Œ Impossible to connect to the server Cause: Port 2049 blocked NFS-Solution: Check the status of the server (ps) | grep nfsd) and firewall (iptables) -L).
  • 🐒 Slow transfer speed Reason: Default settings or weak Wi-Fi connection are used. Solution: Apply optimized settings rsize/wsize and switch to 5 GHz Wi-Fi or Ethernet.
  • πŸ”„ Server spontaneously shuts down Reason: Android kills background processes or no keepalive.Solution: Add nfsd to battery optimization exception list and use tcp_keepalive_time=60 kernel settings.

If the problem is not solved, study the kernel logs:

su


dmesg | grep nfs

7. NFS Alternatives: When to Choose a Different Protocol

NFS is not the only way to organize network access to Xiaomi Mi 8 files. In some cases, it is better to use:

  • πŸ“‚ SMB (Samba) Pros: Easy to set up, better supported by Windows.Cons: Slower NFS on 20-30%, heavy-duty CPU.
  • πŸ”— SSHFS Pros: Encrypted connection, no root required. Cons: Speed limited by encryption (~50 MB/s).
  • ☁️ WebDAV Pros: Works over the Internet, cross-platform. Cons: Lowest speed (~10 MB/s), complex setup.
  • ⚑ FTP/FTPS Pros: Supported by all OS. Cons: No file locking, encoding problems.

Transfer speed comparison (test on Xiaomi Mi 8 with Wi-Fi 5):

ProtocolReading speed (MB/s)Recording speed (MB/s)CPU load (%)
NFS (optimized)85-11070-9010-15
SMB (Samba)50-6040-5025-30
SSHFS45-5535-4540-50
FTP30-4025-3520-25

πŸ’‘

NFS is ahead of the alternatives in speed and load, but requires root and customization skills, and SMBs are enough for simple tasks such as transferring photos.

FAQ: Frequent questions about NFS on Xiaomi Mi 8

❓ Can I include? NFS rootless?
No, NFS-The server requires superuser rights to work with system ports (2049) and mount folders: SSHFS (via Termux or FTP-server (e.g. Solid Explorer).
❓ Why after the reboot NFS not automatically start up?
Reasons: Magisk module not activated (check Settings) β†’ Modules. Script post-fs-data.sh It does not have the right to perform (chmod) 755). Android kills process due to battery optimization (add on) NFS Server except in exception).
❓ How to connect to NFS Android-based?
Use the app. NFS Manager or Total Commander with a plugin LAN Plugin, please specify in the settings: IP-server address (Xiaomi Mi) 8). Path to the exported folder (e.g, /sdcard). Port port 2049. For manual mounting (root required): mount -t nfs 192.168.1.100:/sdcard /mnt/nfs -o nolock,soft
❓ Is it safe to use? NFS public-network?
No! NFS In insecure networks (such as a cafe or hotel) use: πŸ”’ VPN (e.g. WireGuard for traffic tunneling. πŸ” SSH-tunnel (ssh) -L 2049:localhost:2049 user@192.168.1.100). πŸ›‘οΈ Firewall on your smartphone (allow connections only from trusted ones) IP). For maximum safety, replace NFS on SSHFS or WebDAV with TLS.
❓ Can I use it? NFS For streaming video with Xiaomi Mi 8?
Yes, but with reservations: βœ… 4K The video will be played without lag at network speed >50 MB/s. ⚠️ For HEVC (H.265) It may require hardware decoding on the client. ❌ DRM-Protected Content (Netflix, Disney)+) It will not be played due to Widevine's limitations. -t nfs 192.168.1.100:/sdcard /mnt/xiaomi -o rsize=65536,wsize=65536,hard,intr,tcp