Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Centos7 using the Hyper-v virtual machine

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to use the Hyper-v virtual machine to install Centos7. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.

Introduction

It allows you to run multiple operating systems in the form of a virtual machine on your computer (as for why you choose this, mainly because the system already comes with it, so I won't install anything else and try it first)

Hyper-V is available for 64-bit Windows 10 Professional, Enterprise, and Educational editions. It cannot be used in the home version.

Prepare to download the system image

Go to Aliyun to download system: http://mirrors.aliyun.com/centos/7/isos/x86_64/

It is recommended to download this version with a minimum installation of 900m. The DVD version is larger, but there will be a lot of things in it.

Enable Hyper-v

Search the control panel in the lower left corner of the computer

Select the program, and then click to enable or disable the Windows function

Check the application and restart the system after waiting for the end.

The Hyper-v Manager can be searched on the computer after the restart.

The following steps are done using this tool.

Create a new virtual network switch

Open the Hyper-v Manager

Then the name of the interface specifies that the external network chooses to refer to the network connection.

New virtual machine

Right click to create a new virtual machine

Modify a meaningful name and set the storage location of the virtual machine (make sure there is a certain amount of space)

Select the algebra of the virtual machine and go straight to the next step

Allocate memory size ()

Set it up according to your personal situation. If you have a big thing to run in the virtual machine, you need to configure it a little bigger.

Configure the network, the drop-down list selects what we have configured, and then the next step

Connect a virtual hard disk

Installation option Select the location of the image

Reconfirm our installation information, and then click finish

View virtual machines that have been created

Select the launch on the right, and then click on the connection after starting it.

Installation system

Start the virtual machine, and after connecting, operate the keyboard to select Install CentOS7, and then enter enter

Go to the installation interface and select the installation language

Configure installation location and network

Click the installation location

Configure network and hostname

Then click install

Set the root password. Here, set simple or complex passwords according to the individual situation.

Instead of creating additional users here, use root directly.

Restart after successful installation

Click enter to enter the system and enter the user name root. The password is the password we just set.

Enter the ls command to view

Try ping under Baidu to see if you can access the public network.

Ping baidu.com

Operation to view network configuration information ip addr

At this time, ip is a dynamically assigned ip address.

If you are not used to using the default interface, you can use third-party terminal tools (MovaXterm, shell) to connect.

Basic use of MovaXterm

It is recommended to use MovaXterm, download address: https://mobaxterm.mobatek.net/, if necessary, you can go online to find the Chinese version.

Here is a brief description of how to use it, open the MovaXterm tool and create a new session

Select the session type (multiple are supported). Here we choose SSH.

Click OK, and then enter the password to connect.

The software demonstrated above is what I learned to use.

Set static IP

Go to the specified directory to modify the configuration, which contains the network configuration.

Cd / etc/sysconfig/network-scripts ls

Use vm to edit ifcfg-eth0 files

Vi ifcfg-eth0

Edit the file to add or modify the following configuration

Basic usage of vi: press I to enter edit mode, save exit, press esc, and then enter: wq

BOOTPROTO= "static" # set static ipONBOOT= "yes" # configure boot IPADDR=192.168.1.8 # assign IP, the first three segments should be consistent with the local machine, the second segment should be different from the local machine, the NETMASK=255.255.255.0 # should be consistent with the local machine, the DNS1=192.168.1.1 # should be consistent with the gateway, and the public network cannot be accessed without adding.

Query the ip and subnet mask of the local computer through cmd.

Ipconfig

After modification, as shown in the figure

Restart the network service to make the above configuration effective

I run this using hyper-v 's own interface.

Service network restart

Re-query ip

Modify our MovaXterm connection configuration to reconnect with our modified ip address, and test whether we can access the public network

Then through the local machine to ping under our server, can be accessed normally.

At this point, the static ip setting ends.

Firewall Settin

The following configurations are not currently used in the examples in this article

-- enable firewall systemctl start firewalld-- View firewall status systemctl status firewalld-- Open port firewall-cmd-- permanent-- zone=public-- add-port=80/tcpfirewall-cmd-- permanent-- zone=public-- add-port=22/tcpfirewall-cmd-- permanent-- zone=public-- add-port=21/tcp-- restart firewall service to make the configuration effective firewall-cmd-- reload-- to view the port number firewall-cmd currently open -- list-port on how to use the Hyper-v virtual machine to install Centos7, that's all. I hope the above content can be of some help to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report