Monday, 2 September 2013

Install VMWare Tools into Kali Linux

Kali Linux is not yet distributed with VMWare tools.  When I am building new instances of Kali Linux in VMWare Fusion I am often not connected to the internet, which means I cannot get the mirror sites setup at the point of the VM instance creation.

If you are successful getting your mirror site setup during Kali installation, there is no need to re-set them up. If you can run apt-get update, you can continue installing the Linux Kernel Headers (below). If, like me, you need to setup mirror sites because you installed Kali Linux without an internet connection (or just skipped it), there are a few ways to add mirror sites after installation. It's probably best to add a mirror repository by using the command:
sudo add-apt-repository [repository]
An easy way (with a bit of risk) is to modify this file while in Kali Linux. Open up a terminal and open this file in your favorite text editor (vi, nano, etc).
vi /etc/apt/sources.list
This is what my file sources.list file contains:
deb kali main contrib non-free
deb-src kali main contrib non-free
deb kali/updates main contrib non-free
deb-src kali/updates main contrib non-free
There is a good VMWare install guide for Kali here:
You should then install the Kernel Headers Package. An overview of the install is here:

These are my commands:
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/

You will now need to get the VMWare Tools binaries mounted to Kali Linux.  In your VM menu, choose 'Virtual Machine' --> 'Install VMWare Tools'.  You should see VMWare Tools mounted.  Copy the contents to /tmp/.
Then, go to /tmp/ and expand the tar file and run the Perl install script. I chose defaults for all of the settings.
cd /tmp/
tar zxpf VMwareTools-*.tar.gz
cd vmware-tools-distrib/

apt-get install xserver-xorg-input-vmmouse 

Then reboot. You should then have VMWare Tools installed.