Felix Urbasik

Felix Urbasik

Welcome to my personal knowledge archive.

← Back to Index

NFS is the new Samba

So, I was setting up a little home NAS server using an Odroid C2 and an 8 TB hard drive hooked up via USB. One thing I learned is that you should definitely format the drive as ext4. I tried NTFS first using ntfs-3g, but it requires way too much CPU power compared to ext4. After I reformatted the drive to ext4 i had acceptible performance for a USB 2.0 connection.

Anyways, I needed a way to easily access my files from my Windows 10 machine. Not knowing any better I installed a SMB server. Soon I found myself deep in the SMB rabbit hole, desperately trying to configure a public share that anyone in the network could access without credentials. It was a pain in the ass. I spent multiple days flipping through ancient forum posts with no success. Finally, an article by linuxbabe.com from 2021 was recent enough to give me a configuration that works. And even then, stupid Windows 10 would still ask for credentials, and would not shut up until I entered "guest" and no password.

There must be an easier way, I thought. Let's be honest here, Samba is an emulator desperately trying to replicate the mess that Microsoft has created over the years.

NFS joins the battle

So I tried NFS. And it instantly worked. Flawlessly. Apparently Windows 10 has a native NFS client that you can enable throuth "Turn Windows features on or off".

Windows Features Screenshot

Setting up the NFS server

All you have to do is install nfs-kernel-server and then edit /etc/exports

/mnt/hdd 192.168.0.0/16(rw,sync,no_subtree_check)

Each line configures a shared directory. In this case I share the directory /mnt/hdd for anyone within the local network. Easy!

Mounting the NFS drive in Windows 10

After installing the NFS Client, all you have to do is:

mount -o anon \\192.168.2.31\mnt\hdd A:

And the drive will be mounted with drive letter A: (yes you can mount things on A: and B: now, wow!). No authentication, no passwords, no nothing. Although linux file permissions will still apply. Windows uses UID=-2 and GID=-2 by default, so you're basically not even a real user on the remote machine. But that's nothing a chmod 777 can't fix, right?

Changing the anonymous user

In my case, files and folders created via NFS showed up as belonging to a user known as "4294967293". That's not really a problem, but you can change that of you want. You can change the UID and GID that the NFS Client uses for anonymous connections Under the Windows Registry Key:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default

Windows Registry Editor Screenshot

I set AnonymousGID and AnonymousUID to 65534, because that seems to be the "nobody" user on my specific system.

Security concerns

Now, I know this isn't the most secure setup. NFS also isn't exactly a very secure protocol. Anyone who has access to your network will have access to the hard drive. But for me, that's the whole point of a home NAS server.