Steps to use VMWare to build a Linux environment under Windows (picture and text)

Steps to use VMWare to build a Linux environment under Windows (picture and text)

Since I returned the Mac, my original laptop has been idle. The configuration of this laptop is quite good. I can install several virtual machines for daily practice of building small-scale clusters.

Preparation

Install VMWare

Version: VMware Workstation 15 Pro 15.5.6 build-16341506

There is not much to say about the installation steps.

Download Linux Distribution

Since my cloud server has always used CentOS, I am used to it, so I also used CentOS this time.

Version: CentOS 7

You can download it from Tsinghua mirror site. Generally, you can download about 4.5G.

Creating a virtual machine

Open vmware ,文件-> 新建虛擬機

New wizard, select Custom, Next

Compatibility, default, next

Select the ISO file you just downloaded for the CD image file.

Set username and password (root cannot be used here, root will be created by default)

Select the location of the virtual machine file according to the hard disk space of your personal computer.

CPU configuration and memory configuration depend on personal situation. The default configuration is selected for demonstration here.

Network type, select bridged network here, the virtual machine network needs to be configured here later, otherwise it will not be able to connect to the external network

I/O controller type, hard disk type, based on the principle of choosing the default if you don't understand, here we choose the default options

Configure the maximum disk size according to your hard disk size

After everything is configured, click Finish to start the installation. Pour a cup of tea and wait for a few minutes.

vmware will automatically configure the centos installation options, and is installing..., continue drinking tea and waiting

The installation is complete. When this interface appears, it means the system has been installed.

Configure the network

Why configure the network?

After entering the system, open the terminal software and ping Baidu. It is found that the ping is not working. The host machine is also not working. It is definitely not working without network.

How to configure?

Add a bridged network in the vmware virtual machine network editor

It should be noted that the following two networks need to be set to host-only mode, and the host connection is shown as connected

First check whether the virtual machine has a network adapter. If not, you need to add one and set it to bridge mode.

Enter dhclient in the terminal. You need root user permissions. Switch to root first, su root

su root 
dhclient

Enter ifconfig to see ens36 or ens33

Modify the ens36 configuration file. Go to the /etc/sysconfig/network-scripts directory and check if there is an ifcfg-ens36 or ifcfg-ens33 file. If there is one, edit it. If not, create one to configure it. You can directly copy the following configuration.

Some of the more important ones are:

  • BOOTPROTO: Specify static, the IP address will not change later.
  • NAME DEVICE: should be consistent with the file name and what you see in ifconfig. Here it is ens36
  • ONBOOT: yes, follow the system startup
  • IPADDR NETMASK GATEWAY DNS1: These items should be configured according to your own network configuration. Just configure them to the same IP segment of the LAN. If there is no conflict with other IPs, here is 192.168.199.*
TYPE=Ethernet 
PROXY_METHOD=none 
BROWSER_ONLY=no 
BOOTPROTO=static 
DEFROUTE=yes 
IPV4_FAILURE_FATAL=no 
IPV6INIT=yes 
IPV6_AUTOCONF=yes 
IPV6_DEFROUTE=yes 
IPV6_FAILURE_FATAL=no 
IPV6_ADDR_GEN_MODE=stable-privacy 
NAME=ens36 
UUID=824ec4bd-a9ae-4410-8346-17ce7f3dd111 
DEVICE=ens36 
ONBOOT=yes 
IPADDR=192.168.199.212 
NETMASK=255.255.255.0 
GATEWAY=192.168.199.1 
DNS1=192.168.199.1

Save and exit after modification

Restart network services

systemctl restart network.service

