Access disk image via loop device
(Found here: http://blog.mybox.ro/2010/11/03/how-to-use-a-raw-disk-image-file-in-virtualbox/)
Step 1: Associate the disk image with a loop device.
$ losetup /dev/loop0 /path/to/usb.img
Step 2: Create a virtual disk and register it with VirtualBox.
$ VBoxManage internalcommands createrawvmdk -filename /path/to/usb.vmdk -rawdisk /dev/loop0
Step 3: Attach the virtual disk to a virtual machine and start it. The virtual machine will access the virtual disk, which now is linked to /dev/loop0, which in turn is linked to the disk image file.
Warning: In order for this to work, VirtualBox needs to be able to access the loop device you created. This means either adding your user to a group that has access to disks (on my Ubuntu machine, this is group “disk”), or you need to run VirtualBox as root. Since I’m messing with disks a lot, I used the first option (that’s why my commands start with $ not #), but I think running just VirtualBox as root is the safer/better solution for most users.