2026-06-08 WSL2 NFS Rootfs Troubleshooting Note
Symptom
The i.MX6ULL board booted a new Linux 7.0 kernel with NFS rootfs bootargs:
console=ttymxc0,115200 root=/dev/nfs rw nfsroot=192.168.60.1:/home/charliechen/imx-forge/rootfs/nfs,v3,tcp ip=192.168.60.200:192.168.60.1:192.168.60.1:255.255.255.0::eth0:offThe kernel brought up Ethernet and completed static IP configuration:
fec 20b4000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
IP-Config: Complete:
device=eth0, hwaddr=b8:ae:1d:01:00:04, ipaddr=192.168.60.200, mask=255.255.255.0, gw=192.168.60.1
bootserver=192.168.60.1, rootserver=192.168.60.1, rootpath=But the board did not mount the NFS rootfs. Packet capture did not show the expected NFS mount traffic from the board.
Important Lesson
Do not start by blaming the board, bootargs, firewall, or kernel config when the host-side NFS server changed.
First prove the host can mount its own export locally:
sudo mkdir -p /tmp/nfs-test
sudo mount -v -t nfs -o vers=3,proto=tcp,nolock \
127.0.0.1:/home/charliechen/imx-forge/rootfs/nfs /tmp/nfs-testIn this case, localhost NFSv3 mount also hung. That immediately moved the fault boundary from board/kernel to WSL2 NFS service.
Failed Kernel NFS Server Evidence
nfs-kernel-server appeared superficially alive:
sudo exportfs -rav
sudo exportfs -v
rpcinfo -p 127.0.0.1
showmount -e 127.0.0.1But actual NFSv3 mount hung around the MOUNT/NFS RPC flow:
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 127.0.0.1 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=6
mount.nfs: trying 127.0.0.1 prog 100005 vers 3 prot TCP port <random>The kernel nfsd export table was also empty even after exportfs -rav:
sudo cat /proc/fs/nfsd/threads
# 8
sudo cat /proc/fs/nfsd/exports
# Version 1.1
# Path Client(Flags) # IPsA minimal /srv/nfs-test export had the same failure, so the problem was not the rootfs directory.
Conclusion: this new WSL2 environment's kernel NFS server path was unusable for NFSv3 rootfs boot.
Working Fix: NFS-Ganesha
Install Ganesha and the VFS FSAL plugin:
sudo apt install nfs-ganesha nfs-ganesha-vfsStop the kernel NFS server but keep rpcbind:
sudo systemctl stop nfs-kernel-server
sudo systemctl restart rpcbindUse this /etc/ganesha/ganesha.conf:
NFS_CORE_PARAM {
Protocols = 3;
Bind_addr = 0.0.0.0;
NFS_Port = 2049;
MNT_Port = 20048;
mount_path_pseudo = false;
Enable_NLM = false;
}
EXPORT_DEFAULTS {
Access_Type = RW;
Squash = no_root_squash;
SecType = sys;
}
EXPORT {
Export_Id = 1;
Path = /home/charliechen/imx-forge/rootfs/nfs;
Pseudo = /nfsroot;
Access_Type = RW;
Squash = no_root_squash;
SecType = sys;
Protocols = 3;
Transports = TCP;
FSAL {
Name = VFS;
}
CLIENT {
Clients = 127.0.0.1, 192.168.60.0/24;
Access_Type = RW;
Squash = no_root_squash;
}
}
LOG {
Default_Log_Level = INFO;
Facility {
name = FILE;
destination = "/var/log/ganesha/ganesha.log";
enable = active;
}
}Restart and verify:
sudo systemctl restart nfs-ganesha
rpcinfo -p 127.0.0.1
showmount -e 127.0.0.1Expected key ports:
100003 3 tcp 2049 nfs
100005 3 tcp 20048 mountdExpected export:
Export list for 127.0.0.1:
/home/charliechen/imx-forge/rootfs/nfs 127.0.0.1/32,192.168.60.0/24If showmount is empty, check /var/log/ganesha/ganesha.log. A common missing package error is:
Failed to load FSAL (VFS) because: No such file or directory
No export entries found in configuration file !!!Fix it with:
sudo apt install nfs-ganesha-vfs
sudo systemctl restart nfs-ganeshaFinal Working U-Boot Bootargs
Direct bootargs:
setenv bootargs 'console=ttymxc0,115200 root=/dev/nfs rw nfsroot=192.168.60.1:/home/charliechen/imx-forge/rootfs/nfs,vers=3,proto=tcp,nolock,port=2049,mountport=20048 ip=192.168.60.200:192.168.60.1:192.168.60.1:255.255.255.0:imx6ull-aes:eth0:off'Reusable U-Boot environment:
setenv ipaddr 192.168.60.200
setenv serverip 192.168.60.1
setenv gatewayip 192.168.60.1
setenv netmask 255.255.255.0
setenv hostname imx6ull-aes
setenv nfsrootdir /home/charliechen/imx-forge/rootfs/nfs
setenv nfsargs 'setenv bootargs console=ttymxc0,115200 root=/dev/nfs rw nfsroot=${serverip}:${nfsrootdir},vers=3,proto=tcp,nolock,port=2049,mountport=20048 ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:eth0:off'
setenv netbootaes 'run nfsargs; tftp ${loadaddr} ${bootfile}; tftp ${fdt_addr} ${fdt_file}; bootz ${loadaddr} - ${fdt_addr}'
run netbootaesWhy mountport=20048 Matters
NFSv3 uses both:
- NFS service: RPC program
100003, normally TCP port2049. - MOUNT service: RPC program
100005, often a random dynamic port.
Ganesha was configured with:
NFS_Port = 2049;
MNT_Port = 20048;The kernel bootargs then pin both ports:
port=2049,mountport=20048This avoids random mountd ports and makes WSL/Windows firewall or port-forwarding troubleshooting much less painful.
Debug Checklist
- Check that the board got IP:
IP-Config: Complete
device=eth0
rootserver=192.168.60.1- Check Ganesha exports:
showmount -e 127.0.0.1
rpcinfo -p 127.0.0.1- Check Ganesha logs:
sudo tail -120 /var/log/ganesha/ganesha.log- If using NFSv3 rootfs, always include:
vers=3,proto=tcp,nolock,port=2049,mountport=20048- If the board cannot reach it but localhost can, inspect Windows/WSL networking next.