Testing a Bootable OS Installation USB

This is for discussing general topics about how to use VirtualBox.
Post Reply
ElSid
Posts: 2
Joined: 21. Jun 2011, 17:30
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Windows 7

Testing a Bootable OS Installation USB

Post 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?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Testing a Bootable OS Installation USB

Post by Perryg »

VirtualBox does not support USB booting.
ElSid
Posts: 2
Joined: 21. Jun 2011, 17:30
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Windows 7

Re: Testing a Bootable OS Installation USB

Post 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?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Testing a Bootable OS Installation USB

Post 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.
vboxi
Posts: 5
Joined: 24. Jun 2011, 01:35
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: xp, linux

Re: Testing a Bootable OS Installation USB

Post 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.
Attachments
showDisks.vbs.txt
Here is the vbs file from the batch comment.
(1.67 KiB) Downloaded 40 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Testing a Bootable OS Installation USB

Post 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).
vboxi
Posts: 5
Joined: 24. Jun 2011, 01:35
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: xp, linux

Re: Testing a Bootable OS Installation USB

Post 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.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Testing a Bootable OS Installation USB

Post 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.
vboxi
Posts: 5
Joined: 24. Jun 2011, 01:35
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: xp, linux

Re: Testing a Bootable OS Installation USB

Post 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 :-)
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Testing a Bootable OS Installation USB

Post 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...
Leak
Posts: 242
Joined: 31. Mar 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian Testing, Windows XP, Windows Server 2003/2008 R2

Re: Testing a Bootable OS Installation USB

Post 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...
Post Reply