Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

Following on from my woes at trying to use Samba to share media from my windows machine (SMB performance issues on Raspbmc) i thought i'd try (and share) my knowledge of getting my Windows XP Pro Machine running as an NFS server instead.

There has probably been many variations on doing this, but i hadn't seen one that matched my setup, a setup that i feel many people still have.

XP Pro server

Spec : Pentium IV 3.4Ghz 4GB ram, 500Gb Sata-II drive, edimax wireless PCI card.

IP : 192.168.1.40

Location : Attic

Raspberry Pi

RaspBmc - Nightly build 12/1/2013

External Powered USB Hub with : Logitech K260 Wireless Key/mouse & TP Link WN823N Wireless USB & Bluetooth USB.

IP : 192.168.1.100

Location : Living room

share|improve this question

3 Answers 3

up vote 8 down vote accepted

How I did it

INSTALLING NFS

http://technonstop.com/tutorial-setup-nfs-server-windows

Followed the instructions from several websites.

1) Firstly, Grab the "Services for unix for windows" from : http://www.microsoft.com/en-gb/download/details.aspx?id=274

2) Do a custom install, selecting only

  • NFS -> Server for NFS
  • Authentication tools for NFS -> User Name Mapping
  • Authentication tools for NFS -> User Name Server for NFS authentication

3) During install select the behaviour to Case Sensitive

4) Next, select Local User Mapping Server -> Password and group files

-- My addition The next stage asks you to upload passwd and group files, I simply created 2 files on the XP desktop. From this post : http://www.networkedmediatank.com/showthread.php?tid=1434&pid=460253#pid460253 I modified the passwd/group files

passwd

root:x:0:0:root:/root:/bin/sh
pi:x:1000:1000:pi:/home/pi:/bin/sh

group

root:x:0:
pi:x:1000:

to represent the Raspberry pi user.

5) Once the installation was complete, go start -> windows services for unix -> services for unix administration

6) select User Name Mapping on the left, and then the maps option on the right. I didn't select Simple maps, and decided to use advanced maps

Show User Maps

click list windows users and list unix users. from windows select Administrator from unix select pi then click add ignoring the warning about administrator special account

Show Group Maps

click list windows groups and list unix groups. from windows select Administrators from unix select pi then click add

Then apply in the top right.

Setting up shares

1) For each of my shares E:\music and E:\movies i right clicked on the folders in windows explorer, selected sharing and security and then the NFS Sharing tab.

2) Within the tab I created the share names music and movies with an encoding of ANSI, unchecking anonymous access

3) Within the permissions button, i unchecked Allow root access and selected Read/Wite as the type of access

4) Ok'd all this

5) Within /etc/fstab on the raspberry pi (via PuTTy) sudo nano /etc/fstab I added the following lines:

192.168.1.40:/music /home/pi/music  nfs defaults,user,auto,noatime,intr 0   0
192.168.1.40:/movies    /home/pi/movies nfs defaults,user,auto,noatime,intr 0   0

(obviously after creating the relevant directories within /home/pi)

Firewall setup

Unfortunately the initial firewall port opening specified in the bottom of this post : http://www.networkedmediatank.com/showthread.php?tid=1434&pid=460252#pid460252 didn't appear to work for me, however (shock) microsoft was on hand to offer that perhaps I should try and open some other ports too.

User Name Mapping and Server for NFS    Portmapper                  TCP, UDP        111
Server for NFS                          Network Status Manager      TCP, UDP        1039
Server for NFS                          Network Lock Manager        TCP, UDP        1047
Server for NFS                          NFS Mount                   TCP, UDP        1048
Server for NFS                          Network File System         TCP, UDP        2049

(from http://technet.microsoft.com/en-us/library/cc753302(v=ws.10).aspx )

DONE! I added the new mounts as sources in both music and movies, and they appear much much more responsive than samba

share|improve this answer
    
Only difference I was on Windows 8 a laptop, had to use Oracle VirtualBox with FreeNAS freenas.org using the BridgeAdapter on the VB, had to add another Virtual Hard Drive as Storage (8GB fixed). only had to switch on NFS/FTP in Unix(mode) Raspberry Pi picked up the NFS share instantly (using Raspbmc) –  Mapperz Jan 18 '13 at 15:36
1  
Unfortuntely Unix Services for Windows does not run on the x64 Version of Windows 7 Professional –  Skip Jan 12 at 15:57

This is peachy for WinXP, but less good for other versions of Windows, which MS explicitly say their "services for Unix" won't work with.

FreeNFS doesn't work for me (reasons still TBD), and others are paid-for. The only free Windows NFS server I've found which works is on CodeProject.

http://www.codeproject.com/Articles/309936/Csharp-NET-Network-File-System-NFS-Server?msg=4719043#xx4719043xx

I've got some improvements to this (most importantly setting a "virtual root" so that you don't have to expose your whole C: drive) which hopefully will get rolled back into his codebase. It's not the prettiest code ever, and there are definitely ways its performance can be improved, but it does the job perfectly well for mounting a root filesystem.

share|improve this answer

I did notice that your server is in the attic. Depending on where you live this may be fine, but I live in Texas and I've had a Wifi point go out in about a year due to heat. Spoke with a good buddy of mine that works as a computer tech/network specialist for a local city and he said the heat knocked out my wifi antenna. CPU's also do not like the heat and can slow down significantly or fry. If this is the case, try moving your CPU to a closet that has good airflow. I have also considered placing mine in the air return on the central A/C which would provide better airflow and also pretty easy access. Not to mention harder to find for vandalism.

Keep Calm and Chive On!!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.