Recommended system from scratch (0)-virtual machine and host configuration

table of Contents

  1. Host settings
  2. Virtual machine settings
  3. VMware settings

Host settings

  1. Open Network and Sharing Center

Open adapter settings

See network and sharing center

  1. Change adapter settings

Change adapter settings
We only modify the VMnet8 adapter

Only modify the VMnet8 adapter
Change the attributes of VMnet8 as shown in the figure below. The IP address in it can be mine or 192.168.xx, but remember the address you set, which will be used to set up the virtual machine later.

Steps to modify adapter properties


Virtual machine settings

  1. View network card information
ifconfig

Query network card information

Remember the string in the red box

  1. Configure network card information

ens33 can be replaced with the string queried above

vim /etc/sysconfig/network-scripts/ifcfg-ens33

Add inside

IPADDR=192.168.31.221
NETMASK=255.255.255.0
GATEWAY=192.168.31.1

confirm

ONBOOT=yes
  1. Configure DNS
vim /etc/resolv.conf

Add to it

nameserver 223.5.5.5
nameserver 223.6.6.6
  1. Try to ping
ping baidu.com -c 5

If the following prompt appears, the configuration is complete

ping Baidu

If you want to distribute multiple virtual machines, then you need to do the following configuration

  1. Modify hostname
vim /etc/sysconfig/network

Join

NETWORKING=yes
HOSTNAME=Master
  1. Modify the hosts file
vim /etc/hosts

Join (after booting, there can be about 10G of free memory, about 4 to 5 virtual machines can be opened, and an average of 2G storage for one machine)

192.168.31.221 Master
192.168.31.222 Slave1
192.168.31.223 Slave2
192.168.31.224 Slave3
  1. Turn off SELinux
vim /etc/selinux/config

Then you can copy, and enter each virtual machine after the copy is completed (because the copy of the Master is used as the slave, then their HostName must be changed, otherwise SSH and other operations are inconvenient)

The operation is the same as the steps above to modify the host name

vim /etc/sysconfig/network

change

NETWORKING=yes
HOSTNAME=Slave1

The other two slaves and so on


VMware settings

  1. Open VMware's virtual network editor

VMware's virtual network editor

  1. Configure VMnet8

VMware settings

Guess you like

Origin blog.csdn.net/JikeStardy/article/details/104379829