Install Kali Linux on VirtualBox with Guest Additions 2018!

I just happen to need to do a re-install of my Kali VM so it’s just the right time for a step-by-step tutorial on how to Install Kali Linux on VirtualBox with Guest Additions!I always run Kali on a VM. Even on my hackbook. Why? Because you can always use a snapshot to revert the VM’s state back to a freshly installed period when you mess something up badly – and trust me, it happens.

Corrupted databases, weird errors when trying to modify configs and things along those lines are mostly responsible for my Kali install to stop working, if that happens I simply go back to a working state with a snapshot, within 2 mouse clicks and a few seconds.

I use the free VirtualBox for that, works very well, although I also use VMware Workstation on a different machine, which is just a tad bit better if you are willing to spend the money.

Let’s dive right in.

 

 

Step 1– Downloading Kali

Head over to the Kali Website and choose your flavor. For this tutorial, we  use the 64-bit ISO.

Download Kali.

 

Step 2– Creating a new Virtual Machine

In VirtualBox click on New. Enable the Expert Mode.

Install Kali Linux on VirtualBox

 

Install Kali Linux on VirtualBox

 

Name: Kali

Type: Linux

Version: Linux 2.6 / 3.x /4.x (64-bit)

Memory Size: 1024 MB or more. I usually allocate 2048.

Select Create a virtual hard disk now and click on create.

Install Kali Linux on VirtualBox

 

Choose a location for your VM and specify the size.

I usually am fine with 20 GB and allocate it Dynamically.

As a type I choose VDI.

You can increase the size later if needed.

Click on create.

Install Kali Linux on VirtualBox

Now it’s time to start the installation process.

 

 

Step 3– Installing Kali Linux

Select you’re just created Kali VM and click on Start.

Install Kali Linux on VirtualBox

Now navigate to your download folder and select the Kali Linux.ISO file you downloaded earlier.

Install Kali Linux on VirtualBox

Install Kali Linux on VirtualBox with Guest Additions

On the boot-screen choose: Graphical Install.

Install Kali Linux on VirtualBox

Follow through the Language steps by yourself, also assign a Keymap and select your Location. Give your VM a Hostname, whatever you like and enter a Root password. Once you are done with all that, we have to partition our disks. We are going to choose Guided – use entire disk.

Install Kali Linux on VirtualBox

 

Confirm that all files on the disk will be deleted.

Select All files in one partition at the Partition disks window.

Install Kali Linux on VirtualBox

 

Answer Yes to the question if you want to write changes to disks.

Install Kali Linux on VirtualBox

 

After the installation is done, answer Yes if you want to use a Network mirror. Click continue if you don’t use a proxy. If you do, enter it here.

Install Kali Linux on VirtualBox

 

Select Yes to the question if you want to install the GRUB boot loader on a hard disk.

Install Kali Linux on VirtualBox

 

Choose the correct hard disk and click continue.

Install Kali Linux on VirtualBox

 

Now Kali will restart into your new installation. Log in with root and your password.

Next, we will install VirtualBox Guest Additions.

 

 

Step 4– Installing VirtualBox Guest Additions

Open a Terminal Window.

Install Kali Linux on VirtualBox with Guest Additions

 

First, we want to make sure everything is up to date, so we type:

apt-get update && apt-get upgrade -y

The -y at the end automatically confirms the prompt that asks you if you want to download a certain amount of files necessary for the update. This can take a long time.

Install Kali Linux on VirtualBox with Guest Additions

Now we also want to check if there is a new kali release available, unlikely tho because we just downloaded it freshly.

apt-get dist-upgrade -y

Install Kali Linux on VirtualBox with Guest Additions

 

________________________________________________________________________________________________________________________________________________________________________________________________________

UPDATE ON 12/20/2017 from Ceos3c:

It seems like in newer versions the process was simplified a bit, I just tested this and it works fine.

This only applies for VirtualBox Version 4.2.xx or higher, if you have a lower VirtualBox version continue below the red line, if you just downloaded VirtualBox after March 2018, just run the following code and continue with Step 5:

apt-get update
apt-get install -y virtualbox-guest-x11
reboot now

________________________________________________________________________________________________________________________________________________________________________________________________________

 

Now in some other guides (even in the official Kali documentation), the next step is running the following command:

apt-get install linux-headers-$(uname -r)

I assume this should automatically choose the right kernel of your Linux installation, however for me it didn’t work.

I had to use the command:

apt-get install linux-headers-4.9.0-kali4-amd64

Where 4.9.0 indicates the version of my kernel. Now this, of course, will change as version numbers move forward.

