Skip to Main Content
May 21, 2013

Installing Kali Linux on Hyper-V

Written by David Kennedy
You may run into a scenario where you need to deploy Kali Linux on a Hyper-V instance. There's to main ways to go about this and to get it working properly. Unfortunately, the ISO isn't compatible and dies during bootup. We haven't currently figured out a way to get the ISO with full install mode to work. Booting the ISO up and leaving it in LiveCD mode does correctly work however upon full install, during the initial boot process, dies and appears to be a corrupt install. In order to get Kali Linux working on Hyper-V, the first thing you need to do is get a VMWare image. You can either make your own which has its benefits since the Kali VMWare image only comes in 32 bit platforms. The second is just to download the vmdk from the Kali Linux website. Scenario 1: Download an ISO of your choosing from Kali Linux Downloads. Use VMWare Fusion or Workstation to create the necessary installation. Do a full install and ensure that everything is working properly inside of your VM. Scenario 2: Download the vmdk 32 bit Gnome ISO from Kali Linux Downloads. Next, on a supported Windows machine - download Windows Virtual Machine Converter from the Microsoft website here. Install it and open up a command prompt as an Administrator. Next we need to convert our Kali VMWare image to a Hyper-V VHD image. From the command line, Navigate to: C:Program Files (x86)Microsoft Virtual Machine Converter Solution Accelerator> Next, change the directory to where you saved the vmdk and to where you want to save the VHD output image:
C:Program Files (x86)Microsoft Virtual Machine Converter Solution Accelerator>mvdc "C:VMKali.vmdk" "C:VMKali.vhd"
Note the first is the VMWare image and the second is the VHD which is the output of the virtual machine converter. The VHD is what we will use when we build our new Hyper-V instance of Kali. This section takes three major steps, the first is building the initial files needed, allocating the memory, and copying over the data. It will take about an hour or two depending on your CPU specifications. Now that everything is converted over. Move the VHD to a directory that it will permanently reside. Usually the directory that has all of your other VHD's. Next we need to create a new virtual machine in Hyper-V:
Next, select a name and how much RAM you want to allocate. Now on the next screen, we need to use an existing disk and then point to our newly create VHD below:
After that, you should be all set and Kali should boot up like a champ.
Couple of things to remember, first change the default root/toor password and second, if you are using SSH, make sure you have it restart on startup it's a bit funky but can do it by typing the following in a terminal:
update-rc.d -f ssh remove
update-rc.d ssh defaults
Now you should have SSH upon restart. Next we will want the Bleeding Edge Repositories from Kali to ensure that we are up to date with the latest and greatest tools:
echo deb http://repo.kali.org/kali kali-bleeding-edge main >> /etc/apt/sources.list
apt-get update
apt-get upgrade
You are all done and running Kali on Hyper-V.