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
- The entire physical disk attached to host computer. Eg: USB thumb drive and computer hard disk.
- 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
- VirtualBox, the free virtual machine software. Click Here To Download.
Before The Procedures
- You need to install and setup virtual machine in your computer. Click here for the guide.
Please close the virtual machine first after you finish install and setup it.
- 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
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
Now you will notice that USB thumb drive is represented as Disk 1 or in other means, its disk number is 1.
This information (eg: Disk 1) will be used when you create the VMDK file for USB thumb drive using VirtualBox Manager (VBoxManage).
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
- Click --> type cmd –-> when the cmd program appears, right click on it –-> when the context menu appears click Run as administrator
- Click Yes –-> the cmd program with administrator privileges will appears like below
- On the cmd program interface, type cd \ –-> press to access the root drive of host computer, eg: C:\ drive
- From here you must access the folder that contains VirtualBox Manager. Type cd program files\oracle\virtualbox –-> press .
- 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 .
--> 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).
- Now you will notice special VMDK image file named, usbdrive.vmdk has been saved in drive C:\
- 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.
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
- Right click VirtualBox icon on your desktop –-> click Run as administrator –-> click Yes to run the virtual machine using administrator privilege.
- When VirtualBox manager’s interface appears, click Storage –-> the Settings’ box will pop-up on your screen
- Click --> the Question’s box will displayed –-> click
- In this step, you need to choose and click the special VMDK file that you had created in the previous section (The Procedures) –-> click
- 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
- 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.
- 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