Installing Kali Linux on USB with VirtualBox

I like to play with VirtualBox. So in this post I will show you how to install Kali Linux on a USB disk with VirtualBox which can be run both on VirtualBox and directly bootable.

kali-linux-sticker

Every change you made with VirtualBox (or direct access) will be stored on USB and can be accessed with Direct Access (or VirtualBox). It is awesome to use VirtualBox when you want to work beside another OS. And also awesome when you want to boot directly from Physical Computer.

The steps are very easy:

  1. Create a virtual hard drive pointing to the USB.
  2. Install Kali in VirtualBox as usual.
  3. The disk is ready!

 

Requirements

First of all you should download Kali Linux ISO from here. Next download and install VirtualBox from here.

Here you go. It is ready to fire!

 

Create a virtual hard drive

Here we are going to create a virtual disk (VMDK) that points to a physical drive. All the data is written in the physical drive and VirtualBox can directly access it.

  1. Create a terminal (or command prompt) with administrative privileges.
  2. Go to VirtualBox installation Directory
    1. If you are on Linux or MAC it is not necessary, but if you’re running Windows, you should do this step: C:\Program Files\Oracle\VirtualBox
  3. Attach your USB and find its physical driver number.
    1. On windows goto Disk Management and find the Disk Number (As an example Disk1 refers to your USB, so the number is 1)
  4. Create Virtual Drive with the following command:
    1. For Windows
      VBoxManage internalcommands createrawvmdk -filename "C:\Users\<user_name>\VirtualBox VMs\<VM_folder_name>\<file_name>.vmdk" -rawdisk \\.\PhysicalDrive#
    2. For Linux:
      VBoxManage internalcommands createrawvmdk -filename "</path/to/file>.vmdk" -rawdisk /dev/sda
    3. For Mac OS X:
      VBoxManage internalcommands createrawvmdk -filename "</path/to/file>.vmdk" -rawdisk /dev/disk#<span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span>

# sign is the disk number. Step 4 credits go to this link.

 

Install Kali in VirtualBox

This step is easy. You should start VirtualBox with administrative privileges. The only point is that attach created virtual disk to the new virtual machine as below:

choose-virtualdisk

Then start the virtual machine. It will ask to attach Kali ISO.

After attaching Kali ISO image, every thing is the default installation of Kali. Here are some screen shots from my installation:

installing-kali-1 installing-kali-3 installing-kali-4 installing-kali-5 installing-kali-6

That’s it. You may like to boot with real computer or with your VirtualBox.

2 Comments, RSS

  1. axel July 12, 2018 @ 18:38

    Sir i tried but it showed error..
    here:
    Failed to open the disk image file C:\extdi2sk.vmdk.

    Permission problem accessing the file for the medium ‘C:\extdi2sk.vmdk’ (VERR_ACCESS_DENIED).

    Result Code: VBOX_E_FILE_ERROR (0x80BB0004)
    Component: MediumWrap
    Interface: IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}
    Callee: IVirtualBox {9570b9d5-f1a1-448a-10c5-e12f5285adad}
    Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

    • Mir Saman July 22, 2018 @ 18:30

      It seems that You are trying to access C:\extdi2sk.vmdk which is a restricted location for normal apps. And you should run VBoxManage in administrative mode for accessing USB drive. Therefore, I suggest you to start cmd in administrative mode. If you do not know how to do it, please refer to this link.
      I think this will solve your problem.

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

*

WP to LinkedIn Auto Publish Powered By : XYZScripts.com