virtual 添加 nat 网络
虚拟机配置 nat 网络
centos 系统文件修改
cd /etc/sysconfig/network-scripts/
// 查找 ifcfg-enp... 文件并修改其中的 onboot 为 yes
vi ifcfg-en0s3
// 修改后, 重启 network 服务, 并用 ping 或 curl 进行测试
service network restart
ping www.baidu.com
虚拟机设置
xshell 连接 ssh -p root@127.0.0.1 2222
或
文件-新建-连接….