Friday, November 8, 2013

Installing Kali On Hard Disk using usb

Booting and installing Kali from a USB stick is the easiest and fastest method of getting up and running. In order to do this, we first need to create the Kali ISO image on a USB drive. 

Preparing for the USB copy

  1. Download Kali linux.
  2. If running Windows, download Win32 Disk Imager.
  3. No special software is needed for a *nix OS.
  4. A USB Key (at least 2GB capacity).

Kali Linux Live USB Install Procedure

Imaging Kali on a Windows Machine

  1. Plug your USB stick into your Windows USB port and launch the Win32 Disk Imager software
  2. Choose the Kali Linux ISO file to be imaged and verify that the USB drive to be overwritten is the correct one.
  3. kali-usb-install-windows
  4. Once the imaging is complete, safely eject the USB drive from the Windows machine. You can now use the USB device to boot into Kali Linux.
If you just want to use Kali live, you can stop right here. Reboot and press F-12 or whatever shows up the multiboot menu, select the USB drive and run kali live.

Imaging Kali on a Linux Machine

Creating a bootable Kali Linux USB key in a Linux environment is easy. Once you’ve downloaded your Kali ISO file, you can use dd to copy it over to your USB stick as follows:
WARNING. Although the process of imaging Kali on a USB stick is very easy, you can just as easily destroy arbitrary partitions with dd if you do not understand what you are doing. 
In other words, you can completely mess up your hard drive to a state from which repair would required professional help. You have been warned.
  1. Plug in your USB device to your Linux computer’s USB port.
  2. Verify the device path of your USB storage with dmesg.
  3. Proceed to (carefully!) image the Kali ISO file on the USB device:
 dd if=kali.iso of=/dev/sdb bs=512k
That’s it, really! You can now boot into a Kali Live / Installer environment using the USB device.

Adding Persistence to Your Kali Live USB

Adding persistence (the ability to save files and changes across live boots) to your Kali Linux image can be very useful in certain situations. To make your Kali Linux USB stick persistent, follow these steps. In this example, we assume our USB drive is /dev/sdb. If you want to add persistence, you’ll need a larger USB device than we listed in our prerequisites above.
  1. Image the Kali Linux ISO to your USB stick as explained above, using the “Linux Method” and dd.
  2. Create and format an additional partition on the USB stick. In our example, we usegparted by invoking: 

     gparted /dev/sdb
  3. Your current partitioning scheme should look similar to this: 

    usb-persistence-basic-partitioning
  4. Proceed to format a new partition of your desired size to be used for persistence. In our example, we used all the remaining space available. Make sure the volume label of the newly created partition is persistence, and format it using the ext4 filesystem.
    usb-persistence-creating-partition
  5. Once the process is complete, mount your persistence USB partition using the following commands:

     mkdir /mnt/usb
     mount /dev/sdb2 /mnt/usb
     echo "/ union" >> /mnt/usb/persistence.conf
     umount /mnt/usb
  6. Plug the USB stick into the computer you want to boot up. Make sure your BIOS is set to boot from your USB device. When the Kali Linux boot screen is displayed, select “Live boot” from the menu (don’t press enter), and press the tab button. This will allow you to edit the boot parameters. Add the word “persistence” to the end of the boot parameter line each time you want to mount your persistent storage. 
    usb-persistence

Installing Kali - Dual Booting Kali With Windows

Kali Linux Dual Boot with Windows

Installing Kali alongside a Windows installation can be quite useful. However, you need to exercise caution during the setup process. First, make sure that you’ve backed up any important data on your Windows installation. Since you’ll be modifying your hard drive, you’ll want to store this backup on external media. Once you’ve completed the backup, we recommend you peruse Kali Linux Hard Disk Install, which explains the normal procedure for a basic Kali install.
In our example, we will be installing Kali Linux alongside an installation of Windows 7, which is currently taking up 100% of the disk space in our computer. We will start by resizing our current Windows partition to occupy less space and then proceed to install Kali Linux in the newly-created empty partition.
Download Kali Linux and either burn the ISO to DVD, or prepare a USB stick with Kali linux Liveas the installation medium. If you do not have a DVD or USB port on your computer, check out the Kali Linux Network Install. Ensure you have:
  • Minimum of 8 GB free disk space on Windows
  • CD-DVD / USB boot support

