
Table of Contents
A detailed guide on installing Kali Linux on VirtualBox
A lot of the users would like to do crazy stuffs with their Kali Linux. If you’re doing something you’re not sure, you want to install unknown packages, modify some code but don’t want to break your HOST OS, running and installing Kali Linux on VirtualBox is the best way to go. You could also try using VMware but as VMware is proprietary and VirtualBox is free to use, there’s no argument which way usual users would go. Running Kali Linux on VirtualBox is great as in that way all you need to do is take a snapshot and if you break sometime, you can quickly roll back. This imposes another problem though. If you keep breaking things and keep rolling back for everything, you don’t really learn the Operating System itself. You are learning to bypass and overlook a problem with a easy way out. I am going to judge that? Maybe not. Linux can be quite complicated sometimes specially you never used it before. You might have just heard about Kali Linux from a friend and learned how much it can achieve and wanted to give it a try without actually installing it in your hard disk alongside your primary OS (may that be Windows or Linux or MAC).
Pros of running Kali Linux on VirtualBox
- You can run more than one OS simultaneously.
- You can install/re-install/backup/move/restore/rollback your guest OS easily.
- You can manage allocation of resource (Memory, Hard disk). Resource Management!
- You can copy your VirualBox to a different machine. Portability!
- You can completely break your installation and roll back in few clicks.
- You’re forced to troubleshoot and thus learn.
- Great for learning and testing.
Cons of running Kali Linux on VirtualBox
- Performance drop. Usually much slower.
- GPU Acceleration doesn’t work.
- USB Wireless cards can be problematic.
- You tend to avoid learning troubleshooting and just rollback quite often.
- You won’t be comfortable installing and running in real machine if you’re too used to VM’s.
- Can’t use FULL graphics as the card is Virtualized.
- Adds an additional layer between OS and actual hardware.
Saying all that, it’s true for any Virtualized environment. If you’re learning, testing.. yes go ahead. Even best one uses VM’s to test cause it’s just too much time consuming to install and re-install and update.
What is VirtualBox
VirtualBox is a general-purpose full virtualizer for x86 hardware, targeted at server, desktop and embedded use. It is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL) v2. Presently, VirtualBox runs on Windows, Linux, Macintosh, and Solaris hosts and supports a large number of guest operating systems including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista, Windows 7, Windows 8), DOS/Windows 3.x, Linux (2.4, 2.6 and 3.x), Solaris and OpenSolaris, OS/2, and OpenBSD.
VirtualBox is being actively developed with frequent releases and has an ever growing list of features, supported guest operating systems and platforms it runs on. VirtualBox is a community effort backed by a dedicated company: everyone is encouraged to contribute while Oracle ensures the product always meets professional quality criteria.
Things you need to install
As I am going to show this in Windows here’s the link to Windows installer. You can download MAC or Linux installer and follow EXACTLY the same steps to install and run VirtualBox in your machine.
- VirtualBox 4.3.10 for Windows hosts x86/amd64
- VirtualBox 4.3.10 Oracle VM VirtualBox Extension Pack for All supported platforms
Extension pack provides the following added functionality:
- The virtual USB 2.0 (EHCI) device;
- VirtualBox Remote Desktop Protocol (VRDP) support;
- Host webcam passthrough;
- Intel PXE boot ROM and
- Experimental support for PCI passthrough on Linux hosts.
If you need instructions on how to install VirtualBox in your machines (may that be a Windows, Linux or MAC or Abracadabra, refer to their User Manual. VirtualBox user Manual is VERY detailed and specific installation instruction can be found here.
Download page: https://www.virtualbox.org/wiki/Downloads
Kali Linux
I mean if you don’t know what Kali Linux is, you wont be here!! Right? Anyhow, Kali is the Hindu goddess associated with empowerment! I’m just kidding. Kali Linux is a Debian-derived Linux distribution designed for digital forensics and penetration testing. It is maintained and funded by Offensive Security Ltd. It was developed by Mati Aharoni and Devon Kearns of Offensive Security through the rewriting BackTrack, their previous forensics Linux distribution. Say hi to Mati and Kali Dev team at www.kali.org.
You need to download the latest version of Kali Linux ISO from here.
You can also download from CDImage Page here:
I would personally suggest downloading using TORRENT and it seems more stable and less chance of data corruption.
In this guide I will outline very detailed step by step instructions on installing Kali Linux on VirtualBox where Windows 7 is the HOST operating system.
Installing Kali Linux on VirtualBox
In this guide, I will cover the followings:
- Create a new Virtual Machine
- Create a new Virtual disk (VDI, dynamic allocation etc.)
- Modifying some VirtualBox settings (allocating physical and Video memory, selecting OS Type, CPU acceleration etc.)
- Loading Kali ISO
- Booting Kali ISO (initial info, location, timezone etc.)
- Kali disk partitioning (you should try other ways than I’ve showed here to learn)
- Finalizing instllation and running Kali on VirtualBox.
- Install Virtualbox Guest Additions packages
You have two options here to follow this guide,
- You can just use the slideshow in this page and pretty much follow that..
- You can read this really long informative guide to get a better understanding of what to do
So choice is yours.
Step 1: Create a new Virtual Machine
I’ve already given instructions and provided links on how to get VirtualBox and install that above. If you’ve missed it, go back and install VirtualBox.
Once you’ve installed VirtualBox,
- Open it.
- Click on New to create a New Virtual Machine.
Step 1.a: Enter a name for you VBox
Enter Kali Linux 1.0.6 as the name. You’ll see Type is set to Linux automagically and version will be Linux 2.3/3.x. We will fix those later. Click Next.
Step 1.b: Allocate Memory/RAM
Default memory size is 256 MB.
Change it to 1024 (1GB).
223 comments
Very good and in-depth write up, but let me clear up some of the cons. On modern HW, running Kali on VM with full virtualization support is not much slower. GPU acceleration is not important to Kali. If you want to do some hashcat, or other GPU based cracking, it’s extremely easy to transfer your output file to the host OS and crack with full GPU support. USB Wi-Fi cards work very well, but are a pita to get registered the first time. Finally, switch to VMware. VMware has been proven to be faster and more stable.
Hi David,
You’re right. I couldn’t try it in VMWare as it’s quite expensive (Player isn’t but Workstation is where you should ideally run Kali). If I can get a copy of licensed VMWare, I’ll write a post comparing VMWare and VirtualBox – Speed, Processing, Ease of Installation, Usage and Peripherals support.
Thanks for your comment and positive feedback.
-BMO
please tell me , install virtualbox in kali linux 1.0.7, (error kernel ?)
sorry kali linux 1.0.6 . error kernel
you need to enable the vertualisation
just restart
u need to enable HARDWARE VIRTUALIZATION which is present in bios
Respect Sir……………………Thanks Great work…………..
May u live long………………………………
Hello,
i cant continue to Graphical install because it’s giving me some kernel error…Pls help me!
reply ASAP pls
If you are using Virtual Box then,
Go to settings —> System —> Processor —–> Enable PAE/NX
You need a bigger cpu try using another computer
I was just wondering why mine continues on step 4 it just repeatedly goes nope failed to get the format of the file when i click on the kali iso
Could you please do a detailed guide on how to install NetHunter on a Samsung galaxy S5!
HELP ITS STILL SAYS INSTALLATION STEP FAILED PLS WHAT DO I DO
GO BACK TO BASICS, A COMMADORE 64???? Seriously google, google, google, most problems are caused by a lack of understanding … I myself am a newbie and came here cause i cant work out the mirrors, thus I came here. I figure there is no way to understand the answer to the question until i have worked out what i dont know ????c Im sure we will both get there in the end, good luck mate !!!
load debconf preconfiguration file failed kali linux I am keep getting this error pls help
loda faster vmware sucks no matter how uch good conf u have if it stucks at startup u dont’hve solution without good guidance source.
great in depth guide for a Linux noob, thank you for your time and effort.
Step 8.b didn’t work as planned (might be different file name now, but there again i’m not used to Linux terminal). i ended up manually browsing the mounted image, finding, copying and pasting the required file to the /root directory, then found an option in the file properties to run as an executable, which seemed to launch the installer.
Hey im still stuck on this part, just followed this guide through and the last step wont work, keeps telling me permission denied
Just enable PAE/NX in the VM settings
Hi i m following the as u have posted here, downloaded the kali 64 amd iso but the virtual box doesnot show one when i have to select one in step 3 n next problem i face is during graphical installation part as it does not move further from there, language option doesnot pop up n i m stuck pls help me out. Using it windows 7 ultimate.
Hi Hemant,
Ensure you’ve allocated 20GB space. Disconnect networking and retry.
If you have AntiVirus/Firewall on your Windows 7, turn it off and try again. Some firewalls are notorious and they block Memory access.
You also need to ensure that your Kali ISO was not damaged during download. This is usually the most common issue. Follow this guide to verify that:
Verifying SHA1 Checksums of Downloaded Images. This same guide also shows multiple troubleshooting steps for Kali Linux.
Good Luck.
-BMO.
Hi i figured out my mistake n installed the 32 bit version… Somehow i have managed to install it(sheer luck) now i m stuck with the vboxadditions file 4.3.10_93012.. I m not able to install the getting an error where its not able to copy it n plus some error 32 cannot match the file after tht? Pls help
Finally figured evrything on my own… Thanks
Hey blackMORE Ops,
Just to let you know, the frequent issue of the install process being stuck sometimes has to do with network connectivity.
In my case, I found that while I was stuck on the package manager configuration screen, it was actually due to /etc/resolv.conf being empty and therefore, all DNS queries were unable to complete. DHCP should have taken care of this but I guess it’s one of those bugs that wildly occur.
Sorry that it seems like a stupid question that how i can log in again after finishing graphical installation. When i start it again, it just show the default settings for me to choose, so which one should i choose to enter the system i have already configured ? Thanks for your help !
Hi Dirk,
Once you’ve finished installing, the installation process should prompt you to reboot. After rebooting, you should get the login prompt. See image:
Good Luck.
-BMO
Thanks for your reply ! sorry that maybe my presentation was hard to understand, what i really means is that i have already finished all the installation and configured my own settings, and then used poweroff command to close it, but when i rebooted it again, it showed the original boot menu with live mode, install etc.. So i just wonder which mode i should choose to enter the system with my own settings already. Thanks for your help
Dirk, check a few Youtube videos on how to install Kali on VirtualBox. There’s few good ones out there. It can be tough to explain in writing sometimes!! Good Luck.
Thanks for your opinion, i really appreciate for your help !
Hello BlackMore !!
Its an anazinf tutorial and I want to say thanks for this !
I follow step by step your tutorial and using the same version of the software and packages here.
Everything is running OK for the install and for the boot after install BUT i can’t access to the login screen.
I have a “Ooops an error occur” screen with a picture which appears and have no other choice that click on the button on the right corner to reboot or shutdown.
Tried already bith, same problem….
Any helps and/or ideas please ..?
Hi Zell,
I’ve never seen that error on VirtualBox, that usually happens on Physical installations. You’ve surely allocated only 8GB space (that’s the default VirtualBox settings). You need at least 16GB (Make it 20GB as per guide). Delete this VirtualBox installation and create a new one with 20GB. Good Luck.
Hi, i keep getting a error message on step 4 (VERR_NOT_SUPPORTED). everything is set correctly to my knowledge and i have downloaded it twice to ensure there was no error but i cannot get any further.
Hi Sam, that error usually means that the download failed. Perhaps try the torrent.
Step 8b is not working for me.
It is showing error.
Excellent tutorial, thank you for taking the time and dedication.
Everything goes fine until step 7a. after 7a. My installation hangs on a screen that says configure packet manager.. Pls help what to do ?
Did you allowed enough space (i.e. 20GB?). Unless there’s an issue with your downloaded ISO file, it should just work. Also, try without network connection as some adapters plays up.
hi blackmore again,
i have 1TB hard disk and i want to use kali is my daily used OS, only kali. how should i partition disk?
I would follow something like what RedHat recommended.
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s2-diskpartrecommend-x86.html
Put BOOT and HOME (in Linux home for root is /root) in different partition so that you can always reuse them in case you need to reinstall. By putting HOME/ROOT in different partition, you won’t loose anything. Try in a VirtualBox first before you get some confidence to actually use it in Physical installation.
Wow…very detailed. However, why wouldn’t you just use Vagrant/Virtualbox? `vagrant box add kali-linux http://ftp.sliim-projects.eu/boxes/kali-linux-1.0-amd64.box && vagrant kali init` BOOM DONE!
Are you complaining or showing off?
Thank you very much on this guide, it was very helpful and I succeeded first try thanks to you.
thank you very much i suceessfully installed kali ……… thats u for doing so much hard work in writing whole tutorial
when leaving the http space vacant,it showing a error
Thanks for this precious guide!
Ciao dall’Italia
Good article that falls apart at Step 7.f when you seem to just give up and not really be bothered explaining why you’re doing.
For example Step 7.f clicking Applications does not bring up the details dialogue you show. Similarly Steps 8. Did you get bored?
Hey Blackmore, thanks for the amazing tutorial. I’m facing some problems that I’d love to receive help on.
First of all, I’ve followed every step as explained above.
I downloaded and installed the extension pack and it doesn’t says invalid settings detected anymore but when I start the machine it says you need to either download the extension pack or disable USB 2.0. This keeping apart, I for now, decided to disable this option.
Now when I start machine the kali linux boot screen welcomes me, when I click on graphical install a black screen comes up and it stays there.
I waited for 2-3 minutes but still the black screen and not the installation UI.
Please help me ASAP
Kindest Regards
Mayank
Mayank, read the comments. It’s all in there.
helo sir i have still problem with that can we acess kali on window xp
You made a very serious mistake in step 8a: apt-get install linux-header-$(uname -r)
The correct one is apt-get install linux-headers-$(uname -r).
Let’s see what’s difference.
Thanks for your guide.
Seriously you don’t that a serious mistake which was pointed out by almost every reader!! I did made that mistake but I never fixed it, spoon feeding will only take someone this far specially when you’re using Kali Linux. (btw even the screenshot shows correct command).
Thank you very much. I really appreciate you took the time, explaining this in such detail.
Once again, thank you!
Excellent tutorial. Thank you for taking the time to put it together. It saved me a ton of time to set up my environment.
Hi there blackMORE ops… it would appear I’ve run into a problem.
I’ve followed your tutorial completely but yet I get stuck at step 8.b.
I don’t understand what the issue might be… since I’ve already mounted the VBoxAdditions iso… and now appears on my desktop. but as I try to run the command “cp VBoxLinuxAdditions.run /root/”, my command gives the bloody finger and tells me “cp: cannot stat `VBoxLinuxAdditions.run’: No such file or directory” and thus I now I’m left standing, not knowing really what to do. Have I perhaps missed out on something?
Never mind, I’ve solved the issue just as I posted the comment. Great guide I’ll say, great job and thanks.
Hello,
I’m stuck on the same problem that you were. Can you tell me how you solved it?
Please how did you solve this?
U have to go in the right directory with “cd” to wwork with this command
Would you please tell me how to solve this issue?
Never mind already figured the problem on my own, i feel kind of silly now thanks and great tutorial
I couldn’t get around this problem till I followed the steps here: http://superuser.com/questions/261643/cant-install-guest-additions-using-virtualbox-ubuntu-guest-os-win7-host-os. I’m on a Mac but they worked perfectly for me.
Excellent guide by the way!! Thank you! :)