我这里选用的虚拟机软件为virtualbox
下载
wget http://download.virtualbox.org/virtualbox/5.2.2/VirtualBox-5.2-5.2.2_119230_el7-1.x86_64.rpm
新建文件
vim /etc/yum.repos.d/virtualbox.repo
写入以下内容
[virtualbox]
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc
更新yum
yum clean all
yum makecache
查看yum包
yum list | grep virtualbox
VirtualBox-4.3.x86_64 4.3.40_110317_el7-1 virtualbox
VirtualBox-5.0.x86_64 5.0.40_115130_el7-1 virtualbox
VirtualBox-5.1.x86_64 5.1.30_118389_el7-1 virtualbox
VirtualBox-5.2.x86_64 5.2.2_119230_el7-1 virtualbox
想安装哪个就安装哪个
yum install -y VirtualBox-5.2.x86_64
直接使用命令即可启动虚拟机
virtualbox