Virtual Machine ubuntu14 Configure NFS server host win7 mount local area network host mounting

Source: Internet
Author: User
Tags dns2

Virtual Machine ubuntu14 Configure NFS server host win7 mount local area network host mounting

Host win7 system, the system contains the Virtual Machine ubuntu14, other hosts in the LAN are also win7 system, all need to enable the NFS client program, win7 family Edition does not have this function, the method of enabling is as follows:

Because the static IP address is used for large switches connected to the company's network, we will introduce the Virtual Machine bridging method. The virtual machine bridging configuration is as follows:

Then set the network adapter for ubuntu 14:

Now the software settings are complete. Now you can configure the static IP address of ubuntu 14:

The IP address of the host is as follows:

IP: 10.19.155.100

Netmask: 255.255.255.0

Gateway: 10.19.155.254

DNS1: 10.16.5.88

DNS2: 10.16.6.88

IP address of the test machine in the LAN:

 

IP: 10.19.155.210

Netmask: 255.255.255.0

Gateway: 10.19.155.254

DNS1: 10.16.5.88

DNS2: 10.16.6.88

The IP address of ubuntu 14 to be configured:

 

IP: 10.19.155.41

Netmask: 255.255.255.0

Gateway: 10.19.155.254

DNS1: 10.16.5.88

DNS2: 10.16.6.88


Before configuring IP information, ensure that there is an NFS server program in ubuntu 14. Generally, automatic installation is not completed. Use apt-get install nfs-kernel-server to install it, And then install vim, apt-get install vim

You can use ifconfig eth0 to view the current IP address.

Then, use ifconfig eth0 10.19.155.41 netmask 255.255.255.0 to set the IP address and subnet mask.

Use route add default gw 10.19.155.254 to set the Gateway

Use vim/etc/resolv. conf to enter the file.

Add the following two statements: nameserver 10.16.5.88 and nameserver 10.16.6.88 to set the two DNS servers. A new line is required between the two statements, and ESC exits. Use: wq to save the exit file.

Note that the IP address, subnet mask, and gateway are all set temporarily, that is, after the VM is restarted, it will be the initial value.

To modify these three information permanently, you must use vim/etc/network/interfaces to modify the file. after entering the file, add the following statement:

 

Auto eth0

Iface eth0 inet static

Address 10.19.155.41

Gateway 10.19.155.254

Netmask 255.255.255.0

After saving and exiting, note that the file takes effect only after ubuntu 14 is restarted. After configuring the IP address, you can use ifconfig eth0 to view it.


Now configure the NFS server on ubuntu 14:

Use the vim/etc/exports statement to enter the output editing document and add the following content:/home/hou 10.19.155. * (rw, sync, no_subtree_check ).

The first NFS server shared directory, 10.19.155. * indicates that the IP address of the network segment 10.19.155 can be mounted on the NFS server of ubuntu 14. The following are common parameters:

Ro read-only access

Rw read/write access

Sync all data written for sharing upon request

Async nfs can respond to requests before writing data

Secure nfs is sent through the secure TCP/IP ports below 1024

Insecure nfs is sent over port 1024

Wdelay if multiple users want to write data to the nfs Directory, group write (default)

No_wdelay if multiple users want to write data to the nfs Directory, write the data immediately. This setting is not required when async is used.

Hide does not share its subdirectories in the nfs shared directory.

No_hide shares the subdirectory of the nfs Directory

Subtree_check if sub-directories such as/usr/bin are shared, force nfs to check the permissions of the parent directory (default)

No_subtree_check is opposite to the above. The parent directory permission is not checked.

All_squash: The UID and GID of the shared file are mapped to the anonymous user anonymous, which is suitable for public directories.

No_all_squash retains the UID and GID of the shared file (default)

Root_squash all requests of the root user are mapped to the same permissions as those of the anonymous user (default)

The no_root_squas root user has full management access permissions to the root directory.

Anonuid = xxx specifies the UID of an anonymous user in the nfs server/etc/passwd file

Anongid = xxx specifies the GID of anonymous users in the nfs server/etc/passwd file

Save and exit after configuration. restart the nfs server with/etc/init. d/NFS-kernel-server restart. You can also use netstat-lt to view the NFS server startup status:

Open a command prompt on host win7 or LAN testing machine and mount NFS server of ubuntu 14 with mount 10.19.155.41:/home/hou X:

In this way, you can use the NFS client to synchronize NFS servers in ubuntu.

If you use the/home/hou * (rw, sync, no_subtree_check) method to configure the NFS server, that is, to allow access from all users in the network segment, synchronization may fail, I tried it myself. When creating a file, there will be a problem. The file can be created, but the file cannot be used, but the file can be deleted. I don't know the specific cause, it may be because the route times out or something. Later, I learned how to update it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.