Boot from USB with VirtualBox on Mac

VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL) version 2.


  1. Mac OSx (Tested in Yosemite & El Capitan)
  2. Virtual Box:
  3. Virtual Box Extension Pack – The Extension Pack basically enables the USB 2.0 & 3.0 ports, with lots of other features.

I assume, you have already installed Yosemite, VirtualBox, and the VirtualBox Extension Pack as well. Follow the below steps for USB Boot with VirtualBox:


1) On your OSx, open a Terminal Window and List all your device and identify your USB drive:

$ diskutil list

/dev/disk0 (internal, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *500.3 GB   disk0

   1:                        EFI EFI                     209.7 MB   disk0s1

   2:          Apple_CoreStorage OSx                     499.4 GB   disk0s2

   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

/dev/disk1 (internal, virtual):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:                  Apple_HFS OSx                    +499.0 GB   disk1

                                 Logical Volume on disk0s2



/dev/disk2 (disk image):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        +99.6 MB    disk2

   1:                  Apple_HFS VirtualBox              99.6 MB    disk2s1

/dev/disk3 (external, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:     FDisk_partition_scheme                        *128.0 GB   disk3

   1:               Windows_NTFS IRONKEY                 128.0 GB   disk3s1

You will see a list like the above. According to the above list, My USB is /dev/disk3 (Windows_NTFS IRONKEY).

  1. Lets unmount the disk now:
$ diskutil unmountDisk /dev/disk3

Unmount of all volumes on disk3 was successful

3)  VirtualBox process can only read/write files owned by the current user you are logged with. Mac OS X puts root as owner. With this default, you won’t be able to import the disk file that we are going to create. So the solution is too change the permission of the device:

$ sudo chown user /dev/disk3

$ ls -l /dev/disk3

brw-r—–  1 user  operator    1,   7 Jul  10 19:11 /dev/disk3

Keep in mind to change the “user” to your username

4) Now create a disk file:

$ VBoxManage internalcommands createrawvmdk -filename ~/Documents/usbdrive.vmdk -rawdisk /dev/disk3
RAW host disk access VMDK file ~/Documents/usbdrive.vmdk created successfully.

5) Now add this vmdk file to your Virtual Media Manager (⌘D) or add as an “Use existing hard drive” to your Virtual Machine.

In case you get an Error while adding this drive like shown below:

VirtualBox Error

Just unmount the disk again. The disk could have mounted back to the OS.

$ diskutil unmountDisk /dev/disk3

Unmount of all volumes on disk3 was successful

Thats all for this!


Homebrew installs the stuff you need that Apple didn’t. Its just like a package manager, but for the Mac. Its pretty easy to install brew on your OSx.

The easy way to install is in this website:

You can install it by the following command in your terminal:

You will need xcode-tools as well. While installing, the script will ask you before installing the same. Once installed, you can update brew by issuing the following command:

$ brew update

Homebrew’s current maintainers are Misty De MeoAdam VandenbergJack NagelMike McQuaidand Brett Koonce.

Homebrew was originally created by Max Howell.

Brew help can be obtained from their wiki.

You can try your first command:

$ brew install wget


Comparing 2 (two) folders using Terminal

$ diff -rq folder1 folder2
Only in /Users/user/folder1/:
Only in /Users/user/folder1/: AAA.pdf
Only in /Users/user/folder2/: new mail.eml
Only in /Users/user/folder1/: P.docx
Only in /Users/user/folder2/: COMPANY.doc
Only in /Users/user/folder1/: icons.png
Only in /Users/user/folder1/: New Document.pdf

If you want to compare two different directories, to see which files may differ between the two, or, which files are missing from either one of them; there are many ways or tools that can do this job. However, we will do this using a simple command line version that will do the trick quick and easy.

Not always or everytime or everyday we will be doing such kind of comparing; but if this is your job, go pick/buy a tool.
For once a while operation, we can just do a dirty trick and get done with it.

What is it?

Launch the Terminal (Mac: From spotlight, type terminal and hit enter)

$ diff -rq /path/to/folder1 /path/to/folder2

This will compare between the 2 folders and give you results of which files differ from each other, or which files are there only in either of the folder.

The Switches:
-r -> Does a recursive search. If you do not want it to do recursive search, simply ignore the -r switch.
-q -> brief mode. When you tell diff to use the -q switch, diff will not give you a detailed output such as actual line-by-line differences for any text files that exist in both locations and that are not identical. Since we are more interested to know only what is there and not there between the folders, the -q switch is optimum.