How to Live Boot Kali Linux
Tags: linux, ubuntu, tutorial, watercooler
Published: 2020-12-17 15:14:54

We all find it difficult to use virtual machines or dual-booting Kali Linux just for testing purposes. In my case, I'm already dual booting and don't want to mess around with virtual machines and I have the perfect solution for it- **Live Booting**. Before we begin, let's talk about live booting.

**What is live booting?**

The concept of live booting is quite simple. You can install a live distro on your USB and boot from it without making any changes to your hard disk. Each time you boot from this live USB it will be a fresh distro with no data from previous use. But if you want to save your data then with a little bit of work you can add persistence which will act as storage.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yumjjfm5ajoo0oj8fu89.png)

**Requirements for live booting:**
* A USB stick with a minimum of 8GB of memory
* Stable internet connection

**Advantages of dual-booting:**
* It makes no changes to the hard drive or installed OS, and to go back to normal operations, you simply remove the USB and restart the system.
* You can use all your system resources
* You can take your OS to any PC you use.
* You can either choose to start fresh after restarting or continue previous work by adding persistence.

**Let's start live booting**

We already talked about live booting and its advantages. Without wasting any more time let's start doing :

* **Downloading Kali live image** - The first step is to download the distro. We need the [Kali Linux(live)](https://cdimage.kali.org/kali-2020.4/kali-linux-2020.4-live-amd64.iso) to flash our USB.

* **Flashing our USB stick** - Next we need to flash this USB stick with our kali live image. To do this, you need a tool called [balenaEtcher](https://www.balena.io/etcher/). Download this for the respective operating system you are using now.
> if you are using Linux, extract the downloaded file.

    * Now open Etcher and select flash from file and choose            our downloaded kali live .iso file
    * Click on select target and choose your USB stick 
    * Click on Flash.
After waiting for some time the flashing process will finish and you are ready to go.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/l7g849a1qo67sq19usyc.png)

* **Setting up persistence** - If you don't want Kali to save any data and start fresh every time you restart, then this step is not needed. In this method, we are creating a partition called persistence which will act as a hard drive to store data.

This step is divided into two parts for Windows and Linux. For Windows, you need [miniTool partition wizard](https://www.partitionwizard.com/free-partition-manager.html). Let's begin:

* Persistence for Windows - We are using minitool partition wizard for this step.
 * Launch the application, right-click on your application and click on **Move/Resize**.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bgequlf1or3jxz31cik7.jpg)

  * Use the small black arrow keys to shrink the partition size and click **OK**. A large new grey chunk of unallocated space appears This is the size of your persistence. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/l8wufwaf6hs0isfxslw2.jpg)

  * Right-click on the unallocated space and click on create. Now create the partition as **primary**, File system: **Ext4** and label: **persistence**. Now click **OK** and click on **Apply** in the top left corner. It will take some time to finish.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qyk0p6ttda9pumr641nk.jpg)

* Persistence for Linux - We don't have any tools for this step. You can use **disk** which comes with the distro. You can also use GParted if you want.
 * Open the disk tool and select your USB disk. You can see there is a partition called free space. Select the free space and click on the **+** button.
 * Now click on next and name the partition as **persistence** and type: **Ext4**. Now click on create and wait for it to finish.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/49tpq7uqxsf8gwkjg5ar.png)

We have successfully created the partition and we are ready to move on.

* **Configuring the Partition** - We are at the final step now. Once the partition manager is finished, reboot your computer and boot it up from your USB drive. Choose the option "Live USB Persistence" and wait for the distro to boot up.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zdd8mzfa3r5655yuhiqi.png)

Now open the terminal and type in the following:
     * `mkdir -p /mnt/my_usb` - making a file system to mount
     * `mount /dev/sdb2 /mnt/my_usb`- mounting the filesystem
     * `echo "/ union" > /mnt/my_usb/persistence.conf` - adding the configuration file.
     * `umount /dev/sdb2 && reboot` - unmounting and restarting
Success!! We have added persistence and if you make any changes and restart you can still see the changes. You are now able to save stuff everywhere on your Linux filesystem, and every configuration you make locally will be available everywhere you plug it in 

**Conclusion** - I hope this blog helped someone out there. I would recommend this for someone who is trying a new distro or for someone who is learning. If you find any difficulties or have any suggestions please mention them in the comment section. Hope you enjoyed the blog.