Creating an NFS share on Windows XP

Recently, on the Mythtv-users mailing list, Gabe Rubin posted a question asking why he was getting no thumbnails in his mythweb view. Having already resolved that problem in my own environment, I told him that there was a bug in CIFS that showed up when using the MythTV uPnP code (which Mythweb does as of 0.21) and he was better off using NFS if possible. I also offered to help him get NFS working using Microsoft Services for Unix (SFU). Silly me 🙂

I’d never previously setup SFU under Windows XP. I’d only ever used it under a ‘Server’ version of Windows. As it turns out, there is a bug (or is that a feature?) in the User Name Mapping (UNM) feature of SFU that causes it to fail on Windows XP if the username/password combination of the *nix account you want to map does not match the username/password combination of the Windows account it is mapped to. The way UNM is supposed to work, is that it will take any *nix user account and map it to any Windows user account. Username and password is not supposed to matter, and indeed, this is the way it works in Windows Server. Not so for Windows XP though.

 So, for anybody out there trying to get SFU working properly (the NFS Server portion in particular) on a Windows XP machine, here are step-by-step instructions for what worked for me in my test-lab…

1) Install Windows XP, choosing NTFS filesystem, and WORKGROUP mode

2) Upgrade to Service Pack 3 and all post-sp3 ‘High Priority,’ and ‘Software, Optional’ updates shown on Windows Update

3) Download Windows Services for Unix v3.5 and run it to extract the files to an installation folder (C:\Temp\SFU35\)

4) Create Users and groups for use by MythTV…

4a) Open a command prompt and enter the following command…
..  C:\> compmgmt.msc

4b) Select ‘Computer Management’->’System Tools’->’Local Users and Groups’->’Users’ in the left tree

4c) Select ‘Action’->’New User’ from the top Menu bar

4d) Fill in the New User information with the following details then press the ‘Create’ button.
..  User Name: root
..  Full Name: MythTV Root
..  Description:
..  Password: <same as linux user password>
..  Confirm Password: <same as linux user password>
..  User must change password at next logon: not-checked
..  User cannot change password: checked
..  Password never expires: checked
..  Account is disabled: not-checked

4e) Fill in the New User information with the following details then press the ‘Create’ button.
.. User Name: mythtv
.. Full Name: MythTV User
.. Description:
.. Password: <same as linux user password>
.. Confirm Password: <same as linux user password>
.. User must change password at next logon: not-checked
.. User cannot change password: checked
.. Password never expires: checked
.. Account is disabled: not-checked

4f) ‘Close’ the ‘New User’ dialog

4g) Select ‘Computer Management’->’System Tools’->’Local Users and Groups’->’Groups’ in the left tree

4h) Select ‘Action’->’New Group’ from the top Menu bar

4i) Fill in the New Group information with the following details then press the ‘Create’ button.
.. Group Name: MythTvRootGroup
.. Description:
.. Add: root

4j) Fill in the New Group information with the following details then press the ‘Create’ button.
.. Group Name: MythTvGroup
.. Description:
.. Add: mythtv

4k) ‘Close’ the ‘New group’ dialog

5) Create a username mapping file by opening a command prompt and entering the following commands…
.. C:\> echo root:x:0:0:root:/root:/bin/bash > C:\windows\system32\drivers\etc\passwd
.. C:\> echo mythtv:x:500:500:mythtv:/home/mythtv:/bin/bash >> C:\windows\system32\drivers\etc\passwd

6) Create a groupname mapping file by opening a command prompt and entering the following commands…
.. C:\> echo root:x:0:root > C:\windows\system32\drivers\etc\group
.. C:\> echo mythtv:x:500: >> C:\windows\system32\drivers\etc\group

7) Run the SFU Setup program. C:\Temp\SFU35\setup.exe

7a) Choose whatever text for the customer information

7b) Accept the user agreement

7c) Choose ‘Custom’ installation

7d) Deselect all components except for…
.. 'NFS'->'Client for NFS'
.. 'NFS'->'Server for NFS'
.. 'Authentication Tools for NFS'->'User Name Mapping'
.. 'Authentication Tools for NFS'->'Server for NFS Authentication'

7e) Select ‘Change the default behaviour to case sensitive’

7f) Select ‘Local User Name Mapping Server’ using ‘Password and group files’

7g) Enter…
.. 'C:\Windows\system32\drivers\etc\passwd' as the 'Password file path and name'
.. 'C:\Windows\system32\drivers\etc\group' as the 'Group file path and name'
.. Whatever the local computer name is as the 'Windows domain name'

