Previously in Ubuntu Gutsy, sharing a folder using NFS was relatively easy. When you right click on a folder in Nautilus File Manager and select “Share Folder”, you were prompted to select SMB or NFS, or both. If either NFS or SMB servers were not installed, you were prompted to install them.
However, the entire process of sharing a folder in Gutsy was actually a little “messy”. First, a beginners might not understand the intricacy of folder sharing (i.e. might not know what to fill into the “Share Folder” dialogbox). Second, two choices of SMB and/or NFS might be too confusing. Perhaps, no choice should be given to a beginner (a more knowledgeable person would know the extra manual steps, if he wanted to have more choices).
Third, the GUI method of folder sharing in Ubuntu Gutsy was actually incomplete. The first time you enable SMB, you have to actually create and enable the SMB user and password from the command line.
sudo smbpasswd -L -a username sudo smbpasswd -L -e username
(replace username with your user’s name).
Side note:
Actually, I don’t really know what would happen if you use “Bob” instead of your Ubuntu username. Maybe it will still work, maybe it won’t, I just never tried it. Every HowTos I have seen said to use your Ubuntu username.
For NFS, every time you changed a setting in the “Shared Folder”, you have to run this command:
sudo exportfs -ra
else, the shared folder would not be enabled.
Perhaps, for all these reasons and maybe more, the Ubuntu developers decided to do something drastic when Hardy Heron 8.04 came along. I don’t know the real reasons, and I don’t really care as long as things still work. One good thing (in my opinion) about Linux OS is everything is hackable. The only limitation is yourself, i.e. how much time and effort you want to spend on getting it to do what you wanted.
So recently, I wanted to share a folder using NFS. I no longer ran any Windows system in my home network so SMB is not needed. Thinking nothing has changed from Gutsy to Hardy, I hunt around in vain for the NFS share option.
They have removed it! When you right-click on a folder in Nautilus File Manager and select “Sharing Options”, you are asked to install SMB and only SMB.
What about the old “Shared Folder” dialogbox? The menu entry
System > Administration > Shared Folder
has also been removed! So, the entire folder sharing GUI has been reduced to SMB sharing via Nautilus, and nothing else.
Before proceeding any further, I installed nfs-server manually.
sudo apt-get install nfs-common nfs-kernel-server portmap
Then, it’s time for google-fu. Some search acrobatics later, I found out the “Shared Folder” dialog box is still around, only you need to invoke it directly via command line.
shares-admin
From here, it is relatively simple to add a NFS shared folder. Don’t forget the exportfs command afterwards.
sudo exportfs -ra
However, running exportfs now gave a cryptic warning message:
exportfs: /etc/exports [1]:
Neither 'subtree_check' or 'no_subtree_check' specified
for export "192.168.1.2:/home/user/share".
Assuming default behaviour ('no_subtree_check').
NOTE: this default has changed since nfs-utils version 1.0.x
According to here, subtree_check option means “Verify requested file is in exported tree”. You could ignore this warning, or you could set subtree_check option by editing /etc/exports.
gksudo gedit /etc/exports
Add subtree_check inside the parenthesis, e.g. from:
/home/user/share 192.168.1.2(rw)
to:
/home/user/share 192.168.1.2(rw,subtree_check)
Save the file, and run exportfs again:
sudo exportfs -ra
That’s it!

Post a Comment