Jump to content











Photo

Boot your USB Drive in VirtualBox


  • Please log in to reply
18 replies to this topic

#1 agni

agni

    Frequent Member

  • Tutorial Writer
  • 270 posts
  • Location:Bengaluru (Bangalore)
  •  
    India

Posted 30 July 2009 - 12:10 AM

The GUI of VirtualBox does not have an option to boot a USB drive (Physical Drive) in a virtual machine.

However you can attach a physical drive to a virtual machine using a command line tool that is bundled with Virtual Box.You can then boot your virtual machine from the attached Physical drive.

You can check the complete tutorial with screenshots here.
http://agnipulse.com...-in-virtualbox/

You can also check this
http://agnipulse.com...-your-computer/

UPDATE:
http://agnipulse.com...ve-usb-creator/
LiveLinux USB Creator (formerly uSbuntu) is a free software for Windows that allows you to create a bootable Live USB key with a Linux on it.It offers an exclusive option of automatic virtualization using portable virtual box to directly run Linux in Windows without any configuration nor installation.This tool automates the procedure given in my tutorial.

#2 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10545 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 30 July 2009 - 01:58 AM

Very interesting. It's a real pity that this option doesn't come by default in VirtualBox.

:idea:

#3 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 30 July 2009 - 09:51 AM

The idea is pointless.
The USB-Stick appears to the VM like a internal HDD.
The fact that it boots says absolutely nothing about the fact, if the USB-Stck will be bootable later.

Besides all VM have the ability to create HDD images that link to a real drive.

:idea:

#4 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 30 July 2009 - 10:33 AM

The idea is pointless.

Yes and no.

The USB-Stick appears to the VM like a internal HDD.

Sure. :P

The fact that it boots says absolutely nothing about the fact, if the USB-Stck will be bootable later.

Well, NO. B)
It says something, NOT the "whole" story.
It greatly depends on what you are looking for.
If you are trying to determine the validity of a certain partitioning scheme/CHS/LBA addressing and similar things, it is useful. :P
If you are trying to determine if the USB bus will be supported when booting it is completely unuseful. :idea:

Besides all VM have the ability to create HDD images that link to a real drive.

Really? :P
Care to give some examples, one please for each VM. :)

Or do you mean creating a HD image from a drive? :P
If the latter, this may not be a viable option in some cases. (not enough available space to store the image)


In other words:
  • is a hammer useful if you want to drive a philips screw in a piece of wood? NO. :P
  • is a hammer useful if you want to drive a philips screw in a piece of wood and you don't have a philips screwdriver? YES. :) :P

:)

jaclaz

#5 joakim

joakim

    Silver Member

  • Team Reboot
  • 912 posts
  • Location:Bergen
  •  
    Norway

Posted 30 July 2009 - 11:04 AM

Try the hitachi filter driver. Maybe you can use the gui for flashdrives then...

Joakim

#6 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 30 July 2009 - 11:09 AM

Really? :P
Care to give some examples, one please for each VM. :)

I have done so in VirtualPC and VMware myself. VirtualBox was said to work above. qEmu i don't know for sure, but think to remember that you said something like that.

:idea:

#7 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 30 July 2009 - 11:19 AM

I have done so in VirtualPC and VMware myself. VirtualBox was said to work above. qEmu i don't know for sure, but think to remember that you said something like that.

:idea:


Those are NOT examples, are reports that you did something.

I was asking about the HOW you did WHAT, (expecially the WHAT) since it is not clear to me what you exactly mean by

HDD images that link to a real drive

:P

jaclaz

#8 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 30 July 2009 - 11:49 AM

Go to the Tool of your VM to create a new VirtualDisk, then create one that links directly to a real harddrive (partition).
Now you can use the real HDD in your VM. Just as discribed above for VB.
As for examples. rtfm :P

:idea:

#9 sanbarrow

sanbarrow

    Silver Member

  • Developer
  • 788 posts
  • Location:Germany - Sauerland

Posted 30 July 2009 - 11:53 AM

Hi Jaclaz

