VMware virtual machine installation and network configuration

First VMware version 15.1, linux: CentOS7 64 Wei (ISO image), the two are ready you can start to install our virtual machines.

VMware installation not go into details, this is mainly referring to the next how to install linux system and network configuration on VMware above

First, create a virtual machine

1. Open VMware to create a new virtual machine ----> select Custom

 

 

2. The next step until the installation has been guest operating system, choose to install the operating system later

 

3. Selection and prepared the corresponding mirror system

 

 

 4. The memory allocation if no special requirement on the default go down, until the selected network type -----> we choose bridge mode (subsequent network configuration )

Bridged bridge mode (recommended):
VMWare virtual operating system out like a LAN a stand-alone host, it can access any machine within the network, you need to manually configure the IP address, subnet mask of the virtual system, but also to the host machine and the same network segment, so virtual machines and host systems to communicate the relationship between virtual system and host machine, just connect two computers on the same Hub of.
NAT Network Address Translation modes:
virtual system by means of NAT functionality to access the public network via a network host is located. In this mode, the host becomes dual card host simultaneously involved in a host of existing LAN and the new virtual local area network, but due to the incorporation of a virtual NAT server, so that the virtual machines within the virtual local area network when an external access is the use of It is the IP address of the host, so that from the external network point of view, can only see the host, can not see the new virtual LAN.
Host-only host mode:
Create a LAN by the host and all virtual machines constituted, but the LAN and the host itself which is independent of the existing LAN, if not extra route setting, the two LANs not between communication, so the new local area network can be considered as belonging to a separate private network is currently the host of its members for the current host and all associated virtual machines.

5. Continue to the next step until the distribution of hard disk, do not choose immediate assignment, assignment immediately will immediately draw the size of your choice on your hard disk to the virtual machine

 

6.继续下一步就可以了,至此虚拟机就创建好了。

二、虚拟机系统安装

1.选中我们刚才建好的虚拟机右键设置--->CD/DVD--->使用ISO镜像文件

 

2.确定之后开启虚拟机---进入等待。。。

 

3.语言选择根据自己需要来,反正我选择的中文,时间可以调整成自己的时间,“软件选择”不要选择最小安装,如果选择最小安装,可能会缺失很多必要的配置,后续配置也比较麻烦。我们选择“基础设置服务器”一般来说,基本就可以了

 

 

 

4.安装位置--->自动分区

5.网络和主机名--->可以看到当前虚拟机的网卡(后续配置网络要用到),还可以修改主机名

 

 

6.设置好之后就可以开始安装--->设置用户,根据自己需要,我这儿只设置了root用户。漫长的等待。。。之后重启。

 

 

系统安装完成

 

 三、网络配置

1.配置IP信息

在 /etc/sysconfig/network-scripts下找到刚才网络配置时候的网卡信息,我这儿是ens33,对应的文件就是ifcfg-ens33这个文件

 

将此文件内容配置如下(配置主要的,非必要已经删除):

TYPE=Ethernet # 网络类型为以太网
BOOTPROTO=static # 手动分配ip
DEVICE=ens33 # 网卡设备名,设备名一定要跟文件名一致 我的是ens33,如果配置不一样,等下网络重启的时候会失败
ONBOOT=yes # 该网卡是否随网络服务启动
IPADDR=192.168.1.67 # 该网卡ip地址     和自己宿主机同一网段
NETMASK=255.255.255.0 # 子网掩码
GATEWAY=192.168.1.1 # 网关  和自己宿主机一样
DNS1=8.8.8.8 #  8.8.8.8为Google提供的免费DNS服务器的IP地址

 

 

 

 

2.配置网络工作--->/etc/sysconfig/network文件里增加 :NETWORKING=yes # 网络是否工作,此处一定不能为no

 

 

3.配置公共DNS服务---> 在/etc/resolv.conf文件里增加:nameserver 8.8.8.8

 

 

4关闭防火墙

systemctl stop firewalld           # 临时关闭防火墙
systemctl disable firewalld      # 禁止开机启动

 

 

5.重启网络服务--->显示OK的话就配置OK了

 service network restart

 

 6.已经可以访问百度,说明我们网络配置已经正在OK了,后续在虚拟机上面安装一些软件直接可以选择在线安装了

 

 

 

四、VMware克隆

如果我们想要搭建集群的时候,需要创建多台虚拟机,不可能每台都这样子去配置,然后安装软件。这个时候可以使用VMware提供的克隆功能,从已经安装配置好的虚拟机克隆一个出来,这个可能会连带着你已经装好的软件一起克隆,比如你在A机器上面装了JDK,克隆出来的B也是安装好JDK的。只是需要注意的时候,克隆出来的机器需要修改下网卡配置中的IP,不能和之前一样就行了。

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/nijunyang/p/12001312.html