DEV Community

loading...
Cover image for How to Live Boot Kali Linux

How to Live Boot Kali Linux

ShahinSha
Student|Full stack Web Developer|Python Expert.Loves talking about programming. Believes in open Source
・4 min read

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

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) 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. 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

  • 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. 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

  • 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

  • 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

  • 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

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

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.

Discussion (2)

Collapse
josealz profile image
JoseAlz

Excelente!

Collapse
shahinsha profile image
ShahinSha Author

Thank you.