introduceIt allows you to run multiple operating systems on your computer as virtual machines (as for why I chose this, it's mainly because the system already comes with it, so if I can avoid installing anything else, I'll try it out first)
PrepareDownload system imageGo to Alibaba Cloud to download the system: http://mirrors.aliyun.com/centos/7/isos/x86_64/ It is recommended to download this version, which has a minimum installation size of 900M. The DVD version is larger, but will have a lot of stuff in it. Enable Hyper-VSearch for Control Panel in the lower left corner of your computer Select Programs and click Turn Windows features on or off After checking the application and waiting for the end, restart the system After the restart is complete, you can search for Hyper-V Manager on the computer The following steps are completed using this tool. Create a new virtual network switchOpen Hyper-V Manager Then specify the name of this interface, and select the external network in the reference network connection Create a new virtual machineRight click to create a new virtual machine Change a meaningful name and set the storage location of the virtual machine (make sure there is enough space) Select the generation of the virtual machine and go to the next step Allocate memory size() Set it according to your personal situation. If the things you want to run in your virtual machine are large, you need to configure a larger one. Configure the network, select the one we configured from the drop-down list, and then click Next Connecting a Virtual Hard Drive Installation options Choose the mirror location Confirm our installation information again and click Finish View the created virtual machine Select and click Start on the right, then click Connect after it starts. Installing the systemStart the virtual machine, then after connecting, use the keyboard to select Install CentOS7, and then enter Enter the installation interface and select the installation language Configuring installation location and network Click the installation location Configure network and hostname Then click Install Set the root password. Here you can set a simple or complex password according to your personal situation. No additional users will be created here, just use root Restart after successful installation Click enter to enter the system, enter the username root, and the password is the password we just set Enter the ls command to view Try pinging Baidu to see if you can access the external network ping baidu.com operateView network configuration informationip addr The IP address at this time is a dynamically assigned IP address If you are not used to the default interface, you can use a third-party terminal tool (MovaXterm, shell) to connect. MovaXterm Basic UseIt is recommended to use MovaXterm, download address: https://mobaxterm.mobatek.net/. If necessary, you can find the Chinese version online. The following is a brief description of how to use it. Open the MovaXterm tool and create a new session. Select the session type (multiple types are supported), here we choose SSH Click OK, then enter your password to connect. The software demonstrated above is what I use for learning Setting a Static IPEnter the specified directory to modify the configuration, which contains the network configuration cd /etc/sysconfig/network-scripts ls Edit the ifcfg-eth0 file using vm vi ifcfg-eth0 Edit the file to add or modify the following configuration Basic usage of vi: press i to enter edit mode, save and exit by pressing esc, then enter: wq BOOTPROTO="static" #Set static ip ONBOOT="yes" #Set the system to start automatically IPADDR=192.168.1.8 #Assign IP. The first three segments should be consistent with the local machine, and the last segment should be different NETMASK=255.255.255.0 #Consistent with the local machine GATEWAY=192.168.1.1 #Consistent with the local machine DNS1=192.168.1.1 #Consistent with the gateway. If you don't add it, you can't access the Internet Query the local computer's IP and subnet mask through cmd ipconfig After modification, as shown in the figure Restart the network service to make the above configuration take effect I use the built-in interface of hyper-v to run this. service network restart Requery IP Modify our MovaXterm connection configuration to our modified IP address and reconnect, and test whether it can access the external network Then ping our server through this machine and you can access it normally. At this point, the static IP setting is complete. Firewall settingsThe following configuration is not currently used in this example -- Enable the firewall systemctl start firewalld -- View the firewall status systemctl status firewalld -- Open port firewall-cmd --permanent --zone=public --add-port=80/tcp firewall-cmd --permanent --zone=public --add-port=22/tcp firewall-cmd --permanent --zone=public --add-port=21/tcp -- Restart the firewall service to make the configuration take effect firewall-cmd --reload -- View the currently open port number firewall-cmd --list-port Reference DocumentationHyper-v: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/ This concludes this article on how to install Centos7 using a Hyper-v virtual machine. I hope it will be helpful for everyone’s study, and I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Pure CSS3 code to implement a running clock
>>: MySQL database JDBC programming (Java connects to MySQL)
Preface During development, we often encounter va...
Table of contents Preface: 1. Reasons for the eve...
This article shares with you how to use Vue to im...
Table of contents 1. Write Webshell into outfile ...
need: Usually, sites want to prevent videos and p...
1. Use the <a> tag to complete <a href=&...
The form elements with visibility=hidden and displ...
Environment configuration 1: Install MySQL and ad...
1.1 Data Type Overview The data type is a field c...
Elastic stack, commonly known as ELK stack, is a ...
1. Install the database 1) yum -y install mysql-s...
1. If the user has the create routine permission,...
Table of contents What is Proxy Mode? Introducing...
GitHub has all kinds of magic tools. Today I foun...
In cells, dark border colors can be defined indiv...