如何在 Windows 系统电脑中安装 CentOS 7 虚拟机

简介
在技术领域,虚拟化技术被广泛应用于创建和管理虚拟计算机环境。CentOS 7 是一种流行的 Linux 发行版,许多开发人员和系统管理员使用它来运行服务器和应用程序。在 Windows 系统电脑上安装 CentOS 7 虚拟机可以为您提供一个方便的开发和测试环境。在本文中,我们将介绍如何在 Windows 上使用虚拟化软件 virtualbox 来安装和配置 CentOS 7 虚拟机。
获取更多技术资料,请点击!
centos 镜像下载
在安装系统之前,我们需要先下载好 centos 系统的镜像,我们可以在官网上进行下载,也可以在国内的镜像网站上下载,这里我们建议在境内的网站上下载,这样速度更快一些。
访问网址之后,我们选择我们需要下载的版本,如下图,点击。

在新打开的页面中选择isos
下载,isos 代表的是信息空间操作系统
。

在新打开的页面中选择 DVD 进行下载。

安装 virtualbox
与 VMware 类似,virtualbox 也支持我们在 Windows 中创建和使用虚拟机,但是与 VMware 相比,virtualbox 开源免费,并且占用空间更小,所以这里我们选择 virtualbox 来安装我们的虚拟机。
下载 virtualbox
官网下载地址:https://www.virtualbox.org/wiki/Downloads

下载完成之后,即可进行安装,安装过程我们只需要一路 next。
创建虚拟机和安装操作系统
创建虚拟机
1.新建虚拟电脑,名称和文件地址可以自定义,如下图:

2.指定内存大小,建议选择 2048MB 或以上,方便后期搭建环境等操作

3.指定虚拟机硬盘

4.指定虚拟机硬盘文件类型

5.这里设置动态分配即可

指定硬盘大小

设置网络和镜像
1.点击设置

2.设置网卡

3.设置下载的镜像

设置之后如下:

安装操作系统
1.启动

选择语言

3.直接选择的最小安装,如果选择其他安装的话,就是代表着他要给你附带一些软件。

连接虚拟机
在连接虚拟机之前,我们需要先使用ip addr
命令来查看虚拟机 IP,在使用这条命令之前,我们需要先修改ifcfg-ens33
文件。
先切换到/etc/sysconfig/network-scripts/
目录,然后进行修改,将vm ifcfg-ens33
改为 yes,如下图:

重启网络服务,service network restart
,再重新查看 ip 地址,ip 地址就可以看到了

之后,我们就可以使用 xshell 或者是其他的 ssh 连接工具连接虚拟机了,如下图:

常用工具安装
因为我们选择的是极简安装,所以我们还需要安装一些命令行工具,下面是几个常用的工具安装命令:
安装 netstat(作用查询端口号是否占用:
netstat -tunlp | grep 端口号
):yum install net-tools -y
安装 wget(作用 wget 访问:wget 下载路径):
yum -y install wget
安装 lsof(作用也是查端口:lsof -i:端口号):
yum -y install lsof
评论