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功能
2.打开Hyper-V管理器
3.配置CentOS虚拟机
4.配置网络(重要)
打开网络和Internet设置
以太网--》右键--》属性 一定要选中 默认交换机 !!!!!
5.安装CentOS
安装步骤略。。。
6.启动虚拟机 修改虚拟机网络配置
打开WIN10 的CMD容器,执行命令:ipconfig
根据上图配置CentOS的网络(除了改变IP,其它的不变)
cd /etc/sysconfig/network-scripts/
vi /etc/sysconfig/network-scripts/ifcfg-eth0
保存之后,systemctl restart network
使用 ip a 查看结果:
ping baidu.com
CentOS安装及配置完成 。