Jump to content











Photo

Test your bootable USB Flash Drive In QEMU


  • Please log in to reply
19 replies to this topic

#1 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 10 November 2009 - 05:15 PM

====================================
Test your bootable USB Flash Drive IN qemu
====================================
Hi All

When working with bootable and multiboot USB Flash drives,you need
to test your flash by restarting your system and booting by UFD.
and this takes a lot of time,specialy when you need to do this work
several times.

When searching the web pages to find a way to be able to test bootable
UFD inside windows,i saw an free application that does this job.

I have tested it several times by different bootable flash drives and
worked perfect.

So i thought it may be helpful for some users too and now do as below:

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

1.Make your bootable flash dive.

2.Download MobaLiveUSB_0.2.exe from link below:

http://mobalivecd.mo...LiveUSB_0.2.exe

2.Copy MobaLiveUSB_0.2.exe in root of your bootable usb flash drive.

3.Run MobaLiveUSB_0.2.exe inside your flash drive

That's all,After few seconds your bootable flash drive will be run
in qemu.

===================================================
Hope will be some help.

shirin zaban.
  • Blackcrack likes this

#2 was_jaclaz

was_jaclaz

    Finder

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

Posted 10 November 2009 - 07:12 PM

Well, NO. :thumbup:

You are testing the device :thumbup:, and it's bootability with Qemu BIOS, but you are NOT testing the USB bootability of the device, exactly same reasoning that applied to virtualbox:
http://www.boot-land...?showtopic=8581

Mobalive is a nice "wrap around GUI" to Qemu, but nothing more:
http://www.911cd.net...o...=22273&st=0

jaclaz

#3 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 10 November 2009 - 07:34 PM

Hi jaclaz

I can not understand what do you mean
Do you mean that a bootable usb device that runs in qemu,may be can not run by computer??

If you give more informations ,i will be thankful

shirin zaban

#4 cdob

cdob

    Gold Member

  • Expert
  • 1438 posts

Posted 10 November 2009 - 08:12 PM

Qemu maps the USB flash drive to a internal hard disk.
The booted OS dosn't detect a USB flash drive anymore.
The OS dosn't use USB drivers. This is not USB testing.

Contrary Qemu USB flash booting is nice for general testing.

#5 was_jaclaz

was_jaclaz

    Finder

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

Posted 10 November 2009 - 08:21 PM

Hi jaclaz

I can not understand what do you mean
Do you mean that a bootable usb device that runs in qemu,may be can not run by computer??

If you give more informations ,i will be thankful

shirin zaban


Yes and no.
Basically you are mapping a USB device mounted as physicaldrive by the host system (2K/XP/Vista/whatever) as the first or second hard disk in Qemu.
First and second hard disk in Qemu are (virtually) PCI devices, and being mapped through the host OS may get them a different geometry from the actual one (i.e. get anyway the "forced" 255/63 geometry these OSes use).
Secondly the Qemu BIOS is a rather "strict" one, it follows accurately the theoretical CHS mappings, as an example a USB stick (or image) smaller than 512 Mb will require to be booted, AT LEAST if it has partition type 06 (FAT16 CHS mapped) or 0B (FAT32 CHS mapped), a geomtry of 16/63.

Some rudimental USB support (though AFAIK not yet booting support) has been added to recent Qemu releases, try playing a bit with Qemu Manager 6:
http://www.davereyn.co.uk/download.htm
experiment with PLoP in it:
http://www.plop.at/en/bootmanager.html
with an image of the USB device.

I don't think it is really working yet, VMware should:
http://www.boot-land...?showtopic=8042

Hope the above clears the matter :thumbup:, if not feel free to ask about your doubts. :thumbup:

:thumbup:

jaclaz

#6 Shirin Zaban

Shirin Zaban

    Frequent Member

  • Tutorial Writer
  • 423 posts
  • Location:Tehran
  • Interests:1_Making Unattended and Customized XP<br /><br />2_Making different types of Bootable and Multiboot CD/DVD<br /><br />3_Like to learn more about grub and grub4DOS
  •  
    Iran

Posted 10 November 2009 - 08:32 PM

Hi jaclaz

Thanks a lot for your very nice information.i have learned some thing new.

shirin zaban

#7 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 10 November 2009 - 09:45 PM

jaclaz, is VirtualBox also mapping?

:thumbup:

#8 was_jaclaz

was_jaclaz

    Finder

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

Posted 11 November 2009 - 09:53 AM

jaclaz, is VirtualBox also mapping?

:drunk:

What the heck do you mean? :)

mapping WHO/WHAT/WHERE? :)

We have a thread about Virtualbox here:
http://www.boot-land...?showtopic=8581

