Page 1 of 1

Testing a Bootable OS Installation USB

Posted: 21. Jun 2011, 18:30
by ElSid
Searched the forums and all I found were discussions about "running" an OS off of the USB drive.
What I am looking to do is TEST a bootable OS installation USB. I have my Windows 7 Install disk and I created a bootable USB flash drive with the contents of the install disc on it. I want to test the bootable OS installation USB on VM before installing on my new netbook. Did I miss it in the tutorials?

Re: Testing a Bootable OS Installation USB

Posted: 21. Jun 2011, 18:38
by Perryg
VirtualBox does not support USB booting.

Re: Testing a Bootable OS Installation USB

Posted: 22. Jun 2011, 17:34
by ElSid
What about this
http://blogs.oracle.com/shashank/entry/ ... t_from_usb
I found the link on one of the posts in this forum. Where are the "floppy" settings in 4.0.8?

Re: Testing a Bootable OS Installation USB

Posted: 22. Jun 2011, 18:02
by mpack
ElSid wrote:What about this
http://blogs.oracle.com/shashank/entry/ ... t_from_usb
I found the link on one of the posts in this forum. Where are the "floppy" settings in 4.0.8?
The floppy settings are under the "Storage" section. You may need to add a floppy controller.

Anyway I just tried what that blogger suggests, and it doesn't work for me (XP host and guest). In fact I would not expect it to work, because the floppy controller (virtual) hardware, in addition to the floppy drivers in the guest OS, will expect a certain subset of possible values as regards media type, cylinders, tracks per sector and so on. I don't see how it could possibly accept the 2GB memory stick I just tried it with.

Interestingly, your blogger doesn't explicitly say that it works for him either, he just points out that the USB drive letters are listed in the floppy mount menu. No doubt the menu is actually listing removable drives.

Re: Testing a Bootable OS Installation USB

Posted: 24. Jun 2011, 01:44
by vboxi
Hi there,

does the method via PhysicalDrive still work?
Here is a sample batch I once used to boot an usb drive:
(win only, used with xp host with vbox 3.2.12.)

Code: Select all

::
:: Create a disk file pointing to an usb drive
::   use showDisks.vbs to find partition name for 'targetDrive'
::
:: vb install dir
set vbDir=D:\winprog\VirtualBox
:: virtual disk dir
set vdiDir=E:\x\VirtualBox\VDI

:: new disk file name
set diskName=usb
:: source disk 'PhysicalDrive' name
set targetDrive=PhysicalDrive6


pushd %vbDir%
VBoxManage.exe internalcommands createrawvmdk -filename %vdiDir%\%diskName%.vmdk -rawdisk \\.\%targetDrive% -register
popd
Change the PhysicalDrive_number accordingly.
Did not try to find a way on linux hosts.

Re: Testing a Bootable OS Installation USB

Posted: 24. Jun 2011, 11:45
by mpack
Raw disk access is not really mounting a USB drive. It's mounting an ordinary IDE or SATA drive using data stored on a USB drive. There's a difference.

If you want to test USB explicitly then the latter doesn't do it. If all you want to do is test a bootable hdd image then there's no need to get USB involved. Easiest: use Disk2VHD on the USB drive, mount VHD in VM.

Another possibility: make a raw image of the drive (I suggest this because the USB image might already be available), then create a simple VMDK descriptor for it, then mount the VMDK in whatever VM needs it. "VBoxManage internalcommands createrawvmdk" might be able to do this, I'm not sure, but I would simply modify another VMDK descriptor to suit, using Notepad (note that not all VMDKs can be used as a template, because not all have readable text descriptors).

Re: Testing a Bootable OS Installation USB

Posted: 24. Jun 2011, 21:33
by vboxi
Raw disk access is not really mounting a USB drive. It's mounting an ordinary IDE or SATA drive using data stored on a USB drive. There's a difference.
I am a bit confused and have to think about all your input, mpack :-)

The scenario this method helped me with, was a bootable usb stick with win xp on it.
Experimenting with it under virtualbox was more convenient than booting the whole hardware.
I thought the op wanted to try a bootable usb stick under virtualbox, but I am not that sure now.
Lets see, idk.

Re: Testing a Bootable OS Installation USB

Posted: 25. Jun 2011, 12:13
by mpack
vboxi wrote:The scenario this method helped me with, was a bootable usb stick with win xp on it.
Yes, you used a workaround which allowed you to boot from a raw hdd image - one which happened to be stored on a USB drive, although the USB-ness of it was not important for your purposes (you would have don't the same thing if it was eSATA or Firewire instead of USB). In terms of what was simulated by VirtualBox in your case, it simulated an ordinary IDE hard disk (or maybe SATA, you didn't say). It did not appear to the guest as a USB drive.

However the OP insists that his goal is not simply to run the OS stored on the drive, but to test the USB boot aspects specifically. I'm not sure why he needs to do that, but that is what he said, and unfortunately VBox doesn't support it.

Re: Testing a Bootable OS Installation USB

Posted: 25. Jun 2011, 22:34
by vboxi
I think I understand now, what I forgot is that usb is just the transport interface/protocol. The guest was configured to use ide.

I thought the op was talking about a vdi file residing on an usb stick, compared to a bootable system on an usb stick. But yes, he could only test if the boot record and file system is boot/usable this way. Hope he comes back and tells us if this would help him.
Alternatively, the new vbox owner could add real usb boot :-)

Re: Testing a Bootable OS Installation USB

Posted: 26. Jun 2011, 10:53
by mpack
vboxi wrote:the new vbox owner could add real usb boot :-)
I don't see that happening. It requires the VM to own a USB port before the VM starts. A bit tricky...

Re: Testing a Bootable OS Installation USB

Posted: 26. Jun 2011, 21:25
by Leak
mpack wrote:
vboxi wrote:the new vbox owner could add real usb boot :-)
I don't see that happening. It requires the VM to own a USB port before the VM starts. A bit tricky...
Well, you could add it to the VM's F12 boot screen; probably by adding a USB device while that's up and pressing another key to have the VirtualBox BIOS re-scan for USB devices...