1. In the lab environment, run Ubuntu9.04, VMware6.5, Ubuntu9.042, and install nfs service software on the host, because Ubuntu is not installed by default $ sudoaptitudeinstallnfs-kernel-server or use the new mode Package Manager to install 3. Install the nfs client on the Virtual Machine $ sudoapt-getinstallnfs-common4, assuming that the virtual machine is used
1. experiment environment: Host Ubuntu 9.04, VMware 6.5, and virtual machine Ubuntu 9.04
2. Install the nfs service software on the host Because Ubuntu is not installed by default.
$ Sudo aptitude install nfs-kernel-server
Or use the new lide Package Manager to install
3. Install the nfs client on the Virtual Machine
$ Sudo apt-get install nfs-common
4. Assume that the VM uses a bridge and the IP address is 10.1.60.34, that is, it is in the same network segment as the host.
5. Modify the nfs configuration file/etc/exports and add the following line:
/Home/yourname/export dir 10.1.60.34 (rw, sync, no_root_squash)
The first parameter is the directory you want the client to access, the second parameter is the IP address of the host you allow, and the last () parameter is the access control method.
6. Note that the above Host IP address cannot be configured with *. Otherwise, access will be rejected on the client. But what if we want to set LAN access? What should I do? Use a subnet mask, for example, 10.1.60.0/255.255.254.0 to allow access from 10.1.60. * And 10.1.61. *. You can also use the 10.1.60/23 Method to Determine the subnet.
7. Start the NFS service on the host
Test Configuration File
$ Sudo exportfs-r
$ Sudo/etc/init. d/portmap start
$ Sudo/etc/init. d/nfs-kernel-server start
8. Connect to the host on the client
$ Sudo mount host IP:/home/yourname/cmddir ~ /Nfsshare
Note: nfsshare must exist first.
9. You can also set the allowed hosts.
Modify/etc/hosts. allow. You don't need to modify it. You only need to specify the host in/etc/exports.