I am aware of three types of rawdisk-descriptors.
The names are given by the parameter "createType"

"fullDevice" used by VMware
"fullDevice' used by VirtualBox
"partitionedDevice" used by VMware

the examples all describe a 4 Gb kingston USB-stick

"fullDevice" used by VMware:

# Disk DescriptorFile

version=1

encoding="windows-1252"

CID=9e497682

parentCID=ffffffff

createType="fullDevice"



# Extent description

RW 7868416 FLAT "\\.\PhysicalDrive3" 0



# The Disk Data Base 

#DDB



ddb.virtualHWVersion = "7"

ddb.uuid = "60 00 C2 91 f9 42 a4 72-10 10 ca bb ac d1 35 28"

ddb.geometry.cylinders = "489"

ddb.geometry.heads = "255"

ddb.geometry.sectors = "63"

ddb.geometry.biosCylinders = "489"

ddb.geometry.biosHeads = "255"

ddb.geometry.biosSectors = "63"

ddb.adapterType = "lsilogic"

"fullDevice' used by VirtualBox:

# Disk DescriptorFile

version=1

CID=7a174421

parentCID=ffffffff

createType="fullDevice"



# Extent description

RW 7868416 FLAT "\\.\PhysicalDrive3"



# The disk Data Base 

#DDB



ddb.virtualHWVersion = "4"

ddb.adapterType="ide"

ddb.geometry.cylinders="7805"

ddb.geometry.heads="16"

ddb.geometry.sectors="63"

ddb.uuid.image="f005cd99-df1b-4c8d-8f75-1f71f37b4d75"

ddb.uuid.parent="00000000-0000-0000-0000-000000000000"

ddb.uuid.modification="00000000-0000-0000-0000-000000000000"

ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"

"partitionedDevice" used by VMware:

# Disk DescriptorFile

version=1

encoding="windows-1252"

CID=bf09c8c4

parentCID=ffffffff

createType="partitionedDevice"



# Extent description

RW 63 FLAT "esx4-1-pt.vmdk" 0

RW 7855785 FLAT "\\.\PhysicalDrive3" 63

RW 12568 ZERO 



# The Disk Data Base 

#DDB



ddb.virtualHWVersion = "7"

ddb.uuid = "60 00 C2 9d 71 10 ee 3e-79 74 69 77 b1 97 70 df"

ddb.geometry.cylinders = "489"

ddb.geometry.heads = "255"

ddb.geometry.sectors = "63"

ddb.geometry.biosCylinders = "489"

ddb.geometry.biosHeads = "255"

ddb.geometry.biosSectors = "63"

ddb.adapterType = "lsilogic"

this type stores a copy of the first 63 sectors in an additional file named *-pt.vmdk"


In the case of the VMware - descriptors ... they can be easily redefined as IDE-disks.
Don't know if this works with virtualbox ? - never tested it.

The uuid-values can be skipped - they are not essential.

Expect problems when using rawdisks larger 950 Gb

#10 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 30 July 2009 - 12:03 PM

Go to the Tool of your VM to create a new VirtualDisk, then create one that links directly to a real harddrive (partition).
Now you can use the real HDD in your VM. Just as discribed above for VB.
As for examples. rtfm :P

:idea:


You are confusing the HOW with the WHAT.

VMware, as you report, can create a "link" or "descriptor file", as sanbarrow properly explained, to an existing (mounted) "real" drive (redirecting to \\.\PHYSICALDRIVEn).
Qemu accesses a \\.\PHYSICALDRIVEn directly:
http://www.boot-land...?showtopic=7650
Virtualbox uses a similar method to VMware.

NO HD image is created (or harmed :P ) in the process. :)

jaclaz

#11 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 30 July 2009 - 01:00 PM

So what's your point?
That you call the files 'links' or 'description files' instead of 'virtual harddisks files' like the producers of the VM and therefore they are no 'virtual harddisk files'? :idea:

:P

#12 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 30 July 2009 - 03:17 PM

The point is you calling them:

Besides all VM have the ability to create HDD images that link to a real drive.

  • A "link" is not an image.
  • A "descriptor file" is not an image.
  • A "virtual hard disk file" is not an image.

