top of page

Booting Persistence Kali on VirtualBox & VMware

Hey all y'all! I had this thought of creating a live USB persistent Kali for a very long time, and I finally started working on it. It was fun playing around with it, so I thought, why should I document this process? Well, here you go!


Download & make USB Bootable


To download the Kali Live image, let's head over to the Kali.org website. We will see this beautiful UI of the website. Let's click on the DOWNLOAD button,

ree

We will be taken to the get-kali, where we need to select the desired image for our purpose today. I am interested in Live Boot image,

ree

The website will take us to the area where we can see the 3 types of images that are available to download. Let's quickly download the Kali 2022.3 (middle one),

ree

Next, to make our USB bootable, we need to download the Rufus software. We will then run the Rufus software, select our USB in Device, select the ISO (downloaded Kali image), move the slider to max out the persistent partition size (Rufus creates persistent storage) as mine is 3, yours can vary!

ree

Clicking on the START button will first show us that it needs to download the additional ldlinux.sys, and ldlinux.bss files. Go ahead by clicking on Yes,

ree

Then it will prompt us to warn us for erasing all the data on the USB. Do it!

ree

From here, we can:


  1. Inject our USB in our system.

  2. Press Win KeyPowerShift + Restart.

  3. Select our USB to boot Kali from it.


....or we can go ahead to live boot the Kali in VirtualBox & VMware. Let's look how we can do it.


On VirtualBox


Now that our device is ready for live boot, we juustttt need to check, and set a few things to boot our Kali in VirtualBox. To start, open the Command Prompt as Administrator.


For that, press Win + R → type cmd → Press CTRL + Shift + Enter. Then, we need to navigate to "C:\Program Files\Oracle\VirtualBox". To find out how many drives/disks we currently have, issue diskpart command. Microsoft says,


The diskpart command interpreter helps you manage your computer's drives (disks, partitions, volumes, or virtual hard disks).

After issuing diskpart command, we will enter into the diskpart command interpreter, and we need to list all the drives. For that, issue list disk command. We have 3 Disks available, namely Disk 0, Disk 1, Disk 2 (which is my USB device),

ree

After determining the physical disk, we need to actually issue this command to create a raw VMDK file on the base of device the C drive that will boot with our PhysicalDrive2 (USB Drive),


VBoxManage internalcommands createrawvmdk -filename C:\usb.vmdk -rawdisk \\.\PhysicalDrive2
ree

Next, we need to start VirtualBox as Administrator,

ree

Let's start by clicking on New button. Enter the name of the machine,

ree

Provide memory size,

ree

Then select the 3rd option, and provide the path to the raw VMDK file we created,

ree

This will create our VM. Now, some quick twitch in the settings – Increase the processor(s) to 2,

ree

Click on the Controller: SATA. Then check mark the Use Host I/O Cache (else live booting will have problems or might not be able to boot up),

ree

Click on USB Plus Green button to add the USB device,

ree

Finally! Everything is done. Start the machine, choose Live USB Persistence, and wait for the Kali to boot up!

ree

After sometime, we can see the Kali interface (looks dazzling, isn't it?),

ree

Checking if the internet is working correctly,

ree

Now, to test the persistency of this Kali machine, we need to create a file named test with some text in it, This text is created by Hellfire0x01.,

ree

Then, we will shut down the machine using shutdown now command, boot it up again, and we will see the file persists even after the reboot,

ree

On VMware


Let's follow the same on VMware as well! Let's start the VMware as Administrator,

ree

Then, we need to create a new VM,

ree

Now, we need to select how we wanna create the VM,

ree

Now, we will go with 3rd option,

ree

Select Linux as a Guest OS,

ree

Naming the VM,

ree

Specify the Disk Capacity,

ree

Finally, click on Finish to create one!

ree

On the dashboard, we can see our machine is successfully created,

ree

Let's twitch some settings real quick! Let's click on Add... button,

ree

Now, let's quickly add the Hard Disk,

ree

Select what's recommended to you, mine is SCSI

ree

Then select 3rd option to Use a physical disk (because we need to boot from a USB drive),

ree

Let's select the PhysicalDrive2 (USB drive), and use the entire disk,

ree

Name the VMDK file whatever you want,

ree

Next, we need to disable the side channel mitigations for Hyper-v enabled hosts, and firmware type to UEFI,

ree

Click on Finish! Click on Ok!

ree

Now we can finally start the machine, and go with the USB persistence mechanism!

ree

So, it was fun for me playing around with this thing. While I was in the midst, I was so frustrated because this was throwing me the errors that I was not able to figure out. But in the end, I was persistent, and made this job done. I hope you learned something from this blog. Well then, take care. Until next time.

Comments


bottom of page