vagrant + virtual box + rhel7 + ssh 登录

1、程序下载

vc++

https://download.visualstudio.microsoft.com/download/pr/1754ea58-11a6-44ab-a262-696e194ce543/3642E3F95D50CC193E4B5A0B0FFBF7FE2C08801517758B4C8AEB7105A091208A/VC_redist.x64.exe

virtualbox

https://download.virtualbox.org/virtualbox/7.0.18/VirtualBox-7.0.18-162988-Win.exe

vagrant

https://releases.hashicorp.com/vagrant/2.4.1/vagrant_2.4.1_windows_amd64.msi

Vagrant box generic/rhel7 - Vagrant Cloud (vagrantup.com)

2、新建文件夹并启动rhel7

powershell管理员身份运行

可以在D盘新建文件夹

mkdir d:/vm/rhel7/

cd D:/vm/rhel7/

复制代码
vagrant init generic/rhel7
vagrant up

3、修改私有地址为192.168.56.10

修改配置文件D:/vm/rhel/Vagrantfile

Create a private network, which allows host-only access to the machine

using a specific IP.

config.vm.network "private_network", ip: "192.168.56.10"

改完配置reload

vagrant reload#(需要在D:/vm/rhel7/目录下运行)

4、修改ssh配置远程登陆

sudo su切换至root

vi /etc/ssh/sshd_config

PasswordAuthentication yes#(允许密码登录)

PermitRootLogin yes#(允许root登录)

保存后service sshd restart

xshell远程用192.168.56.10登录

用户名:vagrant 密码: vagrant

相关推荐
vortex53 小时前
Debian 包管理全指南:从底层 dpkg 到高层 apt 及其日志追踪
linux·运维·debian
计算机安禾4 小时前
【Linux从入门到精通】第17篇:日志系统——系统运行的黑匣子
linux·运维·服务器
l1t4 小时前
DeepSeek辅助解决windows 11 wsl2中Linux版Dbeaver显示中文
linux·运维·windows
pengyi8710155 小时前
独享IP+动态IP结合核心逻辑,破解稳定与灵活的矛盾
linux·运维·网络
阿祖zu6 小时前
本地到生产,解决 AI 全栈最后一公里——构建&部署&运维
运维·架构·aigc
MAVER1CK10 小时前
Install VNC in Docker container
运维·docker·容器
lcj092466610 小时前
数据中心运维升级|磁控U位硬件联动DCIM,破解U位管控难题
运维·人工智能·经验分享·信息可视化
薛定谔的悦11 小时前
光伏逆变器多协议接入——Modbus RTU 在新能源设备集成中的实践
linux·运维·服务器·bms
bksczm12 小时前
Linux之基础开发工具(Ubuntu)之编译器
linux·运维·服务器
何中应12 小时前
Ansible安装&使用
运维·自动化·ansible·运维开发·自动化运维