1、 Turn on Hyper-V
This tutorial is based on the experience of helping students and themselves to install Hyper-V under the guidance of teachers.
First of all, we should pressWin+Q, or directly open the search bar at the bottom left and enterHyperThe shortcut menu bar appears.
Click to start or close the windows function, and then clickfunctionIn search ofHyper-V, and check
Note: in this case, some versions of computers may not find Hyper-V, so you should do the following operations, otherwise you can directly go to the second step.
1. Copy the code to Notepad
pushd %~dp0 dir b %SystemRoot%servicingPackagesHyper-V.mum hyper-v.txt for f %%i in ('findstr i . hyper-v.txt 2^nul') do dism online norestart addpackage%SystemRoot%servicingPackages%%i del hyper-v.txt Dism online enable-feature featurenameMicrosoft-Hyper-V-All LimitAccess ALL
2. Change the file type of Notepad from text document (. Txt) to. CMD, that is, name Notepad as hyperv.cmd .
It should be noted that some versions of the file name does not contain TXT, so the txt file type cannot be changed to CMD.
The following operations are required.
Method 1: press Win + Q or directly open the search bar in the lower left corner, entercontrol panel。
After opening, there is the following screen.
Click in the upper left cornertoolchoiceFolder Options。
Click open to viewHide extensions for known file typesChange the selection of to not select.
Click OK again and exit. TXT will appear after the file name
Changes are being made
Method 2: click this computer in the upper left corner of the desktop, if not, search in the search bar to open it. Click the file in the upper left corner and selectChange folder and search options。
After opening it, click to view it as in FA No.1 middle schoolHide extensions for known file typesClick OK to exit to change.
The results of the two methods are shown in the figure below
Move the mouse to the icon, right-click and selectRun as Administrator, the choice is
So start the installation, wait until the page stops scrolling and appears, the screen is, enterY
After the computer restarts, you can press Win + Q, or directly open the search bar at the bottom left, enter hyper, and the shortcut menu bar will appear.
Click to start or turn off the windows function, and search in the functionHyper-V, and check
Click windows in the lower left corner and find Hyper-V manager in windows management tools. If it exists, it succeeds
2、 Download CentOS image
Enter alicloud image website https://developer.aliyun.com/… , select“OS image”
The selection of system and version is as follows
You can click it directlydownload(it may not be successful), or you can click the copy button after downloading to copy the download address to the download tool (such as Xunlei) for downloading. The downloaded file name is centos-7-x86_ 64-Minimal-1908.iso
Note: here, the mini is the mini version and the DVD is the standard version
3、 Creating a virtual machine in Hyper-V
Enter in the quick start fieldhyperAnd chooseHyper-V Manager, click toRun as Administrator
After opening the manager, you will see the following window. In the tree on the left side of the window, you can see the computer named after the current computer name
If you can’t open the computer or can’t connect to the computer, please check the BIOS settings to see if the virtualization function of the computer can be turned on. The specific operation can be inquired according to your computer model
Select in the right columnnewly build–virtual machine
Name the virtual machine here, and take the name by yourself. The storage location can be specified by yourself. Please make sure there is enough hard disk space in the specified location
Select virtual machine as generation one here
Allocate memory for the virtual machine. This memory will be recommended according to the size of the computer memory. You can adjust it yourself. Just install the CentOS system 1g = 1024MB
Configure the network. If the virtual machine needs to be connected to the network, select the following settings. You can choose not to connect to the network“Not connected”
Configuring the virtual machine disk is equivalent to adding a hard disk to the virtual machine5-10GIf it is not enough, you can expand the hard disk later. The hard disk will be stored as a file on the current computer. Please make sure that the selected file location has enough hard disk space.
clicknext step, installation optionsInstall from CD / DVD-ROM, and select the ISO file location to download the CentOS installation file
asmediaThe physical CD / DVD drive in the column is gray, no problem. Some laptops don’t have an optical drive
abstractIs a summary of the above settings, check that there is no error, you can clickcomplete
After the installation, a virtual machine named by itself will appear
Click thestart-upClick againconnect
If you need to modify the virtual machine configuration, you canset upIn progress
After the CD is loaded and started, the second item is selected by default. Here, we need to select the first item install centos7 up and down through the keyboard, and then press the Enter key. There is a time limit and we need to move quickly
Language OptionsDefault English, can be changed, clickContinue
In the installation options, click theinstallation destination, click in to confirm that the hard disk is selected, no need to operate the upper left cornerDonesign out.
Other options can be kept at the default value, and can be modified if you need to connect to the networkNetwork & host name itemTo set the network connection status, clickTop right corner switchOpen it and click Done in the upper left corner to exit.
Click begin installation in the lower right corner to start the installation operation and enter the following interface.
There are two operations that need to be handled, one is theChange administrator passwordThe other isCreate userEnter the modify root password interface.
Just input the set root password and confirm password. The password is required to be complex and cannot be too simple.
After the belt is installed, you can click the lower right corner to restart the system
After the installation, restart and enter the CentOS system. After loading, the system login interface will be displayed
You can use root and the administrator password just set to log in, or you can use the ordinary user created before to log in to the system. You can choose a virtual machine later by using this virtual systemstart-upIt can be used normally after useShut down the system, that is, clickThe red button on the top left
Note: if there is a problem of entering the next step without creating a user, you can clickreductionReset
The above is the whole process of operation.