Matt Fiddles

Life's so vast, there's just so much to do...

User Tools

Site Tools


Sidebar

"Always in motion is the future."

- Yoda



Where will you go today?

"`You know,' said Arthur, `it's at times like this, when I'm trapped in a Vogon airlock with a man from Betelgeuse, and about to die from asphyxiation in deep space that I really wish I'd listened to what my mother told me when I was young.'
`Why, what did she tell you?'
`I don't know, I didn't listen.'"

- Arthur coping with certain death as best as he could.
computers:virtualization:virtualbox

Virtualbox

Boot OS off USB drive

This will show how to boot a system off a bootable usb drive, inside a VirtualBox container on your computer. It's nice when you want to test a usb drive out, and don't want to unplug, reboot, or any of that nonsense.

Warning: The following procedure could destroy all your data, eat your dog , scare your cat 8-O, reek havick in your life, destroy property, and do other terrible things. Proceed at your own risk.

You'll need to make a raw virtual disk out of your usb drive. No worries, it's two commands to just make a little file to link to the actual drive.

We'll assume your drive is /dev/sde1

Make sure you have permission to access the drive. In linux:

watch chown <your user> /dev/sde*

Use your drive path. Use watch in case the system reverts the perms back to the original.

Then make a little file to point to the usb drive.

VBoxManage internalcommands createrawvmdk -filename /path/to/usb-file.vmdk -rawdisk /dev/sde

Load the file into the virtualbox interface, attach it to an OS, and it's ready to go.

Note: As drive parameters change between boots, disk attachments, etc; you should not reuse the same vmdk file after rebooting your computer or re-attaching your usb drive. In short, it's a bid of a dangerous thing to do the above, but it's fun all the same.

To level with you, I've destroyed all the contents of a usb drive (long time ago). So be careful.

For pics see this tutorial.

For more info on accessing raw disks from VirtualBox, see the Help section of your VirtualBox application, and go to Advanced Topics » Advanced Storage Configuration.

computers/virtualization/virtualbox.txt · Last modified: Dec 2, 2015 (3 years ago) by Matt Bagley