7h) Enter an installation folder location. The default of ‘C:\SFU\’ is as good a spot as any, so use it.

7i) Click on the ‘Finish’ button once setup has completed and allow the restart of your system.

8) Create the User and Group Mappings…

8a) Open ‘Services for Unix Administration’ console.
.. Start->All Programs->Windows Services for Unix->Services for Unix Administration

8b) Select ‘User Name Mapping’ -> ‘Configuration’

8c) Click on the ‘Synchronize Now’ button.

8d) Select ‘User Name Mapping’ -> ‘Maps’

8e) Unselect ‘Simple maps’

8f) Click on ‘Show User maps’

8g) Click on the ‘List Windows Users’ button. The ‘Windows Users’ list will become populated.

8h) Click on the ‘List Unix Users’ button. The ‘Unix Users’ list will become populated.

8i) Highlight ‘root’ from the ‘Windows Users’ list, and ‘root’ from the ‘Unix Users’ list then click on the ‘Add’ button.

8k) Click ‘OK’ for the ‘special unix account’ warning popup.

8l) Verify a mapping for ‘\\WINHOST\root PCNFS root 0 *’ shows up in the ‘Mapped Users’ list.

8m) Highlight ‘mythtv’ from the ‘Windows Users’ list, and ‘mythtv’ from the ‘Unix Users’ list then click on the ‘Add’ button.

8n) Verify a mapping for ‘\\WINHOST\mythtv PCNFS mythtv 500 *’ shows up in the ‘Mapped Users’ list.

8o) Click on ‘Show Group maps’

8p) Click on the ‘List Windows Groups’ button. The ‘Windows Groups’ list will become populated.

8q) Click on the ‘List Unix Groups’ button. The ‘Unix Groups’ list will become populated.

8r) Highlight ‘MythTvRootGroup’ from the ‘Windows Groups’ list, and ‘root’ from the ‘Unix Groups’ list then click on the ‘Add’ button.

8s) Click ‘OK’ for the ‘special unix account’ warning popup.

8t) Verify a mapping for ‘\\WINHOST\MythTvRootGroup PCNFS root 0 *’ shows up in the ‘Mapped Groups’ list.

8u) Highlight ‘MythTvGroup’ from the ‘Windows Groups’ list, and ‘mythtv’ from the ‘Unix Groups’ list then click on the ‘Add’ button.

8v) Verify a mapping for ‘\\WINHOST\MythTvGroup PCNFS mythtv 500 *’ shows up in the ‘Mapped Groups’ list.

8w) Click on the ‘Apply’ button at the top right corner of the ‘Services for Unix Administration’ window.

8x) Close ‘Services for Unix Administration’ window.

9) Share a folder via NFS…

9a) Open windows Explorer.
.. Start->All Programs->Accessories->Windows Explorer

9b) Highlight ‘Desktop’->’My Computer’->’Local Disk (C:)’

9c) Click on ‘Show the contents of this folder’ if you get a ‘These files are hidden’ warning.

9d) Select ‘File’->’New’->’Folder’ from the top menu bar.

9e) Name the folder ‘NFSShare’

9f) Select ‘Tools’->’Folder Options’ from the top menu bar in Windows Explorer

9g) Select the ‘View’ tab

9h) Under ‘Advanced Settings’ de-select ‘Use simple file sharing’ then click on ‘OK’ button.

9i) Right-click on ‘NFSShare’ and select ‘Properties’ from the popup context menu

9j) Select the ‘NFS Sharing’ tab.

9k) Select ‘Share this folder’ and fill in the following details…
.. Share name: nfs
.. Encoding: ANSI
.. Allow anonymous access: not-selected

9l) Click on the ‘Permissions’ button and fill in the following details…
.. Name: ALL MACHINES
.. Type of access: Read-Write
.. Encoding: ANSI
.. Allow root access: selected

9m) Click on ‘OK’ to close the Permissions window.

9n) Select the ‘Security’ tab.

9o) Highlight the ‘Users’ group in the ‘Group or User names’ list and place a checkmark next to ‘Full Control’ permissions.

9p) Click on ‘OK’ to close the NFSShare Properties window

One Response to “Creating an NFS share on Windows XP”

  1. mike says:

    Good tutorial.
    From my findings using the ‘x’ option in the password file necessitates the creation of a user with matching password.
    If PCNFS server is installed (not actually needed once running) and it is used to create the (old style) passwd file with the encrypted unix password then authentication then works as it should…ig
    root:j5euIV3peGLBg:0:0:root::

    regards

    Mike

Leave a Reply

You must be logged in to post a comment.