Well, I did manage to find one tool, that offers a GUI for both server and client NFS setup, and it is Webmin, a "web-based interface for system administration for Unix". Here are some clickable screenshots:
Server setup GUI screenshots
(s0)
(s1)
(s2a)
(s2b)
(s3)
Client setup GUI screenshots
(c0)
(c1)
(c2a)
(c2b)
(c3)
However:
- Being web-based, it demands that a JavaScript (and SSL) capable browser is installed on both client and server computers
- Being a system-administration tool, it contains a lot more options than just NFS setup, so it can be difficult to get an instant overview of it
Also, note I don't know enough about NFS to setup proper security, which is why my goal is to setup shares for a local network quickly with no security; do a job; and then tear down the NFS sharing just as quickly. This and the above two reasons are why I was hoping I could track down a GUI that is simpler (e.g. written in Python/Tkinter, and for NFS only); but at least webmin
offers both server and client GUI setup, which is the most important for me to begin with (so I'm spared of dealing with NFS internals as much as possible).
I've made a test on Ubuntu 11.04 PC (proper install) as server and Ubuntu 12.04 PC (live image based on Mini Remix ISO) as client; and besides the installation of webmin
and dependencies being not exactly trivial - it's also not exactly trivial to use it to setup NFS. Which is why I will take the liberty to post my notes here, in a sort of a tutorial format - hope that's OK.
First, the usage. Note that in NFS (webmin
?) parlance:
- The PC sharing a folder on the network is the server, and its shared folder is known as an "NFS Export"
- All folders thus exported, in case of NFS 4, will be set under one (or more) "NFSv4 Pseudofilesystem" root(s)
- The PC accessing a network shared folder is the client, and the accessed network folder is known as an "NFS Share"
Server NFS sharing setup
- Create a directory to be shared, e.g.
/tmp/sharetest
- In
webmin
, visit https://127.0.0.1:10000
, and login with an account that is a sudoer
- After login, expand the "Networking" node in the left frame (requires JavaScript) (s0) and click on "Networking"/"NFS Exports" (s1)
- On the subsequent "NFS Exports" page, click on "Add a new export" (s1)
- On the next page, "Create Export", keep "NFS version" on 4, and click on the
...
button at the "Directory to export" field, and navigate to (with doubleclick) - and choose - the /tmp/sharetest
directory (s2a)
- Back on the "Create Export" page, you may want to set "Read-only?" to "No", and otherwise keep the defaults - finally click on "Create" button (s2b)
- The "NFS Exports" page is shown again, with two new entries,
/export
and /export/sharetest
(s3)
- Note here that
/export
is an automatically created "NFSv4 Pseudofilesystem" root
- If creating additional NFS exports, they can either use this pseudofilesystem root - or ask for a creation of a new one
Note that here, if you want to edit the NFS exports, there may be buggy GUI behavior for NFS v4 - for which I've filed a bug: Webmin / Bugs / #4286 NFS v4 exports do not persist as v4 upon edit - they revert to v3; and NFS Version help missing. The changes made to the NFS exports here, are reflected in the file /etc/exports
. Note that setting "Read-only?" (which is the rw
option in /etc/exports
) to "No" is not enough to allow the clients to write in the directory - you must also make /tmp/sharetest
world writable, using chmod 777
(see ref [3]); also note that files written by clients will preserve the writers' uids - you should check whether that introduces problems for you.
Client NFS sharing setup
- Create a local directory which will be mapped to the network share, e.g.
/tmp/nfsshare
- In
webmin
, visit https://127.0.0.1:10000
, and login with an account that is a sudoer
- After login, expand the "System" node in the left frame (requires JavaScript) (c0) and click on "System"/"Disk and Network Filesystems" (c1)
- On the subsequent "Disk and Network Filesystems" page, select "Network Filesystem v4 (nfs4)" from the dropdown, and click on the "Add mount" button (c1)
- On the next page, "Create Mount", click on the "..." button next to the "NFS Hostname" textfield (which initially says "mount") (c2a:1)
- A new window "Choose NFS Server" will popup; the NFS server should be autodetected if it is running - so click on the link under "IP Address" column (c2a:2), which will populate the "NFS Hostname" textfield with the corresponding "Hostname"; and close the popup
- Back on the "Create Mount" page, click on the "..." button next to the "NFS Directory" textfield (c2a:3)
- A new window "Choose NFS Directory" will popup; the exports should be listed - however note that "For an NFSv4 mount, you should select '/'" - so click on
/
link under "Directory" column (c2a:4), which will populate the "NFS Directory" textfield with the corresponding "Directory" - or just close the popup to leave the default /
unchanged
- Back on the "Create Mount" page, click on the "..." button next to the "Mounted As" textfield (c2a:5)
- A new window "Choose Directory" will popup; navigate to and choose the
/tmp/nfsshare
directory, and click OK (c2a:6)
- Back on the "Create Mount" page, you may want to set "Read-only?" to "No", and otherwise keep the defaults - finally click on "Create" button (c2b)
- Once back on the "Disk and Network Filesystems", you should see the new share being listed in the table (c3)
- To check that everything is OK, you can try listing the
/tmp/nfsshare
directory (c3) - or writing into the /tmp/nfsshare/sharetest
directory
Note that, if by accident you close down the NFS server while the clients are still running, you may be left with "dangling" shares; in this case, the command sudo umount -lf ...
seems to help:
ubuntu@Client:~$ mount
...
Server-eth0:/export/sharetest on /tmp/nfsshare type nfs (rw,addr=192.168.1.42)
Server-eth0:/export/sharetest on /tmp/.webmin/402201_1_save_mount.cgi type nfs (rw,vers=4,addr=192.168.1.42,clientaddr=192.168.1.77)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw)
Server-eth0:/export/sharetest on /tmp/.webmin/303774_1_save_mount.cgi type nfs (rw,vers=4,addr=192.168.1.42,clientaddr=192.168.1.77)
ubuntu@Client:~$ sudo umount -lf /tmp/.webmin/402201_1_save_mount.cgi
ubuntu@Client:~$ sudo umount -lf /tmp/.webmin/303774_1_save_mount.cgi
ubuntu@Client:~$ mount
...
Server-eth0:/export/sharetest on /tmp/nfsshare type nfs (rw,addr=192.168.1.42)
webmin
install on Server (Ubuntu 11.04 proper install)
suser@Server:tmp$ sudo apt-get install nfs-kernel-server # also pulls nfs-common
suser@Server:tmp$ sudo apt-get install libauthen-pam-perl libio-pty-perl libnet-ssleay-perl
suser@Server:tmp$ wget http://prdownloads.sourceforge.net/webadmin/webmin_1.580_all.deb
suser@Server:tmp$ sudo dpkg -i webmin_1.580_all.deb
Stop services
sudo service nfs-kernel-server stop # also clears /etc/exports
sudo service idmapd stop
sudo service portmap stop
sudo service webmin stop # also: sudo /etc/webmin/stop
Uninstall
sudo apt-get remove --purge nfs-kernel-server libauthen-pam-perl libio-pty-perl libnet-ssleay-perl && sudo apt-get autoremove --purge
# sudo dpkg -r webmin # not needed; the previous command should remove webmin by dependency
webmin
install on Client (Ubuntu 12.04 live image)
ubuntu@Client:~$ sudo nano /ets/apt/sources.list # uncomment `universe` repositories, and save
ubuntu@Client:~$ sudo apt-get update
ubuntu@Client:~$ sudo apt-get install nfs-common # "initctl: Unknown job: portmap / statd / gssd / idmapd" here
ubuntu@Client:~$ sudo initctl reload-configuration
ubuntu@Client:~$ sudo apt-get install --reinstall rpcbind nfs-common # now "portmap ... idmapd start/running,"
ubuntu@Client:~$ sudo apt-get install libauthen-pam-perl libio-pty-perl libnet-ssleay-perl
ubuntu@Client:~$ wget http://prdownloads.sourceforge.net/webadmin/webmin_1.580_all.deb
ubuntu@Client:~$ sudo dpkg -i webmin_1.580_all.deb
Stop services
sudo service idmapd stop
sudo service portmap stop
sudo service webmin stop # also: sudo /etc/webmin/stop
Uninstall
sudo apt-get remove --purge nfs-common libauthen-pam-perl libio-pty-perl libnet-ssleay-perl && sudo apt-get autoremove --purge
# sudo dpkg -r webmin # not needed; the previous command should remove webmin by dependency
Installation notes:
webmin
is not available in Ubuntu repositories; it can be installed through a .deb
package from the webmin site
- downloading an older .deb like here is not a problem, because webmin allows for updates directly from its web interface
- Nearly all
webmin
dependencies are available in the Ubuntu main
repositories, except for libauthen-pam-perl
, which is in the universe
repositories
- Ubuntu live images have the
universe
repositories disabled by default; so they must first be enabled by uncommenting the respective entries in /etc/apt/sources.list
, followed by sudo apt-get update
(else E: Unable to locate package libauthen-pam-perl
/ E: Package 'libauthen-pam-perl' has no installation candidate
occurs)
- Ubuntu live images apparently "did not rescan the /etc/init directory automatically" (ref. [1]), so they need a manual call to
initctl reload-configuration
(else initctl: Unknown job: portmap
occurs)
initclt
needs to be called with sudo
(else initctl: Rejected send message, 1 matched rules; ...
occurs)
- After installing
nfs-common
, a service called portmap
exists on both 11.04 and 12.04,
- ... however, 11.04 has a package called
portmap
- while 12.04 replaces it with a package rpcbind
(message Note, selecting 'rpcbind' instead of 'portmap'
occurs)
- What used to be known as
nfs-common
service in older Ubuntus, is now (apparently) called idmapd
(ref. [2])
- There is no
nfs
service (may be found in older tutorials) installed anywhere - neither on server nor on client
libio-pty-perl
may already be present on your system, if you have installed e.g. moreutils
; if so, be careful not to refer to it in the above uninstall commands (same goes for other dependencies)
References:
- Bug #857406 “Failed to install rpcbind” (#3) : Bugs : “linux” package : Ubuntu
- How to restart (or stop or heck even start) the nfs client service on ubuntu 9.10? - Super User
- [SOLVED] write permission for users on NFS folder
- Ubuntu Server: NFS Client and Server configuration using Webmin