Let's continue there, OK?

jaclaz

#9 MrChucong™

MrChucong™

    Member

  • Members
  • 59 posts
  • Location:Small City
  • Interests:Life Or Death
  •  
    Vietnam

Posted 14 January 2012 - 12:41 PM

thanks !

#10 fellaw

fellaw

    Newbie

  • Members
  • 11 posts
  •  
    Germany

Posted 08 March 2012 - 10:10 PM

Hey, just wanted to give a note to all:
It is possible to do an actual USB boot in Qemu. And it seems to work fine according to tests I've done so far.

Needed:

Qemu 0.14.1 (e.g. 0.11.1 didn't work at all, didn't try other/previous versions)
Seabios 1.6.3, e.g. from http://www.emdebian.....3-2em1_all.deb
Modified vgabios-cirrus.bin from http://www.coreboot...._v2_.2B_SeaBIOS

Qemu doesn't seem to support usb boot via parameter (yet). However SeaBIOS 1.6.3 has a boot menu via F12.
From there you can boot a USB drive, either real physikal disk or qemu image, whichever you want to use. If you force the qemu boot order to empty, SeaBIOS will default to USB.

Hope this helps.

P.S.: I use Qemu manager for configuration, since I'm working on Windows.

Edited by fellaw, 08 March 2012 - 10:16 PM.


#11 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 10 March 2012 - 10:56 AM

That's quite useful, thanks.

qemu-system-x86_64.exe -boot menu=on -L . -m 256 -usb -usbdevice disk://./PhysicalDrive1
This shows boot menu, after the timeout boots PhysicalDrive1 as USB disk in 1.1 or 1.0 speed. F12 for boot options and the disk can be selected this way. PLoP 5.0.14 on the disk works and speeds it up.

qemu-system-x86_64.exe -L . -m 256 -usb -usbdevice disk://./PhysicalDrive1
This boots directly PhysicalDrive1 as USB disk.

Testing it with QEMU 13.0 and BIOS files from the links above.

If a hard disk image is added too, i.e.
qemu-system-x86_64.exe -boot menu=on -L . -m 256 -usb -usbdevice disk://./PhysicalDrive1 -hda test.img
it defaults to booting it, so USB boot can be used via F12 only.

#12 fellaw

fellaw

    Newbie

  • Members
  • 11 posts
  •  
    Germany

Posted 10 March 2012 - 11:29 PM

Thanks for update.

This seems to work until including 0.15.1, however not 1.0 and above. The F12 menu just doesn't show any USB drives.

1.0 as well as 0.15.1 support EHCI natively(still under development), thus giving 2.0 speed right from the start. Check 1.0.1 docs/usb2.txt for more(EHCI patches have been included since 0.15.1 iirc).

My command line for 0.15.1:
qemu-system-x86_64.exe -L . -m 512 -readconfig configs\ich9-ehci-uhci.cfg -drive file=\\.\PhysicalDrive3,if=none,id=usbdrive1 -device usb-storage,bus=ehci.0,drive=usbdrive1

ich9-ehci-uhci.cfg was copied straight from 1.0.1 docs/ich9-ehci-uhci.cfg and contains parameters for a combined UHCI/EHCI PCI device.

SeaBIOS has EHCI support since 0.6.0, as well as USB boot support. Qemu 1.0.1 comes with SeaBIOS 0.6.2, therefore there's no need to replace it with 1.6.3.

Edited by fellaw, 10 March 2012 - 11:30 PM.


#13 fellaw

fellaw

    Newbie

  • Members
  • 11 posts
  •  
    Germany

Posted 16 March 2012 - 10:46 PM

Some news:

SeaBIOS version 1.6.3.4 gives back the USB boot entry under Qemu 1.0.1.

Here's my compiled version.
Beware: Not stable.



#14 soft5mag

soft5mag
  • Members
  • 3 posts
  •  
    United States

Posted 17 March 2012 - 06:10 AM

fellaw

Can you explain, what is it for?

#15 fellaw

fellaw

    Newbie

  • Members
  • 11 posts
  •  
    Germany

Posted 17 March 2012 - 08:22 AM

This file enables USB boot possibilty for Qemu 1.0.1.

To explain it a little bit further:

Some time ago, I noticed that none of the top five standalone x86 emulators/hypervisors - VMWare Player/Workstation/Server, Virtual Box, Virtual PC, Qemu, Bochs - supports booting directly from USB, like common computers do. That feature would be useful for tests with portable OSes.

A common method to get a USB drive booted in a virtualized environment is setting it up as an internal drive(e.g. -drive file=.PhysikalDrive1 in Qemu). But this gives no qualified conclusion whether such a OS would boot from USB on bare metal, maybe even leading to 0x7B stop errors or similar if you'd boot windows.Other methods used boot managers like PloP. I also found this thread regards.

