Linux (CentOS) minimizes installation and network configuration and its connection to the host on a virtual machine

Source: Internet
Author: User

Minimal installation and configuration based on virtual machine Linux system

" Install "

VMWare version 12 (all images can be clicked to open)

Open VMware, select the File menu-Create a new virtual machine, or use the shortcut key CTRL + N, select Customize, and then next, such as:

Select compatibility, default (if you need to support a lower version of VMware, modify the compatibility version to the appropriate version), select Next, for example:

Select the operating system installation method, select Install the operating system later, and then next, such as:

Select the operating system version, select Linux and CentOS 64-bit, and then next, such as:

Select the virtual machine name and installation location, name customization, location customization, and then select Next, such as:

Select the processor configuration, number of processors, number of cores to customize (if the machine is configured with a high selectable core number of 4, the General Notebook is 2 bar), then the next step, such as:

Select the virtual machine memory, by default (if the memory is sufficient to adjust the high, the general default of 1024m), and then the next step, such as:

Select the network type, such as the need for Internet optional bridging or NAT mode, if the personal use can choose host mode, the specific mode explanation is described in the annotations, this tutorial uses the NAT mode, and then the next step, such as:

Note:

1.bridged (Bridging mode)

Bridge mode is to bridge the virtual machine's network card directly on your real network card, and will not generate a separate network card in your system. The bridging mode network is represented in VMware by VMnet0, which can actually be seen as the real local area network in which your native computer is mapped in a virtual machine network, and a virtual machine that accesses the network via VMNET0 or bridge mode is equivalent to connecting to your actual LAN via a switch and your real machine. If your LAN provides DHCP services, your bridged network machine can automatically get the IP of your LAN. If you run the ipconfig command on a virtual machine that is bridged through the network, you can see the virtual machine's IP address in the real LAN segment. For other machines on the web, it is just like adding a real machine to this section of the network.

2.NAT (network address translation mode)

Virtual machines built with this mode are located within the VMnet1 subnet of the virtual machine, where VMware also provides DHCP services to allow the subnets ' virtual machines to easily obtain IP addresses. Of course, you can also manually set the IP for the virtual machine in this subnet, but be sure to note the address to be VMNET1 in the Set network segment. At this point, your real host will be the gateway for VMnet1, which means that the router between the virtual network VMnet1 and the real LAN forwards the data between the two network segments. The special thing about VMnet1 is that VMware has enabled the NAT service for this segment by default.

3.host-only (host mode)

The virtual machines in this mode are in the VMnet8 subnet of the VMware virtual network, which is no different from the virtual subnets of the VMnet1, which is the NAT mode, except that the IP segments are different and the NAT service is not provided. If you like you can activate the NAT service of the VMnet8 subnet completely, so that VMnet8 becomes the subnet of another NAT mode. If the default NAT is not activated, the subnet's virtual machine will only communicate with the other VMS in the VMNET8 network and the real host, which is the origin of the "host-only" name.

Select the I/O type, general default recommended settings, and then next, such as:

Select the disk type, general default recommended settings, and then next, such as:

Select the disk, create a new virtual disk, and then next, such as:

Select disk capacity, set the disk size, choose to store the virtual disk as a single file, and then next, such as:

Select the disk file, set the disk file name and location, and then next, such as:

When you see that the virtual machine configuration is complete, please do not hurry to complete the button, you need to select Custom hardware, configure the installation image, such as:

On the Custom Hardware page, select the new CD/DVD option, change the configuration to the right to use the ISO image file, select the CentOS 6.5 image, then click Close, such as:

This will go back to the custom page, click Done, and you'll see the virtual machine interface you've configured, such as:

Then click Open this virtual machine, and start installing the CentOS 6.5 system, choose Install or upgrade an existing system, then next, such as:

Skip the test and select Skip, such as:

Go to the Installation screen and select Next, such as:

Select the language, by default, select Next, such as:

Select the keyboard, by default, select Next, such as:

Select the storage device, by default, select Next, such as:

Prompt for a warning, select Yes, such as:

Set the hostname, configure the network, select Next, for example:

Set the time zone, select Asia Shanghai, select Next, such as:

Set root password (if set too short and do not copy will prompt, ignore), select Next, such as:

Select the installation method, use the all Space, and then next, such as:

When prompted, select write changes to disk, such as:

Select Minimal, then next, such as:

Start the installation, wait, for example:

Click Reboot restart to complete the installation, such as:

When the reboot is complete, you will see the system login page, such as:

" Configuration "

Computer operating system: Win7
Virtual machine software: VMware workstations
Operating systems installed on virtual machines: CentOS 7
System installation configuration: Minimized installation

Configuration steps:

Reboot into the command-line environment after installation, assuming we are logged in as root.
for a minimal installation of CentOS 7, you cannot view the network configuration with the Ifconfig command, so you can use the IP Addr "and" IP link " wait command to find the NIC details .
There are two main methods of network configuration (the second method is recommended):

(i) Image tool configuration
Minimize Installation The Setuptool tool is not installed by default, and requires the installation of related packages using Yum. The relevant commands are as follows:
#yum  install setuptool
install setuptool;
by executing the following command:
#yum install ntsysv
#yum Install iptables< /strong>
#yum install System-config-securitylevel-tui
installation of tool components such as system services, firewall configuration, and security configuration.
for Network Service tools, in CentOS 7, there is no network editing component in Setuptool, and the NetworkManager Text User Interface is required. That is, the NMTUI is configured. If a minimal installation is used, the software is not installed by default. You can install it manually using the following command:
#yum install  networkmanager-tui
Enter command at command line:
#nmtui
If you are prompted NetworkManager is not running, you need to start NetworkManager manually:
#systemctl start NetworkManager
run Nmtui again to enter the network editing interface.
Here you can edit the connection, activate the connection, and set the system host name for the network. To implement the connection with the host, see the second method for specific operations.

(ii) edit configuration file configuration
First, the CD to the network configuration file directory/etc/sysconfig/network-scripts/, and lists the files under the directory.
Then edit the network card profile under this directory, such as the "ifcfg-ens192" file name:
#vi/etc/sysconfig/network-scripts/ifcfg-ens192
Open the command-line environment for the host (Win7 environment), enter the command ipconfig view the host's IP address and default gateway information.
according to the host network card information, you need to configure the above file Ipaddr0 (IP address, the first three bits set to the same host, the last one and the host is different), GATWAY0 (gateway, set it as the same as the host), DNS1 (DNS, and the host DNS is consistent, Or you can temporarily set both to 8.8.8.8). Finally, change the onboot to Yes, and you can remove the MAC address and UUID to prevent collisions.
(in VI, press "DD" to delete the entire line, press "U" to recall the previous action, "a" into insert mode, ": Wq" to save and exit).
Then save the exit.
Restart the NIC again:

#service Network Restart

To view NIC Details:

#ip Addr

found that the "ens192" network card has appeared, and finally ping the host's IP address:

#ping *.*.*.* (host IP)

Found to be able to ping through;

Then ping the CentOS IP address in the console's command-line mode:

#ping *.*.*.* (CentOS system IP)

Found to be able to ping through.

Done!

Linux (CentOS) minimizes installation and network configuration and its connection to the host on a virtual machine

Related Article

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.