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](https://i-blog.csdnimg.cn/blog_migrate/3daf453ed15c3002b8a098b7996d117e.png)
Then we can install the VirtualBox with the following command.
然后,我们可以使用以下命令安装VirtualBox。
$ sudo apt install virtualbox
![Install VirtualBox From Command Line with apt Command](https://i-blog.csdnimg.cn/blog_migrate/6bb5efa91cf6dc8bb036b22c7a49aafb.png)
通过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](https://i-blog.csdnimg.cn/blog_migrate/9b99629f15ba5d73e15ca105751da762.png)
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](https://i-blog.csdnimg.cn/blog_migrate/2faafff7d34bf4201e05254d1c08b6ae.png)
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](https://i-blog.csdnimg.cn/blog_migrate/b88f4009f1c5a9e9d10889bd86187db0.png)
通过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](https://i-blog.csdnimg.cn/blog_migrate/7e580cc47f04041e3bb43550728e91b1.png)
We can check the sources.list file with the following command.
我们可以使用以下命令检查sources.list文件。
$ tail -10 /etc/apt/sources.list
![Check VirtualBox Repository Information](https://i-blog.csdnimg.cn/blog_migrate/bd16fcf7a86e10a1b7ebe18eac2cd3ab.png)
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](https://i-blog.csdnimg.cn/blog_migrate/8afe2c2168852f5e427ef8e1ec3ed8ca.png)
安装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
![](https://i-blog.csdnimg.cn/blog_migrate/fa78493302899b2f2d3ca6d267236a49.png)
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](https://i-blog.csdnimg.cn/blog_migrate/3cef8fac00e1ccde6be144b52950e07a.png)
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](https://i-blog.csdnimg.cn/blog_migrate/d05f6213bae7c291d3b484b1bf281e81.png)
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](https://i-blog.csdnimg.cn/blog_migrate/83438a2b6eb831a476a98427ef829184.png)
启动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,我们可以使用“应用程序”菜单将其存储在“系统”类别中,如下所示。
![Start VirtualBox From Application Menu](https://i-blog.csdnimg.cn/blog_migrate/3ffdd15d7fa68653677b4590831c183d.png)
Alternatively, we can start the VirtualBox from the command line with the virtualbox
command like below.
另外,我们可以使用如下所示的virtualbox
命令从命令行启动VirtualBox。
$ virtualbox
![VirtualBox Running On Ubuntu](https://i-blog.csdnimg.cn/blog_migrate/63c03ee4b7807e3d5366d9e1d153ae00.png)
从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](https://i-blog.csdnimg.cn/blog_migrate/f303d2a1396de0d5bcc17c08f1404c9a.png)
翻译自: https://www.poftut.com/how-to-install-virtualbox-on-ubuntu/