Preparing for the Installation

  1. Download Kali Linux.
  2. Burn The Kali Linux ISO to DVD or copy Kali Linux Live to USB.
  3. Ensure that your computer is set to boot from CD / USB in your BIOS.

Dual Boot Installation Procedure

  1. To start your installation, boot with your chosen installation medium. You should be greeted with the Kali Boot screen. Select Live, and you should be booted into the Kali Linux default desktop.
  2. Now launch the gparted program. We’ll use gparted to shrink the existing Windows partition to give us enough room to install Kali Linux. 

    dual-boot-kali-01
  3. Select your Windows partition. Depending on your system, it will usually be the second, larger partition. In our example, there are two partitions; the first is the System Recovery partition, and Windows is actually installed in /dev/sda2. Resize your Windows partition and leave enough space (8GB minimum) for the Kali installation. 

    dual-boot-kali-03
  4. Once you have resized your Windows partition, ensure you “Apply All Operations” on the hard disk. Exit gparted and reboot.
    dual-boot-kali-05

Kali Linux Installation Procedure

  1. The installation procedure from this point onwards is similar to a Kali Linux Hard Disk install, until the point of the partitioning, where you need to select “Guided – use the largest continuous free space” that you created earlier with gparted.

    dual-boot-kali-09
  2. Once the installation is done, reboot. You should be greeted with a GRUB boot menu, which will allow you to boot either into Kali or Windows. 
    dual-boot-kali-11

VMWare Tools

Once you are done setting Kali Linux with VMWare, there is still stuff that you might want to do.
Note: This article assumes that you have basic knowledge about linux cli and have already installed kali linux. If not, read this article about installing kali linux and getting acquainted to command line interface.

Should you decide to create your own VMware installation of Kali Linux rather than using the  pre-made VMware images available at Kali Linux official site, you will need to follow the instructions below in order to successfully install VMware Tools in your Kali installation. You can opt to install either open-vm-tools, or the native VMWare tools.

Installing open-vm-Tools

This is probably the easiest way to get “VMWare tools” functionality inside a kali VMWare guest.
apt-get install open-vm-tools

This should be sufficient, but if you are feel that this was way too easy, then you are up for an adventure. Without knowledge of cli, what follows might look like a nightmare.

Installing VMware Tools in Kali

If open-vm-tools does not work for you, or if you prefer using native VMWare tools, begin by installing some packages that are required by the VMware Tools installer:
echo cups enabled >> /usr/sbin/update-rc.d
echo vmware-tools enabled >> /usr/sbin/update-rc.d

apt-get install gcc make linux-headers-$(uname -r)
ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/
Next, mount the Vmware tools ISO by clicking “Install VMware Tools” from the appropriate menu. Once the VMware Tools ISO has been attached to the virtual machine, we mount the drive and copy the VMware Tools installer to /tmp/.
mkdir /mnt/vmware
mount /dev/cdrom /mnt/vmware/
cp -rf /mnt/vmware/VMwareTools* /tmp/
Then, change directory to /tmp/, extract the tarball and start the installer:
cd /tmp/
tar zxpf VMwareTools-*.tar.gz
cd vmware-tools-distrib/
./vmware-tools-install.pl
Follow the prompts for the VMware Tools installation and you are done.
Lastly, to get rid of possible VMWare service errors, edit the /etc/init.d/vmware-tools script, and at around line 876, change:
 # POSIX shell uses '!' for negation during bracket expansion.
   # See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
   IFS=.
   set -- `uname -r`
to :
 # POSIX shell uses '!' for negation during bracket expansion.
   # See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
   IFS=.
   set -- `uname -r|cut -d"-" -f1`
Once changed, proceed to restart the VMWare tool service.

Slow Mouse Movement in VMware

If your mouse movement is slow and sluggish in a Kali Linux VMware guest, try installing the xserver-xorg-input-vmmouse package in the Kali guest.
apt-get install xserver-xorg-input-vmmouse
reboot