Some research of myself turned out that Qemu supports booting from USB, if you use a more recend version of it's BIOS rom, SeaBIOS. Best progress was made with Qemu 0.15.1 and SeaBIOS 1.6.3. However, I had some stability issues in Qemu 0.15.1 and wanted to use version 1.0.1.

In Qemu version 1.0.1, the USB entry from SeaBIOS 1.6.3 was suddenly gone. I ran some debugging to find out the cause, but without luck. Yesterday, I compiled SeaBIOS pre-1.6.3.4 from source. It gave back the USB menu entry.

I thought it would be nice to share it until the next stable release is out.

Edited by fellaw, 17 March 2012 - 08:25 AM.


#16 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 14758 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 17 March 2012 - 02:23 PM

@fellaw
It would be nice if you could post full links to the EXACT versions of the software (QEMU), as it often difficult to find the same exact build.
I presume you are talking about this one:
http://lassauge.free.fr/qemu/
http://lassauge.free...0.1-windows.zip

:cheers:
Wonko

#17 fellaw

fellaw

    Newbie

  • Members
  • 11 posts
  •  
    Germany

Posted 17 March 2012 - 02:44 PM

@fellaw
It would be nice if you could post full links to the EXACT versions of the software (QEMU), as it often difficult to find the same exact build.
I presume you are talking about this one:
http://lassauge.free.fr/qemu/
http://lassauge.free...0.1-windows.zip

:cheers:
Wonko


Yep, that's one of the builds. I didn't think it would be relevant. The files work for windows and linux builds of Qemu, and there are binary builds out there for all major platforms.

#18 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 17 March 2012 - 03:12 PM

Yep, that's one of the builds. I didn't think it would be relevant.


Allow me to contradict. I wanted to download qemu 1.0.1 binary for windows, but all significant google results brought me to URLs to download the source code, which I should have to compile (With which tool(s)??? How ???).

So, for me the information Wonko gave about the link, is very relevant!

Should be nice to include next time in a similar situation.

Peter :cheers:
  • fellaw likes this

#19 cdob

cdob

    Gold Member

  • Expert
  • 1438 posts

Posted 13 May 2012 - 06:53 AM

SeaBIOS 1.70
http://www.seabios.org/Download
http://www.linuxtogo...~kevin/SeaBIOS/
http://www.linuxtogo.../bios.bin-1.7.0

#20 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 386 posts
  •  
    Germany

Posted 13 May 2012 - 03:01 PM

it is very good, it is , not only for testing, it is a winxp for booting by Frends with his own Configuration
and own Programms in a clean room without Formating and Partitioning and..and..and.. without booting again..

it is easy plugin the Stick and start you own XP... + you can copy and past any on the usb-stick...
and can start in a "clean room" maby for testing....... with networkbrige in the Networktopology,
sound, and so what it is need for let run a fully WinXP. or Win95, 98 , or maby a cool
running from usb-dos 6.22 *lol* i have 4 8G-USB flying around here.. hihi...
aand i have made a bootable-dos622.iso( i had know to need it.. hehe)


i have a suggestion... can you make a single exe seach te iso in the same folder, start it,
use the USB as C: maby MobaisoinstallLiveUSBxx.xx.exe

to create a real running System on USB... boot iso, check system (dos 6.22/win95/win98/XP/7 or maby linux )
add -if (realy) need- a g4d for booting the systems who it's need ad voila..

how to push past with hard drives is desired in the past,
you have the systems to USB via clean room... qemu ( ohh on dos playing tyrian and doom 1 in dos with sb16 emu
and in Win95 Doom2 ;) )

or a 8 Gig usb with 4 Primary Partitions -> 4 Systems .. dos, Win95/98, WinXP and Win7
and grub for dos is selecting to booting the system on the USB-stick...

maby a bootable iso like XP or W7
and take the usb as C: for installing on the USB-Stick

for the 2nd start can use MobaLiveUSB for installing to end ...

or maby easy MobaLiveUSB /iso=C:worksystem.iso

and without parameters direcktly on Host-cdrom
for installing over CDRom on USB as C:

the Sound it is SB16 Network 100Mbit card briged

for booting with iso a clean usb for installing the system
and hang it on for boot and CDromemu on next without
this parameter use automatical the Floppy, CDrom of hostComputer ...

it is .. wooooow !!!!! coooolll + geeek-like !!
if i mus get a Note =99Points(need iso-installer -1 Point)
Note 1 as a easy portable VM on USB !

best regards
Blacky

Edited by Blackcrack, 13 May 2012 - 03:47 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users