如何在Ubuntu上安装VirtualBox?

VirtualBox is a very popular virtualization tool used to run different operating systems on Ubuntu systems. VirtualBox provides the ability to run Windows, BSD, Debian, CentOS, Kali even Ubuntu operating systems on Ubuntu. VirtualBox can be installed in different ways onto a Ubuntu system. In this tutorial, we will learn.

VirtualBox是一种非常流行的虚拟化工具,用于在Ubuntu系统上运行不同的操作系统。 VirtualBox提供了在Ubuntu上运行Windows,BSD,Debian,CentOS,Kali甚至Ubuntu操作系统的功能。 VirtualBox可以通过不同的方式安装到Ubuntu系统上。 在本教程中,我们将学习。

通过Ubuntu存储库安装VirtualBox (Install VirtualBox via Ubuntu Repository)

The first and easiest way is installing VirtualBox on Ubuntu by using the Ubuntu repositories. VirtualBox software is provided by Ubuntu. But the provided VirtualBox version is generally older than currently provided one. So before installing VirtualBox from the Ubuntu repositories via command-line apt command, it is a good idea to check version information about the VirtualBox package with the apt show command like below.

第一种也是最简单的方法是使用Ubuntu存储库在Ubuntu上安装VirtualBox。 VirtualBox软件由Ubuntu提供。 但是提供的VirtualBox版本通常比当前提供的版本更旧。 因此,在通过命令行apt命令从Ubuntu存储库安装VirtualBox之前,最好使用如下所示的apt show命令检查有关VirtualBox软件包的版本信息。

$ sudo apt show virtualbox
Show VirtualBox Package Information
Show VirtualBox Package Information
显示VirtualBox软件包信息

Then we can install the VirtualBox with the following command.

然后,我们可以使用以下命令安装VirtualBox。

$ sudo apt install virtualbox
Install VirtualBox From Command Line with apt Command
Install VirtualBox From Command Line with apt Command
使用apt命令从命令行安装VirtualBox

通过VirtualBox Deb软件包安装VirtualBox (Install VirtualBox via VirtualBox Deb Package)

Oracle VirtualBox also provides the deb packages of VirtualBox for Ubuntu. This deb package can be also used for distributions like Mint and Kali. The deb package can be downloaded from the following link.

Oracle VirtualBox还为Ubuntu提供了VirtualBox的deb软件包。 这个deb包也可以用于Mint和Kali等发行版。 可以从以下链接下载deb软件包。

https://www.virtualbox.org/wiki/Linux_Downloads

https://www.virtualbox.org/wiki/Linux_Downloads

VirtualBox Ubuntu Deb Package
VirtualBox Ubuntu Deb Package
VirtualBox Ubuntu Deb软件包

As we can see the VirtualBox deb packages are provided for different versions of the Ubuntu. In this case, we will select the Ubuntu 18.04/18.10/19.04 and download it with the wget command like below. Also, the browser can be used for download.

如我们所见,VirtualBox的deb软件包是为不同版本的Ubuntu提供的。 在这种情况下,我们将选择Ubuntu 18.04/18.10/19.04并使用如下所示的wget命令下载它。 另外,可以使用浏览器进行下载。

 wget https://download.virtualbox.org/virtualbox/6.0.14/virtualbox-6.0_6.0.14-133895~Ubuntu~bionic_amd64.deb
VirtualBox Ubuntu Deb Package
VirtualBox Ubuntu Deb Package
VirtualBox Ubuntu Deb软件包

We will used the dpkg command in order to install downloaded virtualbox-6.0_6.0.14-133895~Ubuntu~bionic_amd64.deb deb package.

我们将使用dpkg命令来安装下载的virtualbox-6.0_6.0.14-133895~Ubuntu~bionic_amd64.deb deb软件包。

$ sudo dpkg -i virtualbox-6.0_6.0.14-133895~Ubuntu~bionic_amd64.deb
Install VirtualBox Package with dpkg
Install VirtualBox Package with dpkg
使用dpkg安装VirtualBox软件包

通过VirtualBox官方存储库安装VirtualBox(Install VirtualBox via VirtualBox Official Repository)

We can also use the official Oracle VirtualBox repositories for Ubuntu. Before installing the VirtualBox we will add the Oracle VirtualBox repository to our Ubuntu system. The first step is adding the GPG key of the Oracle VirtualBox repository to our trusted repository list. We will use the following wget command to download the GPG key and add it to the apt repository.

我们还可以使用Ubuntu的官方Oracle VirtualBox存储库。 在安装VirtualBox之前,我们将Oracle VirtualBox存储库添加到我们的Ubuntu系统中。 第一步是将Oracle VirtualBox存储库的GPG密钥添加到我们的受信任存储库列表中。 我们将使用以下wget命令下载GPG密钥并将其添加到apt信息库。

