Setup Virtual Machine To Boot From USB Thumb Drive

Wednesday, August 15, 2012

An ability to boot from USB thumb drive had become the good alternative to the users who have the malfunction CD/DVD ROM drive inside their computer. If they cannot perform OS installation using CD or DVD, they can use USB thumb drive as an alternative OS installer to boot the computer. 

But, it is slightly different way when you want to boot from the USB thumb drive inside virtual machine. You need to perform certain setup on your virtual machine before it has ability to boot from the USB thumb drive.




The Basic Idea – How Virtual Machine Boot From USB Thumb Drive?

When using VirtualBox as a virtual machine, you can setup it to allow direct access (use) to the physical resources inside host computer (the real computer owned by users). This process is called raw hard disk access. The process can be done by creating the special VMDK image file that represent those physical resources.

The physical resources of host computer can be divided into TWO following categories

  1. The entire physical disk attached to host computer. Eg: USB thumb drive and computer hard disk.

  2. The partition of physical disk attached to the host computer.

You need to be careful when allow direct access to the entire physical hard disk or its  partition. This is because the host OS usually run from the physical hard disk especially inside its primary partition.

So, when you allow direct access to the computer hard disk from virtual  machine, PLEASE DO NOT ACCESS THE PRIMARY PARTITION WHERE THE HOST OS CURRENTLY RUNNING (usually C:\ drive) or you will encounter the severe data damage and loss.



For our case today, WE WILL SETUP THE SPECIAL VMDK IMAGE FILE THAT REPRESENT THE USB THUMB DRIVE ATTACHED TO THE USB PORT OF HOST COMPUTER. This is the method which you will use in order to SETUP VIRTUAL MACHINE TO BOOT FROM USB THUMB DRIVE. 



 
What You Need

  1. VirtualBox, the free virtual machine software. Click Here To Download.




Before The Procedures

  1. You need to install and setup virtual machine in your computer. Click here for the guide.

    Note:
    Please close the virtual machine first after you finish install and setup it.


  2. You must attach the USB thumb drive into the USB port of host computer in order to check the disk number which represent it. To check the disk number, you can do the following.

    On your Windows 7 desktop, right click icon Computer –-> click Manage in order to launch the Computer Management utility

    Capture

    Inside the Computer Management utility click Disk Management –-> you will be presented with the graphical disk indicator at the center pane of Computer Management interface. See below

    Capture

    Now you will notice that USB thumb drive is represented as Disk 1 or in other means, its disk number is 1.

    Capture

    Note:
    This information (eg: Disk 1) will be used when you create the VMDK file for USB thumb drive using VirtualBox Manager (VBoxManage).




The Procedures

In this section, we will learn how to use the VirtualBox Manager (VBoxManage) in order to create the special VMDK file. This file is the virtual disk image that represent the USB thumb drive which had been attached to the USB port of host computer. We will use the VirtualBox Manager from the host computer

  1. Click Capture --> type cmd –-> when the cmd program appears, right click on it –-> when the context menu appears click Run as administrator

    Capture


  2. Click Yes –-> the cmd program with administrator privileges will appears like below

    Capture


  3. On the cmd program interface, type cd \ –-> press Enter button to access the root drive of host computer, eg: C:\ drive

    Capture


  4. From here you must access the folder that contains VirtualBox Manager. Type cd program files\oracle\virtualbox –-> press Enter button.

    Capture


  5. At this step, you can start using the VirtualBox Manager (VBoxManage) to create the special VMDK image file. For the purpose of that type the following command

    vboxmanage internalcommands createrawvmdk –filename c:\usbdrive.vmdk    –rawdisk   \\.\PhysicalDrive1 –-> press Enter button.

    Capture

    Note:

    -->  vboxmanage internalcommands createrawvmdk : This is the command used to create special VMDK image file.

    -->   -filename c:\usbdrive.vmdk  :  The name of special VMDK image file you have created including the path where you saved the file.

    -->   -rawdisk \\.\PhysicalDrive1  :  This raw disk represent USB thumb drive because the disk number for physical drive is 1. You got this number when perform the step 2 in the previous section (Before The Procedures).
     

  6. Now you will notice special VMDK image file named, usbdrive.vmdk has been saved in drive C:\

    Capture


  7. This step is optional but I think it is good to be done. You can move the usbdrive.vmdk file from C:\ drive into the folder which contains vmdk file you created during setup process of virtual machine.

    Capture




After The Procedures

When you reach this section, it means you now owned the special VMDK file (eg: usbdrive.vmdk). This section will guide you how to add this file as the virtual disk storage inside virtual machine.

It is VERY IMPORTANT to advice that you MUST ATTACH THE USB THUMB DRIVE INTO THE COMPUTER USB PORT before you start to perform the steps below

  1. Right click VirtualBox icon on your desktop –-> click Run as administrator –-> click Yes to run the virtual machine using administrator privilege.


  2. When VirtualBox manager’s interface appears, click Storage –-> the Settings’ box will pop-up on your screen

    Capture


  3. Click Capture --> the Question’s box will displayed –-> click Capture

    Capture


  4. In this step, you need to choose and click the special VMDK file that you had created in the previous section (The Procedures) –-> click Capture

    Capture


  5. Now, you will see the special VMDK file had been added to the virtual machine as a virtual hard disk. You can notice it has been assigned as an IDE primary master –-> click Capture

    Capture


  6. Now, you need to assign the boot order and a hard disk will be placed on the first order. So, click System –-> the Settings’ box will appear.

    Capture


  7. Inside the section boot order, click Hard Disk –-> click the upper arrow until Hard Disk is place at the top of boot order’s list –-> click Capture

    Capture  

           
                  

               




      

2 comments:

{ Belajar Komputer } at: September 5, 2012 at 4:25 PM said...

thanks for you share this tutorial friend, drop here to support you

Anonymous at: September 24, 2012 at 8:14 PM said...

this is an excellent guide..very well writtten and illustrated..makes it easy for all types of users to understand concisely..thank you

Post a Comment

Related Posts Plugin for WordPress, Blogger...