WIN10家庭版使用Hyper-V安装CentOS

1.启用Hyper-V

新建文件Hyper-V.cmd,文件内容:

pushd "%~dp0"

dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt

for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"

del hyper-v.txt

Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL

保存后,使用系统管理员身份运行Hyper-V.cmd。去确认Hyper-V已启用:

设置--》应用--》程序和功能--》启用或关闭Windows功能

WIN10家庭版使用Hyper-V安装CentOS

2.打开Hyper-V管理器

WIN10家庭版使用Hyper-V安装CentOS

WIN10家庭版使用Hyper-V安装CentOS

3.配置CentOS虚拟机 

WIN10家庭版使用Hyper-V安装CentOS

 WIN10家庭版使用Hyper-V安装CentOS

WIN10家庭版使用Hyper-V安装CentOS

WIN10家庭版使用Hyper-V安装CentOS

WIN10家庭版使用Hyper-V安装CentOS

WIN10家庭版使用Hyper-V安装CentOS

WIN10家庭版使用Hyper-V安装CentOS

4.配置网络(重要)

打开网络和Internet设置

WIN10家庭版使用Hyper-V安装CentOS

WIN10家庭版使用Hyper-V安装CentOS

以太网--》右键--》属性    一定要选中 默认交换机 !!!!!

 WIN10家庭版使用Hyper-V安装CentOS

5.安装CentOS

 

WIN10家庭版使用Hyper-V安装CentOS

安装步骤略。。。

6.启动虚拟机 修改虚拟机网络配置

打开WIN10 的CMD容器,执行命令:ipconfig

WIN10家庭版使用Hyper-V安装CentOS

根据上图配置CentOS的网络(除了改变IP,其它的不变)

cd /etc/sysconfig/network-scripts/

WIN10家庭版使用Hyper-V安装CentOS

vi /etc/sysconfig/network-scripts/ifcfg-eth0

WIN10家庭版使用Hyper-V安装CentOS

保存之后,systemctl restart network

使用 ip a 查看结果:

WIN10家庭版使用Hyper-V安装CentOS

 ping baidu.com

WIN10家庭版使用Hyper-V安装CentOS

 CentOS安装及配置完成 。