Check whether the network is connected

 \[test@localhost network-scripts\]$ ping www.qq.com 
  PING public-v6.sparta.mig.tencent-cloud.net (220.194.111.148) 56(84) bytes of data. 
  64 bytes from www.qq.com (220.194.111.148): icmp_seq=1 ttl=53 time=9.56 ms 
  64 bytes from www.qq.com (220.194.111.148): icmp_seq=2 ttl=53 time=13.4 ms 
  64 bytes from www.qq.com (220.194.111.148): icmp_seq=3 ttl=53 time=20.3 ms 
  64 bytes from www.qq.com (220.194.111.148): icmp_seq=4 ttl=53 time=9.19 ms 
  64 bytes from www.qq.com (220.194.111.148): icmp_seq=5 ttl=53 time=9.92 ms 
  64 bytes from www.qq.com (220.194.111.148): icmp_seq=6 ttl=53 time=9.49 ms 
  ^C 
  \--- public-v6.sparta.mig.tencent-cloud.net ping statistics --- 
  6 packets transmitted, 6 received, 0% packet loss, time 5009ms 
  rtt min/avg/max/mdev = 9.195/11.994/20.327/3.999 ms 
  \[test@localhost network-scripts\]$ ping 192.168.199.119 
  PING 192.168.199.119 (192.168.199.119) 56(84) bytes of data. 
  64 bytes from 192.168.199.119: icmp_seq=1 ttl=64 time=1129 ms 
  64 bytes from 192.168.199.119: icmp_seq=2 ttl=64 time=130 ms 
  64 bytes from 192.168.199.119: icmp_seq=3 ttl=64 time=82.8 ms 
  64 bytes from 192.168.199.119: icmp_seq=4 ttl=64 time=120 ms 
  64 bytes from 192.168.199.119: icmp_seq=5 ttl=64 time=30.8 ms 
  64 bytes from 192.168.199.119: icmp_seq=6 ttl=64 time=25.4 ms 
  64 bytes from 192.168.199.119: icmp_seq=7 ttl=64 time=63.0 ms 
  ^C 
  \--- 192.168.199.119 ping statistics --- 
  8 packets transmitted, 7 received, 12% packet loss, time 7011ms 
  rtt min/avg/max/mdev = 25.445/226.124/1129.858/370.829 ms, pipe 2
 
 Use the terminal tool ssh to connect. If you can connect, it proves that there is no problem with the network.

Remark

There are a few pitfalls in network configuration that need to be explained. When writing this article, there are a few points that are different from my previous practice.

1. Network adapter here, the virtual machines installed before are all default, but there is no network adapter here, so you need to add one manually on your phone.

2. dhclient Here, there was a network adapter by default before, so the generated network name was ens33. It was generated once when there was no adapter before, which was `lo`. After adding the adapter, it was generated again and the name was found to be `ens36`, which was slightly different from before. There was no ens36 configuration file in the `/etc/sysconfig/network-scripts` directory, so you need to create a new file here. The previous virtual machines all had ens33 by default, so you only need to make some changes. Here, for my personal understanding, the only difference is the name, and the configuration is sufficient.

After my system was installed, the time zone was wrong. I just changed it in the system.

This concludes this article about the steps (with pictures and text) to use VMWare to build a Linux environment under Windows. For more information about how to use VMWare to build a Linux environment, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Tutorial on installing CentOs7 with VMware in win7 to build a Linux environment

<<:  js realizes the image cutting function

>>:  Tutorial on installing MySQL8 compressed package version on Win10

Recommend

Detailed explanation of TS object spread operator and rest operator

Table of contents Overview Object rest attribute ...

Summary of standard usage of html, css and js comments

Adding necessary comments is a good habit that a ...

Complete steps to implement face recognition login in Ubuntu

1. Install Howdy: howdy project address sudo add-...

Tutorial on installing Tomcat server under Windows

1 Download and prepare First, we need to download...

Solution to MySQL being unable to start due to excessive memory configuration

Problem Description MySQL reports an error when s...

Detailed explanation of the principle of Docker image layering

Base image The base image has two meanings: Does ...

MySQL slow query: Enable slow query

1. What is the use of slow query? It can record a...

An article to help you understand jQuery animation

Table of contents 1. Control the display and hidi...

Detailed explanation of 6 ways of js inheritance

Prototype chain inheritance Prototype inheritance...

Detailed explanation of the new background properties in CSS3

Previously, we knew several attributes of backgro...

Docker installs redis 5.0.7 and mounts external configuration and data issues

Redis is an open source NoSQL database written in...

How to set Nginx to forward the domain name to the specified port

Enter /usr/local/nginx/conf sudo cd /usr/local/ng...

Description of the execution mechanisms of static pages and dynamic pages

1. A static page means that there are only HTML ta...

MySQL Packet for query is too large problem and solution

Problem description: Error message: Caused by: co...