You can simply find the newest version by typing the command until:

apt-get install linux-headers- and now hitting the tab key for auto-completion.

Now you will get a list of all available versions, if you just upgraded everything as in the steps above, you should be fine by installing the newest version number. Also be careful to choose amd64 for 64bit.

Install Kali Linux on VirtualBox with Guest Additions

Reboot your system by typing:

sudo reboot now

Back logged in, open another terminal window.

Now in your VirtualBox window click on Devices -> Insert Guest Additions CD image…

Install Kali Linux on VirtualBox with Guest Additions

In your terminal window type:

cp /media/cdrom/VBoxLinuxAdditions.run /root/Desktop/
cd /root/Desktop/

Install Kali Linux on VirtualBox with Guest Additions

Now adjust the privilege level of the file and run it.

chmod 755 /root/Desktop/VBoxLinuxAdditions.run
./VBoxLinuxAdditions.run

Install Kali Linux on VirtualBox with Guest Additions

I got an error here during this step and had to reboot and run it again, in case of you having the same error: sudo reboot now and do it again.

In case it worked just fine, type:

sudo reboot now

Install Kali Linux on VirtualBox with Guest Additions

After the reboot is finished everything should be working fine. You can check it by maximizing your window, Kali should now automatically adjust to the Window Size, meaning Guest Additions have been successfully installed.

Now that we got everything set up so nicely, we want to take a snapshot in case we mess things up, so we can always come back to our freshly installed state with just a few mouse clicks.

 

 

Step 5– Taking a Snapshot

In VirtualBox select your Kali VM, click on Snapshots in the upper right corner and click on the small camera symbol indicated by the number 3.

Install Kali Linux on VirtualBox with Guest Additions

Give it a descriptive name and hit OK. Voíla, you are set and done.

Install Kali Linux on VirtualBox with Guest Additions

The next thing I usually do now is to install Guake Terminal, can’t and won’t work without it anymore. This concludes the Install Kali Linux on VirtualBox with Guest Additions tutorial.

18
Leave a Reply

Tell us what you think!

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
newest oldest most voted
Notify of
trackback

[…] Let’s get started. Metasploit comes pre-installed on most Security Operation Systems such as Kali Linux or […]

trackback

[…] to check if a Website is running WordPress is by using wpscan. Wpscan comes pre-installed in both Kali and […]

trackback

[…] If you don’t know how to install Kali Linux on VirtualBox, we got you covered. […]

trackback

[…] I install OpenVAS on a freshly installed Kali Linux in VirtualBox. If you want to know how to install Kali on Virtual Box check out this article. […]

trackback

[…] I wouldn’t recommend it. If you want to learn how to install Kali on VirtualBox, check out my tutorial on […]

sterne044
Guest
sterne044

Thanks for the job.

Just my 2 cents concerning the update about the Guest additions : “This only applies for Kali Linux Version 4.2.xx or higher” should be “This only applies for VirtualBox Version 4.2.xx or higher” instead…

john doe
Guest
john doe

no luck using the latest method april 2018

trackback

[…] to check if a Website is running WordPress is by using wpscan. Wpscan comes pre-installed in both Kali and […]

Shreez
Guest
Shreez

Thank you so much, you are a legend.
The documentation on the actual Kali website to do this is plain rubbish.
Thank you!

YU
Guest
YU

nice job!

Chris Kaprys
Guest

i’ve installed past kali versions into virtualbox and always had success. now trying with Kali 2017.3 on the most recent virtualbox, and not a single attempt at installing guest additions has worked. -After fresh install into the VB, ‚update‘ ‚upgrade‘ and ‚dist-upgrade‘ finish with 0 results. -Trying the „new and easy“ way with ‚apt-get install -y virtualbox-guest-x11‘ spits out ‚E: Unable to locate package virtualbox-guest-x11‘ -Trying ‚apt-get install linux-headers-$(uname -r)‘ spits out three errors, starting with ‚Unable to locate package linux-headers-4.13.0-kali1-amd64‘ -Trying the cdrom step and running ‚./VBoxLinuxAdditions.run‘ spits out a message saying ‚This system is currently not set up… Read more »

Jukka Luotonen
Guest
Jukka Luotonen

On this twitter account might be solutuion tuo this… I had to reloadsecurity key to get apt-get working : Twit is from February 2nd.
https://twitter.com/kalilinux?ref_src=twsrc%5Etfw&ref_url=https%3A%2F%2Fwww.offensive-security.com%2Foffensive-security-solutions%2Fpenetration-testing-services%2F

zhangsidan
Guest
zhangsidan

thank you very much

%d bloggers like this: