Installing Kali on a USB drive - NOT Live USB or Persistence partition

55,823

Solution 1

Install Kali into a VirtualBox VM with the USB attached as the first hard drive.

You can attach the USB to VirtualBox following this guide: Using a Physical Hard Drive with a VirtualBox VM

I have done this with Ubuntu 14.04 and it works quite well. The installation is bootable on most systems.

Addendum:

I'm going to elaborate, because I think this is a much overlooked solution...

I was asking myself this question over a year ago. I began with the persistence partition. To me, it felt like a convoluted, unnecessary hoop-jumping exercise to have the appearance of a system on a stick.

By installing directly to the USB stick through virtualbox, you won't have to partition a specific amount of space for the persistence volume; you are creating a fully bootable stick with full read and write access everywhere, as if the stick were a normal ssd drive.

Solution 2

@TiberiusKirk Many thanks for the idea it worked as it should.

For the record here is what worked for me on a Windows 10 machine:

  1. Connect the Pendrive delete the partition using windows disk manager (or whatever tool) .

  2. Create the Disk metafile:

    VBoxManage internalcommands createrawvmdk -filename "C:\Users\sysadmin\Documents\sysadmin\kaliboot\kaliboot.vmdk" -rawdisk \\.\PhysicalDrive1
    
  3. Attach Disk as SATA:

    VBoxManage storageattach kaliboot --storagectl "SATA" --port 0 --device 0 --type hdd --medium C:\Users\sysadmin\Documents\sysadmin\kaliboot\kaliboot.vmdk
    

Note: In this example the name of the VM created in VirtualBox is "kaliboot".

Share:
55,823

Related videos on Youtube

Parth Maniar
Author by

Parth Maniar

Updated on September 18, 2022

Comments

  • Parth Maniar
    Parth Maniar over 1 year

    Greeting's, to clarify; my question is not creating a Live USB drive or a persistence partition but creating a USB with GRUB bootloader (or other) and Kali which can be used on any machine. This is similar to running other linux OS directly from USB. I am currently running Ubuntu from a pen drive. I installed the OS (Ubuntu) and the bootloader on the pen drive and I can boot off it anywhere. Here is a video explaining the same (video is not by me: https://www.youtube.com/watch?v=fLYBXOVn6ow)

    Since, Kali's installer doesn't give option to select which drive to write the booloader to and directly writes on the HDD (sda1). This means even if I partition and install Kali on a pen drive since the bootloader will be installed on the machines fixed primary drive, the USB drive will fail to boot on a different device.

    I have two questions:

    1. Anyone has any idea how to write bootloader to a USB drive and what parameters should be given so that it boots with Kali installed on it.

    2. I am using graphic install mode for installing Kali on the USB drive, however there is no option for the install to be encrypted (Full disk encryption or at least /home folder to be encrypted). Does anyone know how can I install Kali with full disk / home folder encryption? Or enable is post install?

    Thank You!

  • Parth Maniar
    Parth Maniar about 8 years
    Reading elsewhere, I figured persistence to be a different partition for /home or other user directory. While I have not tried it, I thought updated software may revert to ISO version on reboot. I will give this a try and report back. Thank you!
  • Nilpo
    Nilpo about 6 years
    They don't want persistence.
  • flumpb
    flumpb about 6 years
    You can't easily upgrade the kernel with persistence.
  • ash
    ash over 3 years
    You could create the persistence partition to be the back half of the drive. When you write a new ISO to it, it blows away the partition table, not the partition. Just recreate the partition in the same space, you should be able to mount it without formatting it. Leave enough space between the ISO and the persistence partition so if the ISO grows it won't overwrite anything.