VirtualBox 安装 Centos8 使用 Xshell 连接

1.下载CentOS

CentOS下载地址:https://wiki.centos.org/Download
VirtualBox 安装 Centos8 使用 Xshell 连接
VirtualBox 安装 Centos8 使用 Xshell 连接
VirtualBox 安装 Centos8 使用 Xshell 连接
这里选择本地安装包,网络安装包在安装时需要在线下载资源比较慢

2.安装VirtualBox

VirtualBox是Oracle旗下免费的轻量级虚拟机

VirtualBox下载地址:https://www.virtualbox.org/wiki/Downloads
VirtualBox 安装 Centos8 使用 Xshell 连接
安装VirtualBox直接next安装完成。

3.新建虚拟机

1)新建虚拟电脑,选择系统类型和版本,分配内存大小
VirtualBox 安装 Centos8 使用 Xshell 连接
2)点击创建虚拟硬盘位置
VirtualBox 安装 Centos8 使用 Xshell 连接

4.安装CentOS8

1)启动,进入安装界面
VirtualBox 安装 Centos8 使用 Xshell 连接
2)等待安装,进入系统设置界面
VirtualBox 安装 Centos8 使用 Xshell 连接
3)选择语言
VirtualBox 安装 Centos8 使用 Xshell 连接
4)按顺序进行设置,1和4只需要点进去确认即可
VirtualBox 安装 Centos8 使用 Xshell 连接

VirtualBox 安装 Centos8 使用 Xshell 连接

VirtualBox 安装 Centos8 使用 Xshell 连接

VirtualBox 安装 Centos8 使用 Xshell 连接

VirtualBox 安装 Centos8 使用 Xshell 连接
VirtualBox 安装 Centos8 使用 Xshell 连接

VirtualBox 安装 Centos8 使用 Xshell 连接

VirtualBox 安装 Centos8 使用 Xshell 连接

安装完成之后,点右上角X,退出系统,回到VirtualBox,设置=》存储,把虚拟光盘移除掉,否则再次启动时会再次进入安装界面
VirtualBox 安装 Centos8 使用 Xshell 连接
设置虚拟机网络,就和本地电脑在同一网段
VirtualBox 安装 Centos8 使用 Xshell 连接

5.使用Xshell连接CentOS8

1)查看linux IP地址

ip addr

VirtualBox 安装 Centos8 使用 Xshell 连接

2)使用Xshell连接
VirtualBox 安装 Centos8 使用 Xshell 连接

常见问题

Tips:这个截图里的IP是之前安装的测试的IP,所以是60,后面我测试成功之后把系统移除掉了。之后用的61的IP,可以忽略IP对应不上的问题。
VirtualBox 安装 Centos8 使用 Xshell 连接

1)为了方便本地测试直接关闭防火墙

1.查看防火强状态
systemctl status firewalld.service
2.关闭防火墙
systemctl stop firewalld.service
3.禁用防火墙
systemctl disable firewalld.service

2)检查ssh-server服务有没有安装

1.检查是否安装openssh-server
rpm -qa |grep ssh
2.安装openssh-server
yum install openssh-server
3.开启ssh服务
systemctl start sshd.service
4.设置开机启动服务
systemctl enable sshd.service
5.检查服务状态
systemctl status sshd.service

3)查看22端口是否存在

ss -lnt

4)以上办法都没用就重装VirtualBox

本人在写这篇博客时演示安装完Centos8之后不明原因,之前能连上的,后来连不上了,折腾了一晚上,第二天直接重装之后重新初始化网络就好了。
VirtualBox 安装 Centos8 使用 Xshell 连接

尽情享用吧,接下来安装docker。