Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

With which virtualization solution can I boot an Ubuntu install in an USB?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

VirtualBox can do it.

It doesnt allow you to directly boot from USB, but it does allow you to attach a physical device to a virtual drive.

So the trick is to create a virtual drive pointing to your USB stick, and then adding that drive to the vistual machine.

Step 1 - Find your USB key ID

  • Right Click on My Computer > Manage > Disk Management
  • Find your USB. Disk 1 means the ID is \\.\PhysicalDrive1.
  • Numbering starts from 0 (your first HDD), so USB stick will be 1, 2 or even 3.

Step 2 - Create the Virtual Drive

  • In terminal ( menu > cmd ), issue the following command:

    VBoxManage internalcommands createrawvmdk -filename "%USERPROFILE%\usb.vmdk" -rawdisk \\.\PhysicalDrive1
    
  • Im assuming your USB is PhysicalDrive1

  • The drive will be created in C:\Users\youruser\usb.vmdk

Step 3 - Add the drive to the virtual machine

  • Just use Virtualbox's GUI
  • Select the Virtual Machine > Settings > Storage > Add Attachment > Choose existing Disk
  • Browse for the newly created usb.vmdk

More details can be found in this amazing article

share|improve this answer
    
Do mention the command to change the directory first, else readers will not know why the command doesn't work until the source article is read. –  Oxwivi Jun 8 '11 at 15:20
    
Sorry, AskUbuntu ommited the first "\" in "\\.\PhysicalDrive1". I guess i need to fiddle with formatting so it displays right. But, AFAIK, theres no directory change necessary. –  MestreLion Jun 8 '11 at 15:27
    
It is necessary, I asked the same in the Ubuntu Forums and was told to do the same with VBoxManage. but it did not work. I can see why /bin directory is there in Linux/Unix now. –  Oxwivi Jun 9 '11 at 3:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.