$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -

The second step is adding the repository information to the /etc/apt/sources.list which can be done with the add-apt-repository command like below.

第二步是将存储库信息添加到/etc/apt/sources.list ,可以使用如下所示的add-apt-repository命令来完成。

$ sudo add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"
Add VirtualBox Repository Information
Add VirtualBox Repository Information
添加VirtualBox存储库信息

We can check the sources.list file with the following command.

我们可以使用以下命令检查sources.list文件。

$ tail -10 /etc/apt/sources.list
Check VirtualBox Repository Information
Check VirtualBox Repository Information
检查VirtualBox存储库信息

The last step is starting the installation with the apt install command. We will install the virtualbox package as below.

最后一步是使用apt install命令开始apt install 。 我们将如下所示安装virtualbox软件包。

$ sudo apt install virtualbox-6.0
Install VirtualBox From Oracle Repository On Ubuntu
Install VirtualBox From Oracle Repository On Ubuntu
在Ubuntu上从Oracle存储库安装VirtualBox

安装VirtualBox扩展软件包 (Install VirtualBox Extension Package)

VirtualBox provides an extension package in order to add some features like RDP to Gues, VM Disk AES Encryption, etc. We can list this extension package information below.

VirtualBox提供了一个扩展软件包,以便向Gues,VM Disk AES加密等添加一些功能,例如RDP。我们可以在下面列出此扩展软件包的信息。

$ apt show virtualbox-ext-pack

We will first download the extension pack with the following command. The VirtualBox extension pack file is named as Oracle_VM_VirtualBox_Extension_Pack-6.0.0.vbox-extpack.

我们将首先使用以下命令下载扩展包。 VirtualBox扩展包文件名为Oracle_VM_VirtualBox_Extension_Pack-6.0.0.vbox-extpack

$ wget https://download.virtualbox.org/virtualbox/6.0.0/Oracle_VM_VirtualBox_Extension_Pack-6.0.0.vbox-extpack
Download VirtualBox Extension Pack
Download VirtualBox Extension Pack
下载VirtualBox扩展包

We will use the VBoxManage command in order to load or install the extension pack. This action also requires root privileges which can be provided with the sudo command.

我们将使用VBoxManage命令来加载或安装扩展包。 此操作还需要sudo命令可以提供的root特权。

$ sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.0.0.vbox-extpack
Accept VirtualBox Extension Pack License
Accept VirtualBox Extension Pack License
接受VirtualBox Extension Pack许可证

We have to accept the license like below. We will input Y in order to accept the license. After that the extension pack install will start the installation progress will be shown like 0%..10%..20%  etc.

我们必须接受以下许可。 我们将输入Y以便接受许可证。 之后,扩展包安装将开始,安装进度将显示为0%.. 10%.. 20%等。

Accept VirtualBox Extension Pack License
Accept VirtualBox Extension Pack License
接受VirtualBox Extension Pack许可证

启动VirtualBox(Start VirtualBox)

We can start VirtualBox in different ways. From GUI we can use the Application menu where it is stored in System category like below.

我们可以用不同的方式启动VirtualBox。 通过GUI,我们可以使用“应用程序”菜单将其存储在“系统”类别中,如下所示。

LEARN MORE  How To Use VirtualBox , Creating Virtual Machines and Guests?
了解更多信息如何使用VirtualBox,创建虚拟机和客户机?
Start VirtualBox From Application Menu
Start VirtualBox From Application Menu
从应用程序菜单启动VirtualBox

Alternatively, we can start the VirtualBox from the command line with the virtualbox command like below.

另外,我们可以使用如下所示的virtualbox命令从命令行启动VirtualBox。

$ virtualbox
VirtualBox Running On Ubuntu
VirtualBox Running On Ubuntu
在Ubuntu上运行的VirtualBox

从Ubuntu卸载/删除VirtualBox (Uninstall/Remove VirtualBox From Ubuntu)

We can uninstall the installed VirtualBox in different ways. One of the most convenient ways is using the apt command from the command line. Uninstall operation requires the root privileges so we will use the sudo.

我们可以通过不同的方式卸载已安装的VirtualBox。 最方便的方法之一是从命令行使用apt命令。 卸载操作需要root特权,因此我们将使用sudo

$ sudo apt remove virtualbox
Uninstall/Remove VirtualBox From Ubuntu
Uninstall/Remove VirtualBox From Ubuntu
从Ubuntu卸载/删除VirtualBox

翻译自: https://www.poftut.com/how-to-install-virtualbox-on-ubuntu/

  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值