2019-11-18 00:54:52 +08:00
|
|
|
|
[#]: collector: (lujun9972)
|
2019-11-26 09:05:25 +08:00
|
|
|
|
[#]: translator: (geekpi)
|
2019-11-30 09:51:04 +08:00
|
|
|
|
[#]: reviewer: (wxy)
|
2019-11-18 00:54:52 +08:00
|
|
|
|
[#]: publisher: ( )
|
|
|
|
|
[#]: url: ( )
|
|
|
|
|
[#]: subject: (How to Install VirtualBox 6.0 on CentOS 8 / RHEL 8)
|
|
|
|
|
[#]: via: (https://www.linuxtechi.com/install-virtualbox-6-centos-8-rhel-8/)
|
|
|
|
|
[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/)
|
|
|
|
|
|
2019-11-28 08:55:55 +08:00
|
|
|
|
如何在 CentOS 8 / RHEL 8 上安装 VirtualBox 6.0
|
2019-11-18 00:54:52 +08:00
|
|
|
|
======
|
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
![](https://img.linux.net.cn/data/attachment/album/201911/30/095031gbnm59ux0dw979wb.jpg)
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
VirtualBox 是一款自由开源的虚拟化工具,它允许技术人员同时运行多个不同风格的虚拟机(VM)。它通常用于运行桌面(Linux 和 Windows),当人们尝试探索新的 Linux 发行版的功能或希望在 VM 中安装 OpenStack、Ansible 和 Puppet 等软件时,它会非常方便,在这种情况下,我们可以使用 VirtualBox 启动 VM。
|
|
|
|
|
|
|
|
|
|
VirtualBox 被分类为 2 类虚拟机管理程序,这意味着它需要一个现有的操作系统,在上面安装 VirtualBox 软件。VirtualBox 提供功能来创建本机网络或 NAT 网络。在本文中,我们将演示如何在 CentOS 8 和 RHEL 8 系统上安装最新版本的 VirtualBox 6.0,并演示如何安装 VirtualBox 扩展。
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-28 08:55:55 +08:00
|
|
|
|
### 在 CentOS 8 / RHEL 8 上安装 VirtualBox 6.0 的安装步骤
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-28 08:55:55 +08:00
|
|
|
|
#### 步骤 1: 启用 VirtualBox 和 EPEL 仓库
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
登录到你的 CentOS 8 或 RHEL 8 系统并打开终端,执行以下命令并启用 VirtualBox 和 EPEL 包仓库:
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[root@linuxtechi ~]# dnf config-manager --add-repo=https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
|
|
|
|
|
```
|
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
使用以下 `rpm` 命令导入 Oracle VirtualBox 公钥:
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[root@linuxtechi ~]# rpm --import https://www.virtualbox.org/download/oracle_vbox.asc
|
|
|
|
|
```
|
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
使用以下 `dnf` 命令启用 EPEL 仓库:
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[root@linuxtechi ~]# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
|
|
|
|
|
```
|
|
|
|
|
|
2019-11-28 08:55:55 +08:00
|
|
|
|
#### 步骤 2: 安装 VirtualBox 构建工具和依赖项
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
运行以下命令来安装所有 VirtualBox 构建工具和依赖项:
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[root@linuxtechi ~]# dnf install binutils kernel-devel kernel-headers libgomp make patch gcc glibc-headers glibc-devel dkms -y
|
|
|
|
|
```
|
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
成功安装上面的依赖项和构建工具后,使用 `dnf` 命令继续安装 VirtualBox。
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-28 08:55:55 +08:00
|
|
|
|
#### 步骤 3: 在 CentOS 8 / RHEL 8 上安装 VirtualBox 6.0
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
如果希望在安装之前列出 VirtualBox 的可用版本,请执行以下 dnf 命令:
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[root@linuxtechi ~]# dnf search virtualbox
|
|
|
|
|
Last metadata expiration check: 0:14:36 ago on Sun 17 Nov 2019 04:13:16 AM GMT.
|
|
|
|
|
=============== Summary & Name Matched: virtualbox =====================
|
|
|
|
|
VirtualBox-5.2.x86_64 : Oracle VM VirtualBox
|
|
|
|
|
VirtualBox-6.0.x86_64 : Oracle VM VirtualBox
|
|
|
|
|
[root@linuxtechi ~]#
|
|
|
|
|
```
|
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
让我们使用以下 `dnf` 命令安装最新版本的 VirtualBox 6.0:
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[root@linuxtechi ~]# dnf install VirtualBox-6.0 -y
|
|
|
|
|
```
|
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
如果有本地用户希望将 usb 设备连接到 VirtualBox VM,那么他/她应该是 `vboxusers` 组的一员,请使用下面的 `usermod` 命令将本地用户添加到 `vboxusers` 组。
|
2019-11-28 08:55:55 +08:00
|
|
|
|
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[root@linuxtechi ~]# usermod -aG vboxusers pkumar
|
|
|
|
|
```
|
|
|
|
|
|
2019-11-28 08:55:55 +08:00
|
|
|
|
#### 步骤 4: 访问 CentOS 8 / RHEL 8 上的 VirtualBox
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
有两种方法可以访问 VirtualBox,在命令行输入 `virtualbox` 然后回车:
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[root@linuxtechi ~]# virtualbox
|
|
|
|
|
```
|
|
|
|
|
|
2019-11-28 08:55:55 +08:00
|
|
|
|
在桌面环境中,在搜索框中搜索 “VirtualBox”。
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
![Access-VirtualBox-CentOS8][3]
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
单击 VirtualBox 图标:
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
![VirtualBox-CentOS8][4]
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-28 08:55:55 +08:00
|
|
|
|
这确认 VirtualBox 6.0 已成功安装,让我们安装它的扩展包。
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-28 08:55:55 +08:00
|
|
|
|
#### 步骤 5: 安装 VirtualBox 6.0 扩展包
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-28 08:55:55 +08:00
|
|
|
|
顾名思义,VirtualBox 扩展包用于扩展 VirtualBox 的功能。它添加了以下功能:
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-28 08:55:55 +08:00
|
|
|
|
* USB 2.0 和 USB 3.0 支持
|
|
|
|
|
* 虚拟 RDP(VRDP)
|
|
|
|
|
* 磁盘镜像加密
|
|
|
|
|
* Intel PXE 启动
|
|
|
|
|
* 主机网络摄像头
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
使用下面的 `wget` 命令下载 Virtualbox 扩展包到下载文件夹中:
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[root@linuxtechi ~]$ cd Downloads/
|
|
|
|
|
[root@linuxtechi Downloads]$ wget https://download.virtualbox.org/virtualbox/6.0.14/Oracle_VM_VirtualBox_Extension_Pack-6.0.14.vbox-extpack
|
|
|
|
|
```
|
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
下载后,打开 VirtualBox 并依次点击 “File -> Preferences -> Extension”,然后点击 “+” 号图标添加下载的扩展包:
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
![Install-VirtualBox-Extension-Pack-CentOS8][5]
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
单击 “Install” 开始安装扩展包:
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
![Accept-VirtualBox-Extension-Pack-License-CentOS8][6]
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
单击 “I Agree” 接受 VirtualBox 扩展包许可证。
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
成功安装 VirtualBox 扩展包后,我们将看到下面的页面,单击 “OK” 并开始使用 VirtualBox。
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
![VirtualBox-Extension-Pack-Install-Message-CentOS8][7]
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
2019-11-30 09:51:04 +08:00
|
|
|
|
本文就是这些了,我希望这些步骤可以帮助你在 CentOS 8 和 RHEL 8 系统上安装 VirtualBox 6.0。请分享你的宝贵的反馈和意见。
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
via: https://www.linuxtechi.com/install-virtualbox-6-centos-8-rhel-8/
|
|
|
|
|
|
|
|
|
|
作者:[Pradeep Kumar][a]
|
|
|
|
|
选题:[lujun9972][b]
|
2019-11-28 08:55:55 +08:00
|
|
|
|
译者:[geekpi](https://github.com/geekpi)
|
2019-11-30 09:51:04 +08:00
|
|
|
|
校对:[wxy](https://github.com/wxy)
|
2019-11-18 00:54:52 +08:00
|
|
|
|
|
|
|
|
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
|
|
|
|
|
|
|
|
[a]: https://www.linuxtechi.com/author/pradeep/
|
|
|
|
|
[b]: https://github.com/lujun9972
|
|
|
|
|
[1]: https://www.linuxtechi.com/dnf-command-examples-rpm-management-fedora-linux/
|
|
|
|
|
[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
|
|
|
|
[3]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Access-VirtualBox-CentOS8.jpg
|
|
|
|
|
[4]: https://www.linuxtechi.com/wp-content/uploads/2019/11/VirtualBox-CentOS8.jpg
|
|
|
|
|
[5]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Install-VirtualBox-Extension-Pack-CentOS8.jpg
|
|
|
|
|
[6]: https://www.linuxtechi.com/wp-content/uploads/2019/11/Accept-VirtualBox-Extension-Pack-License-CentOS8.jpg
|
|
|
|
|
[7]: https://www.linuxtechi.com/wp-content/uploads/2019/11/VirtualBox-Extension-Pack-Install-Message-CentOS8.jpg
|
|
|
|
|
[9]: http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.linuxtechi.com%2Finstall-virtualbox-6-centos-8-rhel-8%2F&t=How%20to%20Install%20VirtualBox%206.0%20on%20CentOS%208%20%2F%20RHEL%208
|
|
|
|
|
[10]: http://twitter.com/share?text=How%20to%20Install%20VirtualBox%206.0%20on%20CentOS%208%20%2F%20RHEL%208&url=https%3A%2F%2Fwww.linuxtechi.com%2Finstall-virtualbox-6-centos-8-rhel-8%2F&via=Linuxtechi
|
|
|
|
|
[11]: http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.linuxtechi.com%2Finstall-virtualbox-6-centos-8-rhel-8%2F&title=How%20to%20Install%20VirtualBox%206.0%20on%20CentOS%208%20%2F%20RHEL%208
|
|
|
|
|
[12]: http://www.reddit.com/submit?url=https%3A%2F%2Fwww.linuxtechi.com%2Finstall-virtualbox-6-centos-8-rhel-8%2F&title=How%20to%20Install%20VirtualBox%206.0%20on%20CentOS%208%20%2F%20RHEL%208
|