1、VirtualBox依赖安装
1 2 | # 安装依赖并重启服务器 dnf --enablerepo=epel -y install kernel-devel-$( uname -r) kernel-headers-$( uname -r) gcc gcc -c++ glibc make bzip2 dkms perl elfutils-libelf-devel libX11-devel libXt libXmu |
2、VirtualBox安装
1 2 3 4 5 6 7 8 | # 安装源配置 curl http: //download .virtualbox.org /virtualbox/rpm/rhel/virtualbox .repo -o /etc/yum .repos.d /virtualbox .repo # 查看当前可用版本 dnf search virtualbox # 安装VirtualBox dnf -y install VirtualBox-7.0 |
3、Vagrant安装
1 2 3 | dnf install -y yum-utils yum-config-manager --add-repo https: //rpm .releases.hashicorp.com /RHEL/hashicorp .repo dnf -y install vagrant |
4、命令补全
1 | vagrant autocomplete install -- bash |
5、Vagrant参数
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | # vagrant --help Usage: vagrant [options] < command > [<args>] -h, --help Print this help. Common commands: autocomplete manages autocomplete installation on host box manages boxes: installation, removal, etc. cloud manages everything related to Vagrant Cloud destroy stops and deletes all traces of the vagrant machine global-status outputs status Vagrant environments for this user halt stops the vagrant machine help shows the help for a subcommand init initializes a new Vagrant environment by creating a Vagrantfile login package packages a running vagrant environment into a box plugin manages plugins: install , uninstall, update, etc. port displays information about guest port mappings powershell connects to machine via powershell remoting provision provisions the vagrant machine push deploys code in this environment to a configured destination rdp connects to machine via RDP reload restarts vagrant machine, loads new Vagrantfile configuration resume resume a suspended vagrant machine serve start Vagrant server snapshot manages snapshots: saving, restoring, etc. ssh connects to machine via SSH ssh -config outputs OpenSSH valid configuration to connect to the machine status outputs status of the vagrant machine suspend suspends the machine up starts and provisions the vagrant environment upload upload to machine via communicator validate validates the Vagrantfile version prints current and latest Vagrant version winrm executes commands on a machine via WinRM winrm-config outputs WinRM configuration to connect to the machine For help on any individual command run `vagrant COMMAND -h` Additional subcommands are available, but are either more advanced or not commonly used. To see all subcommands, run the command `vagrant list-commands`. --[no-]color Enable or disable color output --machine-readable Enable machine readable output - v , --version Display Vagrant version --debug Enable debug output --timestamp Enable timestamps on log output --debug-timestamp Enable debug output with timestamps --no- tty Enable non-interactive output |
6、Vagrant日常操作
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # 查看Vagrant版本 vagrant --version # 查看Vagrant当前所有已安装系统 vagrant global-status # 查看所有已添加box vagrant box list # 启动系统 vagrant init generic /centos7 vagrant up # 离线下载并启动box vagrant box add --name=centos7 /data/centos7/centos7 .box vagrant init centos7 vagrant up --provider=virtualbox |
7、Vagrant插件安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # 安装rubygems dnf install rubygems -y # 配置国内源 gem sources --add https: //mirrors .tuna.tsinghua.edu.cn /rubygems/ --remove https: //rubygems .org/ # 列出已有源 gem sources -l # 插件安装并查看 vagrant plugin install vagrant-reload vagrant plugin install vagrant-share vagrant plugin install vagrant-mutate vagrant plugin list |
8、Packer安装
1 2 3 | dnf install -y yum-utils yum-config-manager --add-repo https: //rpm .releases.hashicorp.com /RHEL/hashicorp .repo dnf -y install packer |
参考:https://developer.hashicorp.com/vagrant/downloads
https://www.virtualbox.org/wiki/Linux_Downloads
https://www.modb.pro/db/88457
https://developer.hashicorp.com/packer/downloads
https://github.com/chef/bento
分类:
虚拟化 / VirtualBox
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 一文读懂知识蒸馏
· 终于写完轮子一部分:tcp代理 了,记录一下