Kali Persistent USB Setup

After recently deciding to get back into Linux, I decided to start using Kali and ditch Backtrack 5. As you all know, Kali is basically a new, debian, version of Backtrack Linux. kali persistent logo If you haven’t already tried out Kali, a persistent USB is a perfect way to test it out. A Kali persistent USB drive will allow you to run your Linux OS off the USB drive itself, and keep track of your changes. This is great if you want to save your downloaded tools for later, or if you switch between multiple computers often. It’s actually easier than ever to create a persistent copy of Kali. I recommend a USB 3.0 flash drive with 8GB or more of space. I used a 32GB flash drive — Kali itself should take up around 3.5GB to 4GB of space. I am going to be assuming that you are currently a Windows user.

Requirements

  • USB 3.0 drive with at least 8GB of space
  • Windows computer (some software we will use requires Windows)

Installing & Creating Kali Persistent Bootable USB

First, download Kali Linux. On the website, you should see a 64-bit and a 32-bit version. I recommend downloading the 32-bit as it will work on ALL computers (32-bit and 64-bit), whereas the 64-bit Kali will require a 64-bit hardware setup. The whole point of a Kali LIVE USB is that you can take it with you and use it anywhere, right? The website has a “Direct” ISO/image file download or a “Torrent” download. Either download is fine, however torrent may download faster. I’m assuming you know what a torrent is by now, or have some experience downloading torrents, if not, Google it. You will need a torrent client to download it via torrent.

After downloading Kali, you should have an .ISO (image) file in your downloaded folder. Now, we need to install Kali and make the USB bootable. There are a lot of tools that can be used and Universal USB Installer is one of my favorites. If you haven’t downloaded Kali, it even gives you the option to download Kali (or any other Linux distro) and make a bootable USB from it. Anyhow, run the program and under step 1, select “Kali Linux.”

Step 2, browse and point it to the location where you downloaded and saved the Kali ISO/Image file. Step3, Select your USB Flash drive from the drop down box. If it gives you the option to format before installing, please check “We will format X:\ Drive as Fat32”.

Verify everything is correct and hit the “Create” button. It should take a few minutes, however you should get an “Installation Complete” message if the operation completed successfully.

Now, you should have a bootable Kali installation on your USB drive. Go ahead and feel free to test it out. Restart your PC and select “boot from USB drive.” This is done when the PC is first turned on, from the BIOS. There are a lot of different BIOS versions as there are computer manufacturers, so I cannot cover them all. However, most DELL computers require you to hit F12, and select which storage device you want to boot from. Anyways, once you boot from the drive, Kali gives you this option screen:

kali persistent

Select “LIVE USB Persistence” and wait till it boots to desktop. Try and save a document and restart and you will see it STILL does not save anything! So in order to get your documents, data, network settings, etc. to save, we have to create another partition. We cannot do this from inside our new Kali persistent USB, as it most likely will not let you adjust the partition.
So anyways, back to Windows. Run a partition utility such as MiniTool Partition Wizard Free or EaseUS partition Master.

kali persistent 3MiniTool Partition Wizard FREE

Next resize the partition that currently has Kali installed on it, and leave it around 4GB of space total (just enough for the Kali distro). The rest of the space on the drive should be labeled “unallocated”. Now right-click the “unallocated” section and select “create”.
Use options:

Label: persistence
Create as: primary
File System: ext4

Then click “OK” and click “APPLY” to apply all the move/resize changes we just made. This may take some time depending on how large the USB is, so just let it do its thing — grab a bite.

Setup Persistence

Now we are ready to setup the persistence in Kali. So boot back into the new Kali USB we just created and select “Live USB Persistence”. Now, launch the terminal and type the following commands one after the other:

/*Kali Persistent USB configuration */
mkdir -p /mnt/my_usb
mount /dev/sdb2 /mnt/my_usb
echo "/union" > /mnt/my_usb/persistence.conf
umount /dev/sdb2
reboot

Now go ahead and create a file (any file) in the root folder of your installation, setup your network, make some changes, and reboot to see if the changes are saved. If the changes stay after the reboot, congratulations! You now have a copy of Kali persistence USB.

Troubleshooting Kali Persistent Config

Although my usb drive is under /dev/sdb, yours may be /dev/sdc. To verify which partition you should be working on, run:

fdisk -l

kali persistent As you can see my 32GB drive is listed under /dev/sdb

Gparted Instructions

In terminal type:

gparted /dev/sdb

If pre-partitioned – should see:
/dev/sdb1 (kali – fat32)
/dev/sdb2

Right-click “/dev/sdb2” partition (unmount if mounted), and select delete, then run the gparted operation (reboot if necessary). In Gparted the space should now say “unallocated”. Right-click it and select “new”.

Type: primary
File system: ext4
Label: persistence

If setup correctly, Gparted screen should look similar to this:

kali persistent10GB for Kali(FAT32) & 20GB for persistence(ext4).

Select Run operation in gparted. When the operation is complete open terminal and type (same as before):

mkdir -p /mnt/my_usb
mount /dev/sdb2 /mnt/my_usb
echo "/ union" > /mnt/my_usb/persistence.conf
umount /dev/sdb2
reboot

Go ahead and try to create a document or modify some settings again, and reboot to see if it worked. If it still doesn’t work, please try again. You may have missed something the first time around. Setting up a Kali persistent USB is even easier when using a Linux distro to begin with. I hope this has made the process somewhat easier for those of you migrating over or testing out the distro for the first time.


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *