Jump to content

HOWTO: VirtualBox USB Testing on Linux Host


Recommended Posts

VirtualBox USB Testing on Linux Host

To test your multipass usb and if you are running a Linux host and VirtualBox I found the correct commands for creating a raw image to directly access the usb stick. This has been covered for Windows host using different methods though the Linux host version has not and the information is rather scarce.

For example if you have your usb stick connected and it shows up as /dev/sdb we can run a command like this as your normal user;

VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/HardDisks/usbsdb-sony.vmdk -rawdisk /dev/sdb -register

What this does is create a raw vmdk image that when loaded in VirtualBox will allow booting directly into your usb drive.

The name of the vmdk is not important I just used usbsdb-sony to acknowledge that it's for my sony usb. The /dev/sdb (or which ever device applies to your usb) is important in this situation. You may want to make several of these (they are only 4kb) in case your device location changes when you plug the usb stick in later, for instance I have one for /dev/sdb and /dev/sdc.


When creating these raw disk images, they will be associated with the model/brand of the usb device you are creating them for. So you can not use an 8GB Sandisk Cruzer with a vmdk that you made to match a Sony flash drive. You will need to rerun the commands to create a new vmdk to match the appropriate usb stick.

VBoxManage will complain if you don't put your home .virtualbox path in the command like ~/.VirtualBox/HardDisks/usbsdb.vmdk. This is because of the -register command option on the end.

If you remove -register from the end and don't give a full path it will create the vmdk image in whatever directory you run the command in without error. So something like;

VBoxManage internalcommands createrawvmdk -filename usbsdb.vmdk -rawdisk /dev/sdb

I hope this helps save some time when testing your multi-boot sticks in Linux. I know it sure has for me.

Edited by nemesys
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...