You are here Home » Tech » How To's » How to Boot a Virtual Machine from USB in VirtualBox (Guide)

How to Boot a Virtual Machine from USB in VirtualBox (Guide)

by Fahad Saleem

How to Boot a Virtual Machine from USB in VirtualBox (Guide)

Most of the desktop virtualization software don’t support installing a guest operating system on VirtualBox as a built-in feature yet. You may sometimes require booting a virtual machine from USB to perform this action, but you are limited by the functionality of desktop virtualization software. Even the famous VMware and VirtualBox don’t provide this functionality. This article shows how to boot a virtual machine from USB on VirtualBox with MAC OS X host, Mavericks OS and Mac Pro laptop.

virtual machine 1

For this purpose, we first need to make a VMDK file based on the attached portable flash drive and then mount the VMDK as virtual machine’s first bootable disk and then boot it. The steps to follow are presented below.

Steps to Boot a Virtual Machine in VirtualBox from USB with MAC OS X host

  • You need to attach the bootable USB disk and then locate the disk path. It will be used in commands of the MAC OS X terminal. Launch Terminal and type “mount” there.

virtual machine 2

It will display the USB disk path. Note it down since we will be using it later on.

  • Now go to the disk utility using path Go->Utilities->Disk Utility and then unmount the partition of USB disk. The next command will not function without unmounting the USB disk partition. You need to right-click on the USB partition and then select ‘Unmount USB name’.

virtual machine 3

  • Now, type the following command in terminal in order to create VMDK file of the USB disk.

“sudo VBoxManage internalcommands createrawvmdk -filename /Users/Dinesh/Documents/myusbdrive.vmdk -rawdisk /dev/disk2s2”

 

virtual machine 4

  • The required VMDK file will be located in /Users/Dinesh/Documents/myusbdrive.vmdk.
  • /dev/disk2s2 is the USB drive path that was obtained from the mount command earlier. Now, provide the password of super user to accomplish the task.
  • Now the VMDK file has been successfully created. Unfortunately, if you attach the file to VirtualBox and then try to boot, it will show some access denied errors. You need to modify some permissions also.
  • Since you will be using VirtualBox as normal user, but VMDK is created with a super user. Hence, you need to give read and write access to all users for a particular VMDK file. Use the following command in order to change permissions of VMDK file.

sudo chmod 777 /Users/Dinesh/Documents/myusbdrive.vmdk

  • Still, you will receive an access denied error. The permissions for USB disk also need to be modified.

sudo chmod 777 /dev/disk2s2”

  • Now, the VMDK file is ready to connect and then boot virtual machine from USB in VirtualBox on MAC OS X host. Go to storage and choose the controller. Add hard disk. Select “choose existing” and search for VMDK file that was created in earlier steps.

virtual machine 5

  • Modify the hard disk SATA port number to make it the first hard disk for the virtual machine so it will boot from it.

 

In this manner, your desired Virtual Machine will boot from USB on VirtualBox with MAC OS X Mavericks host.

 

 

You may also like