They are NOT "images", that's what was confusing me. :P

:idea:

jaclaz

#13 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 30 July 2009 - 04:21 PM

They are NOT "images", that's what was confusing me. :P

Ahh, now i get you! :idea:

:)

#14 agni

agni

    Frequent Member

  • Tutorial Writer
  • 270 posts
  • Location:Bengaluru (Bangalore)
  •  
    India

Posted 15 November 2009 - 07:40 AM

Thread UPDATED.
Added Linux Live USB which uses portable virtualbox .

#15 agni

agni

    Frequent Member

  • Tutorial Writer
  • 270 posts
  • Location:Bengaluru (Bangalore)
  •  
    India

Posted 20 January 2011 - 04:46 PM

Updated tutorial to work with Virtualbox 4.
http://agnipulse.com...-in-virtualbox/
The new vboxmanage command no longer supports the register switch.So you have to manually add the vmdk file to your virtual machine.

#16 Thibaut

Thibaut

    Member

  • Developer
  • 32 posts
  •  
    France

Posted 20 January 2011 - 05:17 PM

I may have a good news for you. For LinuxLive USB Creator, I created a launcher for VirtualBox which automatically virtualizes the hard drive (or USB key) it is run from.

My launcher is a derivative work of Portable VirtualBox ( http://vbox.me) and can either runs in Portable Mode or in regular mode if you already have VirtualBox installed on your machine.

You can download it from :
  • Here for VirtualBox 3.X
  • Here for VirtualBox 4.X
You just have to unzip it to the hard drive you want to Virtualize then run VirtualBox.exe for full interface or Virtualize_this_key.exe to directly run the VM.

/!\ DO NOT USE THIS ON YOUR SYSTEM HARD DRIVE IT MAY CORRUPT IT /!\



How it works


It automatically creates the VMDK file for your hard drive (or USB key). I'm talking about a raw device mapping here, not a clone image.


Launcher then checks if you already have VirtualBox :


  • if you do have it, then it runs the regular VirtualBox (no changes are made to your VirtualBox config since it's another one that is loaded)
  • if you don't have it, then it runs Portable-VirtualBox
Now you can show Linux (or any other OS) to your friends directly on their computers.


Technical details


I'm using VBOX_USER_HOME environment variable in order to start VirtualBox with another configuration.


To create a Raw Device Mapping, i'm using WMI, which may not work on Windows Home editions (needs confirmation).


Portable version may not have all the features working.


Call to developpers


I'm looking for Mac developpers to make a Mac launcher (no portable mode though) that would do the same thing but on Mac.

This is not a big and complex project. I already have the base code but I need someone to make it really works.

Contact me if you are interested.

====================================================================



I hope that you will like it.


PS: I knew i would fit right in this forum Posted Image

#17 Mikorist

Mikorist

    ▂ ▃ █ ▅ ▆

  • Advanced user
  • 771 posts
  •  
    United Nations

Posted 06 August 2011 - 09:56 AM

My launcher is a derivative work of Portable VirtualBox ( http://vbox.me) and can either runs in Portable Mode or in regular mode if you already have VirtualBox installed on your machine.


I like Portable VirtualBox very much. :ph34r:

is there a possibility for

java Portable-VirtualBox ? :cheers:

#18 Thibaut

Thibaut

    Member

  • Developer
  • 32 posts
  •  
    France

Posted 06 August 2011 - 10:03 AM

Posted Image

Java Portable-VirtualBox ? Lol I think you are dreaming. Performances would be awful.

#19 Mikorist

Mikorist

    ▂ ▃ █ ▅ ▆

  • Advanced user
  • 771 posts
  •  
    United Nations

Posted 06 August 2011 - 10:08 AM

Posted Image

Java Portable-VirtualBox ? Lol I think you are dreaming. Performances would be awful.


is true that I dream.

I dreaming also - VirtualBox operating system :ph34r:

like Chrome OS

VirtualBox cloud


lightweight, speedy, secure, virtual-centric computing! :cheers:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users