centos7用命令行方式安装VirtualBox

Installing and using VirtualBox on CentOS

<!> VirtualBox (VB) development is progressing rapidly and the information on this page may be outdated. The Linux Downloads page now has yum repo configs. Unfortunately the RPM packages do not handle major version upgrades gracefully. The built-in update notifications when running VB are also deficient and will only notify of minor updates (i.e. 5.1.6->5.1.8), if that, and not more major version upgrades (i.e. 4->5). For now, older versions should be uninstalled before installing a new major version or the package upgrade will encounter RPM conflicts. The VB user manual should be read carefully; however, at this writing it does not do a good job of addressing RPM installations. See the VB site for the latest details. The good news is that the new versions have significant improvements and new features, and backwards compatibility with existing VMs has been excellent.

VirtualBox-6.1 (VirtualBox-6.1-6.1.28_147628) is currently available and supported. To get full 6.1 functionality you may also need the VirtualBox Extension Pack which provides support for USB 2.0/3.0 devices, and RDP and PXE boot for Intel cards.

See CentOS as a Guest OS in VirtualBox for information about using CentOS as a VB guest.

See also this Red Hat Developer article on VirtualBox.

Please note that VirtualBox is a product of Oracle Corporation. It is neither provided nor supported by the CentOS Project, although questions may be answered at the Fora or on the virtualization mailing lists.


下面讲一下安装步骤,不废话了,直接贴命令行

$ cd /etc/yum.repos.d
$ wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
$ yum --enablerepo=epel install dkms
$ yum groupinstall "Development Tools"
$ yum install kernel-devel
$ yum install VirtualBox-5.2

安装完成后可以试一下创建一个虚机

VBoxManage createvm --name "CentOS_magic" --ostype RedHat_64 --basefolder /VirtualBox --register
VBoxManage unregistervm CentOS_magic --delete

如果到这里都没问题就行了,安装完成!

有什么其他问题的,自己看官网介绍吧
https://wiki.centos.org/HowTos/Virtualization/VirtualBox

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
以下是在 VirtualBox 中使用命令行安装 CentOS 7 的步骤: 1. 在 VirtualBox 中创建一个新的虚拟机,选择类型为Linux,版本为Red Hat(64位),设置内存大小、硬盘大小等参数。 2. 下载 CentOS 7 的 ISO 镜像文件,并将其放置在合适的位置,例如在主机的 Downloads 文件夹中。 3. 打开命令行终端,进入 VirtualBox 安装目录下的文件夹(例如在 Windows 系统中,默认路径为 C:\Program Files\Oracle\VirtualBox)。 4. 运行以下命令来创建一个新的虚拟硬盘文件: ```VBoxManage createmedium disk --filename "D:\VirtualBox VMs\centos7\centos7.vdi" --size 10000``` 其中,D:\VirtualBox VMs\centos7 是你要创建的虚拟机的存储位置,centos7.vdi 是虚拟硬盘文件的名称,--size 参数用于指定虚拟硬盘的大小(单位为 MB)。 5. 运行以下命令来将新创建的虚拟硬盘文件添加到虚拟机中: ```VBoxManage storageattach "centos7" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "D:\VirtualBox VMs\centos7\centos7.vdi"``` 其中,centos7 是你在 VirtualBox 中创建的虚拟机的名称,--storagectl 参数用于指定存储控制器的名称,--port 和 --device 参数用于指定设备的位置,--type 参数用于指定设备的类型,--medium 参数用于指定虚拟硬盘文件的位置。 6. 运行以下命令来将 CentOS 7 的 ISO 镜像文件添加到虚拟机中: ```VBoxManage storageattach "centos7" --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium "C:\Users\Username\Downloads\CentOS-7-x86_64-DVD-1810.iso"``` 其中,Username 是你的用户名,CentOS-7-x86_64-DVD-1810.iso 是你下载的 CentOS 7 的 ISO 镜像文件的名称。 7. 启动虚拟机,并按照 CentOS 7 的安装流程来完成安装。 注意:以上命令中的路径和参数需要根据你自己的实际情况进行修改。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

RayCheungQT

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值