上QQ阅读APP看书,第一时间看更新
Installing Kali on VirtualBox
VirtualBox is a very popular virtualization product, because it's free and it offers professional features. You will probably use VirtualBox for your virtualization environment. My base machine is either Windows or macOS, and I have VirtualBox installed on top of it, so I can use Kali Linux for my penetration testing tasks.
Kali offers us pre-built images for VirtualBox, so all we need to do is import them and start using Kali right away. Amazing, right? See the following steps:
- To download the VirtualBox image file, go to https://www.kali.org/downloads and scroll down a little bit, until you see the following section:
- Follow the link to the Offensive Security Download page. On that page, you will see a table that contains the virtual image copies for VirtualBox:
- Choose either the 32- or the 64-bit version, and download it locally to your machine. Then, you will need to import it into VirtualBox, so open it and locate the File menu (and click on it), and then click on Import Appliance (I'm using macOS for this demo, and Windows should be very similar).
- Once Kali has been imported into VirtualBox, you will need to alter its default settings. To accomplish this, select the new VM, and click on the Settings button.
- First, we need to check the Memory settings. Click on the System tab, then click on the Motherboard sub-tab. Make sure that you have at least 2,048 MB (2 GB) of memory. If you have a good host machine, it is preferable to increase it to 4 GB:
- Next, click on the Processor sub-tab, and make sure that the CPU cursor is between the green area and the orange area, as shown in the following screenshot:
- Now, it's time to set the Network settings. If you want to separate your virtual machine from your local area network (LAN), then you need to choose either NAT or NAT Network. Choosing NAT will always assign the same IP address, but if you choose NAT Network, your VM will automatically be assigned a dynamic IP address, using a virtual DHCP server:
- If you choose the NAT Network option, then you have to exit the settings window and select the VirtualBox menu, then click on Preferences. Next, select the Network tab, and click on the NAT Networks sub-tab. Finally, click on the Add button on the right-hand side, where the plus sign is (see the following screenshot), and a new network will automatically be created for you:
- If you're a geek and would like to rename the network or assign a specific IP address range, you will have to click on the Edit button (below the Add button; it has a brush icon). You will see a pop-up window where you can adjust the settings to your preferences:
- When you use a virtual machine, you need to share files between Kali Linux and your local machine. To accomplish this, you need a shared folder. Let's go back to the VM settings and select the Shared Folders tab. Then, click on the Add button on the right-hand side. A pop-up window will open, in which you can enter the path to the folder locally to your physical machine (Windows or macOS) and give your shared folder a name. I personally use the Auto-mount option, as well, to make sure that this feature always works when I boot up my Kali host:
- Now, you can boot your Kali VM. On the first boot, I recommend that you install the VirtualBox Guest Additions. To do so, open your Terminal window and execute the following three commands:
apt-get update
apt-get install -y virtualbox-guest-x11
reboot
After the reboot command, your VM will restart. You will be set to start using the fantastic OS Kali Linux!