Running Kali Linux as a Vagrant Box (virtual machine)

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, November 16, 2014

Follow me on Twitter as @mattiasgeniar

Here’s the simplest way to start a Kali Linux virtual machine on your desktop or laptop: run it as a Vagrant box! First, download the latest version of Vagrant, you need at least version 1.6 or newer. You’ll also need VirtualBox.

Next, make a new directory on your filesystem and import the Kali Linux box.

$ mkdir kali-linux-vm
$ cd kali-linux-vm
$ vagrant init Sliim/kali-linux-2.0-amd64

The Kali Linux box is now imported and you can run it via Vagrant, that will start the Virtualbox VM for you.

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'svigneux/kali-linux-1.0.6-amd64-mini' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: to force provisioning. Provisioners marked to run always will still run.

To get inside your Kali Linux machine, use “vagrant ssh” to get a (limited) bash shell. Then use sudo to become root.

$ vagrant ssh
$ sudo su -

The minimal box has no GUI, so everything is done via the CLI. It’s around 350MB in size, so _very_ small. Have fun!



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.