在 VirtualBox 上安装 Kali Linux：最快速和最安全的方法
VirtualBox Kali

> 
> 这篇教程向你展示如何在 Windows 和 Linux 中以最快的方式在 VirtualBox 上安装 Kali Linux。
> 
> 
> 


[Kali Linux](https://www.kali.org/) 是 [最适合脆弱性测试和安全爱好者的 Linux 发行版](https://itsfoss.com/linux-hacking-penetration-testing/) 之一。


因为它涉及一个像黑客之类的敏感话题，就像一把双刃剑。我们过去在详细的 Kali Linux 评论中讨论过，所以我不会再次赘述。


虽然你可以通过替换现有的操作系统的形式安装 Kali Linux，但是通过虚拟机来使用它可能会是更好、更安全的选择。


使用 VirtualBox，你可以在 Windows/Linux 系统中将 Kail Linux 作为常规应用程序使用。这和在系统中运行 VLC 或游戏几乎是一样的。


在虚拟机中使用 Kali Linux 是安全的。不管你在 Kali Linux 做什么都不会影响你的 ‘宿主系统’（即你原来的 Windows 或 Linux 操作系统）。你的实际操作系统将不会受到影响，并且在你的宿主系统中数据也是安全的。


![](/data/attachment/album/202004/15/124658vj8jzuupjhsrwf6k.png)


### 如何在 VirtualBox 中安装 Kali Linux


在这里我会使用 [VirtualBox](https://www.virtualbox.org/)。它是一个非常好的开源虚拟化解决方案，几乎适合于任何人，无论是专业使用或个人使用。它是免费提供的。


在这篇文章中，我们将特别讨论 Kali Linux，但你也可以安装几乎任何其他的操作系统，只要有 ISO 文件或预建的虚拟机保存文件就可以安装。


**注意：**同样的步骤适用于运行 VirtualBox 的 Windows 或 Linux。


如上所述 ，你可以安装 Windows 或 Linux 作为你的宿主系统。但是，在我已安装 Windows 10 的情况下（别仇恨我！），我会尝试着在其上的 VirtualBox 中一步步地安装 Kali Linux 。


并且，最棒的是，即使你碰巧使用一个 Linux 发行版作为你的主要操作系统，也将使用同样的步骤!


想知道如何做？让我们来看看…






### 在 VirtualBox 上安装 Kali Linux 的分步指南


我们将使用一个专门为 VirtualBox 定制的 Kali Linux 镜像。你也可以下载 Kali Linux 的 ISO 文件，并创建一个新的虚拟机，但是当你有一个简单的选择时，为什么还这样做呢？


#### 1、下载并安装 VirtualBox


第一件要做的事是从甲骨文的官方网站下载和安装 VirtualBox。


* [下载 VirtualBox](https://www.virtualbox.org/wiki/Downloads)


在你下载了安装器之后，只需要双击它来安装 VirtualBox。在 [Ubuntu](https://itsfoss.com/install-virtualbox-ubuntu/)/Fedora Linux 安装 VirtualBox 也是一样的方式。


#### 2、下载即用型的 Kali Linux 虚拟镜像


在安装成功后，前往 [Offensive Security 的下载页面](https://www.offensive-security.com/kali-linux-vm-vmware-virtualbox-image-download/) 来下载适用于 VirtualBox 的虚拟机镜像。如果你改变主意使用 [VMware](https://itsfoss.com/install-vmware-player-ubuntu-1310/)，那里也有适用的。


![](/data/attachment/album/202004/15/124659udma55m5l73d55ml.jpg)


如你所见，文件大小大约 3 GB，你应该使用 torrent 方式，或者使用一个[下载管理器](https://itsfoss.com/4-best-download-managers-for-linux/)来下载它。


* [下载 Kali Linux 虚拟镜像](https://www.offensive-security.com/kali-linux-vm-vmware-virtualbox-image-download/)


#### 3、在 Virtual Box 上安装 Kali Linux


当你安装 VirtualBox 并下载 Kali Linux 镜像后，你只需要将其导入到 VirtualBox 中就可以使其正常工作。


这里是如何导入 Kali Linux 的 VirtualBox 镜像：


##### 步骤 1


启动 VirtualBox。你会看到一个<ruby> 导入 <rt>  Import </rt></ruby> 按钮，点击它。


![点击导入按钮](/data/attachment/album/202004/15/124703xwog4u1excvgfm4k.jpg)


##### 步骤 2


接下来，浏览刚刚下载的文件，选择要导入的文件（如下图所示）。文件名应该以“kali linux”开始，以 .ova 扩展名结束。


![导入 Kali Linux 镜像](/data/attachment/album/202004/15/124704e5xa0zr1r03x1te3.jpg)


选择后，单击<ruby> 下一步 <rt>  Next </rt></ruby>继续进行。


##### 步骤 3


现在，你会看到要导入的虚拟机的设置。所以，你可以自定义它们或者不自定义，这是你的选择。采用默认设置也是可以的。


你需要选择一个有足够可用存储空间的路径。在 Windows 上，我绝不建议使用 C: 盘。


![将硬盘驱动器导入为  VDI](/data/attachment/album/202004/15/124705sml16cwnzll44ecz.jpg)


在这里，“将硬盘驱动器导入为 VDI”指的是通过分配存储器空间集来虚拟挂载硬盘驱动器。


在你完成设置后，单击<ruby> 导入 <rt>  Import </rt></ruby>，等待一段时间。


##### 步骤 4


你现在将看到它被列在虚拟机列表中。所以，只需点击<ruby> 开始 <rt>  Start </rt></ruby>来启动它。


你可能会在开始时得到一个 USB 2.0 端口控制器的错误，你可以禁用它来解决问题，或者只需按照屏幕上的指示来安装一个附加软件包修复问题。然后就大功告成了！


![Kali Linux 运行在 VirtualBox 中](/data/attachment/album/202004/15/124706u4d7j56deh0sw69s.jpg)


以前 Kali Linux 中的默认用户名是 root，默认密码是 toor。但从 2020 年 1 月起，Kali Linux 就不使用 root 账号了。现在，默认账号和密码都是 kali。


你应该可以用它来登录系统了。


请注意，在尝试安装一个新的应用程序或尝试破解 WiFi 密码之前，请先[更新 Kali Linux](https://linuxhandbook.com/update-kali-linux/) 。


我希望这篇指南能帮助您在 VirtualBox 上很容易地安装 Kali Linux。当然，Kali Linux 有很多有用的渗透测试工具 – 祝你好运！


**提示** : Kali Linux 和 Ubuntu 都是基于 Debian 的，如果你在使用 Kali Linux 时遇到任何问题或错误，你可以按照互联网上的 Ubuntu 和 Debian 的教程解决。


### 奖励: 免费的 Kali Linux 指南书


如果你刚刚开始使用 Kali Linux, 那么了解如何使用 Kali Linux 就很有必要了。


Kali Linux 背后的公司 Offensive Security 制作了一本指南书，讲解了 Linux 的基础知识、Kali Linux 的基础知识、配置和设置，书中还有一些关于渗透测试和安全工具的章节。


基本上，它包含你上手 Kali Linux 所需要的一切东西。更重要的是，这本书可以免费下载。


* [免费下载《揭秘 Kali Linux》](https://kali.training/downloads/Kali-Linux-Revealed-1st-edition.pdf)


如果你在 VirtualBox 上使用 Kali Linux 时遇到问题，请在下面的评论中告诉我们，或者直接分享你的经验。




---


via: <https://itsfoss.com/install-kali-linux-virtualbox/>


作者：[Ankush Das](https://itsfoss.com/author/ankush/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[robsean](https://github.com/robsean) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

Kali Linux is one of the [best Linux distributions for hacking](https://itsfoss.com/linux-hacking-penetration-testing/) and security enthusiasts.

Since it deals with a sensitive topic like hacking, it’s like a double-edged sword. We have discussed it in the past with a [detailed Kali Linux review](https://itsfoss.com/kali-linux-review/), so I am not going to bore you with the same stuff again.

While you can install Kali Linux by replacing the existing operating system, using it via a virtual machine would be a better and safer option.

With VirtualBox, you can use Kali Linux as a regular application in your Windows/Linux system. It’s almost the same as running VLC or a game in your system.

Using Kali Linux in a virtual machine is also safe. Whatever you do inside Kali Linux will NOT impact your ‘host system’ (i.e. your original Windows or Linux operating system). Your actual operating system will be untouched and your data in the host system will be safe.

## How to Install Kali Linux on VirtualBox

I’ll be using [VirtualBox](https://www.virtualbox.org/?ref=itsfoss.com) here. You may also [install Kali Linux on VMWare](https://itsfoss.com/install-kali-linux-vmware/).

VirtualBox is a wonderful [open source virtualization solution](https://itsfoss.com/virtualization-software-linux/) for anyone (professional or personal use). It is available free of cost.

In this tutorial, we will talk about Kali Linux in particular but you can install almost any other OS using the ISO file or a pre-built virtual machine save file.

The same steps apply for Windows/Linux running VirtualBox.

As I already mentioned, you can have either Windows or Linux installed as your host. But, in this case, I have Windows installed (don’t hate me!), where I try to install Kali Linux in VirtualBox step by step.

And, the best part is that even if you use a Linux distro as your primary OS, the same steps will be applicable!

Wondering how? Let’s see…

## Step-by-Step Guide to Install Kali Linux on VirtualBox

### 1. Download and install VirtualBox

The first thing you need to do is to download and install VirtualBox from Oracle’s official website.

Once you download the installer, double click on it to install VirtualBox.

There are several ways you can [install VirtualBox in Ubuntu](https://itsfoss.com/install-virtualbox-ubuntu/), Fedora, etc.

### 2. Download ready-to-use virtual image of Kali Linux

After installing it successfully, head to [Kali Linux download page](https://www.kali.org/get-kali/?ref=itsfoss.com#kali-platforms) to download the VM image for VirtualBox. If you change your mind about utilizing [VMware](https://itsfoss.com/install-vmware-player-ubuntu-1310/), that is available too.

![Download the virtual machine specific image of Kali Linux from official website](https://itsfoss.com/content/images/2023/06/Kali-virtual-machine-images-in-browser.png)

As the file size is around 3 GB, you should either use the torrent option or download it using a [download manager](https://itsfoss.com/4-best-download-managers-for-linux/), whichever is fastest for you.

### 3. Install Kali Linux on Virtual Box

Once you have installed VirtualBox and downloaded the Kali Linux 7z image, you just need to add it to VirtualBox in order to make it work.

Here’s how to add the VirtualBox image for Kali Linux:

** Step 1:** Extract the downloaded 7z file. You can

[use 7zip for extracting the file](https://itsfoss.com/use-7zip-ubuntu-linux/).

**drive on Windows.**

**C:**** Step 2**: Launch VirtualBox. You will notice an

**button – click on it.**

**Add**![Click on the Add button in VirtualBox Welcome screen](https://itsfoss.com/content/images/2023/06/select-add-in-virtual-box.png)

** Step 3:** Next, browse the folder you just downloaded and extracted. Choose the VirtualBox Machine Definition file to be added (as you can see in the image below). The file name should start with ‘kalilinux‘ and end with .

**extension.**

**vbox**![Open the .vbox file in VirtualBox](https://itsfoss.com/content/images/2023/06/open-the-vbox-file.png)

Once selected, proceed by clicking on ** Open**.

** Step 4**: Now, you will be shown the settings for the virtual machine you are about to add. So, you can customize them or not – that is your choice. It is okay if you go with the default settings.

![Start the Kali Linux Virtual Machine with default settings](https://itsfoss.com/content/images/2023/06/start-kali-virtual-machine-1.png)

Here, the hard drives as VDI refer to virtually mounting the hard drives by allocating the storage space set.

After you are done with the settings, hit ** Start** and wait for a while.

You might get an error at first for USB port 2.0 controller support, you can disable it to resolve it or just follow the on-screen instruction of installing an additional package to fix it. And, you are done!

![Enter the user name and password for Kali Linux on the login screen. The default username and password is "kali"](https://itsfoss.com/content/images/2023/06/kali-login-screen.png)

The default username in Kali Linux used to be root and the default password was toor. But since January 2020, [Kali Linux is not using the root account](https://itsfoss.com/kali-linux-root-user/).

Now, the default account and password both are **kali.**

You should be able to login to the system with it.

![Kali Linux is running inside VirtualBox](https://itsfoss.com/content/images/2023/06/kali-linux-desktop-in-virtualbox.webp)

Do note that you should [update Kali Linux](https://linuxhandbook.com/update-kali-linux/?ref=itsfoss.com) before trying to install new applications or trying to hack your neighbor’s WiFi.

The VirtualBox Guest Addition is pre-installed in the Live image since Kali Linux 2021.3.

Of course, [Kali Linux has a lot of useful tools in it for penetration testing](https://itsfoss.com/best-kali-linux-tools/) – so you can explore those after installation.

Both Kali Linux and Ubuntu are Debian-based. If you face any issues or error with Kali Linux, you may follow the tutorials intended for Ubuntu or Debian on the internet.

**Suggested Read 📖**

[How to Install Windows 10 in VirtualBox in LinuxStep by step screenshot guide to installing Windows 10 on Linux using VirtualBox.](https://itsfoss.com/install-windows-10-virtualbox-linux/)![](https://itsfoss.com/content/images/wordpress/2016/02/Install-Windows-virtualbox-linux.jpg)


![](https://itsfoss.com/content/images/wordpress/2016/02/Install-Windows-virtualbox-linux.jpg)

## How to install Kali Linux on VirtualBox using VDI

While you can always follow the instructions recommended above, there's also another way of installing Kali Linux.

You will notice a VDI file when extracting the 7z file of Kali Linux. You can use this VDI file to create a Kali Linux Virtual Machine.

Open VirtualBox and select ** New** option.

![Click on the New button to create a new virtual machine](https://itsfoss.com/content/images/2023/06/click-new-VM-in-vbox.png)

Now, go to expert mode on Virtual box.

![Go to Expert mode in VirtualBox](https://itsfoss.com/content/images/2023/06/vbox-expert-mode.png)

This is nothing but a comprehensive view of all the tweaks that we can do. From there, set all the things like below:

Kali Linux**Name of VM:**Linux**Type:**Debian 64-bit**Version:**): 4GB (Recommended)**Under Hardware, Base Memory (RAM**: More than one, as per availability**Processors**

Now, for the ** Hard Disk** part, select

*and browse for the extracted .vdi file of Kali Linux.*

*Use an existing Virtual Hard Disk File*![Select "Use an Existing Virtual Hard Disk File" option and browse for the .vdi file of Kali Linux, that you have extracted earlier.](https://itsfoss.com/content/images/2023/06/use-existing-vdi-option-in-vbox-expert-mode.png)

On the new dialog box, click on ** Add** and search for the VDI file in resulting file browser. Once you find the file, select it and then press

**.**

**choose**![Select the Kali Linux VDI file and click on Choose button](https://itsfoss.com/content/images/2023/06/choose-the-kali-linux-vdi-file.png)

You can now press the ** Finish **button.

![Click on the Finish button on the bottom right of VirtualBox expert mode settings to create a VM](https://itsfoss.com/content/images/2023/06/click-finish-in-vbox-expert-mode.png)

The VM created will have several settings like Display Memory, Network etc set to default. You should give the Display memory as 128 MB and choose to enable 3D acceleration.

![](https://itsfoss.com/content/images/2023/06/video-memory-1.png)

You can now start the VM, and use username and password "kali" once asked to log in.

You can always install Kali Linux using the ISO file, which has same process like any other Linux distribution.

[How to Install Linux Inside Windows Using VirtualBoxUsing Linux in a virtual machine allows you to try Linux within Windows. This step-by-step guide shows you how to install Linux inside Windows using VirtualBox.](https://itsfoss.com/install-linux-in-virtualbox/)![](https://itsfoss.com/content/images/wordpress/2018/03/install-linux-inside-windows-featured.jpg)


![](https://itsfoss.com/content/images/wordpress/2018/03/install-linux-inside-windows-featured.jpg)

## Bonus: Free Kali Linux Guide

If you are just starting with Kali Linux, it will be a good idea to know how to use Kali Linux.

Offensive Security, the company behind Kali Linux, has created courses that explains the basics of Kali Linux, configuration, and more. It also has a few chapters on penetration testing and security tools.

Basically, it has everything you need to get started with Kali Linux. And the best thing is that the course is available for free. You can go to the portal to explore courses and certification exams, and learn them there.

*Let us know in the comments below if you face an issue or simply share your experience with Kali Linux on VirtualBox. If you are curious, you can also try Kali Linux on Windows using WSL.*