Jump to content











Photo
* * * * * 3 votes

Virtual Machine USB Boot

boot usb machine virtual

  • Please log in to reply
176 replies to this topic

#1 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 20 July 2013 - 06:01 PM

*
POPULAR

Posted Image

File Name: Virtual Machine USB Boot
File Submitter: DavidB
File Submitted: 20 Jul 2013
File Updated: 18 Mar 2015
File Category: Boot tools

What it does:

With this application it's easy to add a real USB drive into a virtual machine (VirtualBox or QEMU) and boot from it.
It will temporary separate the drive from the host OS (dismount it) and, after the virtual machine is closed, it will mount it back. This way it will prevent data loss and the changes made to the drive in the virtual machine will be visible in the host OS too.

Posted Image

Requirements:

Host OS: Windows XP/Vista/7/8/8.1
VirtualBox (installed not portable) and/or QEMU

How you can use it:

Download and unzip the setup file or the portable version. Install the setup file and start it or just start the portable.
If you have a limited user account on the host OS you need to start it as an administrator, because only this way it will properly check and use the real (USB) drive.
In Windows 7/8/8.1 it will automatically start it as an administrator. In Windows XP and Vista it will have to be set manually:

Posted Image

If you intend to use the VirtualBox Manager in the same time with Virtual Machine USB Boot, I strongly suggest to set its exe file or shortcut to be started as an administrator too.

Posted Image

Now, in the main application's window, click on the Add button.
You'll see this window:

Posted Image

Posted Image

Here you can set:

- the VM type (VirtualBox or QEMU);
- the name of the list entry;
- the way you can set the VirtualBox VM: by name, by path or by exe parameters;
- the drive to add and boot (usually a USB drive);
- a second drive (if you set "Add second drive option" in Options);
- for VirtualBox VMs: enable/disable/switch CPU virtualization;
- for QEMU VMs: memory size, a HDD image file, a CD/DVD device and a sound card;
- the state of the main window for VirtualBox/QEMU (minimized/normal/maximized/fullscreen/hidden);
- the CPU priority (BelowNormal/Normal/AboveNormal/High).

If all is set you can click on Ok.

When you first use the application it's wise to set the options. So click on Options button.

Posted Image

Here you can set the wait time from the moment the application triggers the system data flush on the drive to the moment it actually dismounts it; usually 500 ms is enough but you can increase it on slower drive/OS/computer.
The next option will set if the application will try to lock the volume(s) on the drive before dismounting it/them. This way you can be sure that all the system data was flushed and there are no processes accessing the drive. But sometimes it can be slow...
If you wanna add a second drive to the virtual machine check the "show a second drive option".
"Backup the old entries before saving the new ones": it will save the old entries as "Application_name.vml.bak". Useful when you often have problems with the OS, the computer or electricity. If you don't have such problems you can uncheck it.
"Don't warn when not able to save the configuration or the entries file": you can uncheck it if you start VMUB from a read only medium or with 0% free space.
When you add a new entry, the VM type is VirtualBox by default but you can change it to QEMU if you like.
With the next option only the USB drives are listed. If you uncheck it the internal HDDs (except the OS drive) and the mounted virtual HDDs will be listed too.
The font size, name, style, color and script for the entries list can be changed to your liking.
By default the Escape key pressed in the main window can close the entire application but now you can activate/deactivate it.
In VirtualBox section, you can set the path to the VirtualBox exe (usually autodetected).
You can choose the way the application will modify the VirtualBox machine:
- to try to autodetect the most appropriate for the given situation;
- calling VboxManage.exe a few times with specific parameters; this method is slow but you can keep VirtualBox Manager opened all the time if you want;
- modifying the virtual machine's configuration file (*.vbox) directly; it's faster but VirtualBox Manager must be closed; also, if you keep (re)starting the virtual machine very fast each time after you closed it then it will be a little less stable.
Also you can set if the "Enable VT-x/AMD-V" option will be showed in the Add/Edit window and if the drive(s) should be removed when the VM is closed.
In QEMU section, you can set the path to its exe (usually autodetected if QEMU was installed).
You can set the default exe parameters that will appear in the Add window when you add a new QEMU entry.

If all are set, click on the Start button and the virtual machine will be configured and started.

Tips:

1. When you first create the virtual machine in VirtualBox make sure there is a free port in the storage controller. This way the application will add the drive there.
Also, if you want to boot from that drive, make sure the free port is positioned prior to other drives, because the VirtualBox VM will boot from the first drive in the storage controller(s).
You can do that by starting the VirtualBox Manager, editing the VM's storage options and moving the other drive(s) into subsequent port(s).
2. Try to avoid using snapshots or saving state of the VM.
3. In the main window you can choose which columns you want to hide/show by right clicking on the columns and checking/uncheking them in the popup menu. Also you can modify their lengths.
You can sort the entries by clicking on the header of each column.
4. The application will remember the position, the size and the maximized state of the main window. Also any column changes...
5. In the list you can right click on an entry and choose an action or use keyboard shortcuts (Insert, E, Return, +, Delete, Alt+Up, Alt+Down, Ctrl+P).
6. Usually it takes a few seconds to configure and load the VirtualBox VM but sometimes it will take a little longer, so don't be alarmed.
7. When you start the application or when you add or edit an entry, the application will generate a new ID/GUID for the drive. This is a unique number used internally in VirtualBox for identifying the drive.
8. The drive you choose in Add/Edit window will be later recognized and used even if you disconnect/connect other drives before using it again.
9. If you receive an warning or an error message from the application, please read the text thoroughly because it will help you solve the problem. The application is designed to deal and solve many problems but, like any computer program, it can't solve all of them. But I implemented helpful suggestions/informations in these messages so you can easily solve them.
10. Before saving the entries list (*.vml) the application will backup the previous file in *.vml.bak. If you made a change that you don't like or if the OS/computer malfunctioned and it did not properly saved the vml file then you can restore it by removing the .bak extension.
These files are near the exe file in the portable version or in the "C:\Users\UserName\AppData\Roaming\Virtual Machine USB Boot folder" (Windows Vista, 7, 8) in the installed version. In Windows XP they are in the "C:\Documents and Settings\UserName\Application Data\Virtual Machine USB Boot" folder. Normally these folders are hidden so you will need to unhide them or use a file manager set to see hidden files and folders.
11. The default exe parameters for QEMU are just a "guideline/example" on how to boot with QEMU x86/x64. But if you want to use/change other QEMU features you should add more parameters. Also, other QEMU versions may require additional parameters to boot. For example -kernel and -initrd.
12. QEMU usually shows 2 windows: one that displays text details about the VM and one with the VM. The "Run" option will change the state of the first window.


Changes in 1.51 version:

1. The scan for (USB) disks is faster.
2. In the Add/Edit window the information about found disks and CDROM drives is shown on columns (name/size/volume letter(s)).
3. A few bugs solved.
4. Some small improvements to the language code.
5. Added german translation (lng file) sent by Blackcrack.

Click here to download this file
  • Brito, Black Zero, Zoso and 1 other like this

#2 Zoso

Zoso

    Silver Member

  • Advanced user
  • 640 posts
  •  
    Isle of Man

Posted 20 July 2013 - 07:29 PM

Thanks DavidB! this tool is very useful. I dont understand why the VB devs can not make their program with this function?

Does it work with portable VirtualBox also?

#3 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 20 July 2013 - 09:35 PM

Thanks DavidB! this tool is very useful. I dont understand why the VB devs can not make their program with this function?

 

I noticed in the last years they are trying to make VB work only with OS's installed inside the VM. So using a real drive is obviously not preferred.

They have their reasons for doing this, maybe they're not 100% bad reasons, but I can't say because they are not talking about that.

It's their right not to talk, of course, but it's not "open source"...

 

My personal opinion is: at some point in the future VirtualBox may not be free and open source anymore...

 

Does it work with portable VirtualBox also?

 

It may not work because the installed version has a specific folder to store the configuration file: C:\Users\UserName\.VirtualBox.

If the portable version is not using the same folder my application has no way to find the path to the VMs, their names, configuration and so on...

 

Btw, I'm a big fan of portable versions for any program, but, when I tried a portable VirtualBox version some time ago, I wasn't too pleased.

2 reasons:

1.  VirtualBox is already "lite" so using a portable version does not lower the resources usage.

2.  the portable version is kinda limited...

 

But I'm willing to give it a try...

Just send me a link to your version so I can test it and make the appropriate modifications to VMUB (if necessary)...



#4 Zoso

Zoso

    Silver Member

  • Advanced user
  • 640 posts
  •  
    Isle of Man

Posted 20 July 2013 - 10:30 PM

currently Im not using the portable version, I tried it a while back with the bright idea that I could run my universal XP from another running system when rebooting was not an option. it seemed too buggy at the time but that was years ago.

I would still like to do that idea though and may tool around with it more when I get a few other projects sorted out.

here is the most recent version (I think) and they are looking for developers also:

http://www.vbox.me/

#5 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 21 July 2013 - 05:15 AM

apropos Installer, Portable and source, it's need only imo Portable, hold it portable like rufus if you can,

or other ask, why a setup/installer if mus the User known what he does by use this program.

so you can save you time for have a couple more lines of codes  ;) an Installer is not need..

 

:cheerleader: Thank you very much for his program ! :cheerleader:

 

best regards

Blacky


Edited by Blackcrack, 21 July 2013 - 05:22 AM.


#6 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 21 July 2013 - 06:15 AM

currently Im not using the portable version, I tried it a while back with the bright idea that I could run my universal XP from another running system when rebooting was not an option. it seemed too buggy at the time but that was years ago.

I would still like to do that idea though and may tool around with it more when I get a few other projects sorted out.

here is the most recent version (I think) and they are looking for developers also:

http://www.vbox.me/

 

 

 

Yes, I remember testing this version as well...
I tested again and I'm not sure that VMUB is worth modifying to use it.
What I noticed:
1. The configuration file is indeed in another location: "Portable-VirtualBox\data\.VirtualBox". So I have to add a new edit box for this in Options. But that's not such a big problem...
2. It starts/closes much slower than the installed version, because in has to register/unregister some services. But VMUB already needs some time to configure and start the VM so this additional delay may be unacceptable for the user.
3. If Portable-VirtualBox.exe isn't loaded VirtualBox.exe and VboxManage.exe can't be used directly. So, VMUB has to start this exe, after a few seconds the VirtualBox Manager is opened, makes the modifications to the VM and starts it. But some users may not like that VBM must be opened each time.

My opinion is most users won't like the additional delay and/or VBM must be opened.



#7 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 21 July 2013 - 06:23 AM

apropos Installer, Portable and source, it's need only imo Portable, hold it portable like rufus if you can,

or other ask, why a setup/installer if mus the User known what he does by use this program.

so you can save you time for have a couple more lines of codes  ;) an Installer is not need..

 

:cheerleader: Thank you very much for his program ! :cheerleader:

 

best regards

Blacky

 

You're welcome.

Portable VMUB is good, yes, and it will be preferred but some users want the installed version as well. You can see that in the number of downloads for the previous versions.

Since the difference in coding is insignificant I think is worth keeping the installed version as well...



#8 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 21 July 2013 - 06:57 AM

You're welcome.

Portable VMUB is good, yes, and it will be preferred but some users want the installed version. You can see that in the number of downloads for the previous versions.

Since the difference in coding is insignificant I think is worth keeping the installed version as well...

well, we will see in the future on the download :)

 

:boo: To speak again, only now, now it would be very good if we could have a patch or driver for WinXP and 7 now could run around this by USB :)

( I think on ssd's on usb or harddrives in usb for boot on usb ;) with regpatch and drivers for boot WinXP and Win7 .. specially for WinXP because the size of WinXP it's predestination for installing on USB

Maybe someone like the VMUB would have something to give / donate for create usb-bootable WinXP/7 :)

Now let's see how the story continues :) would be on top anyway, when suddenly a patch/drivers would appear in this Tread for XP/7 :)

 

So, keep it up :good:  I look forward on it to continue to pursue this adventure :cheerleader:   because, this have a mighty possibility's for all Systems

 

the sourcecode it is maybe not so badly, because maybe create anyone this one in Linux with/as an Linuxbinary :) the path/variable it's the same.. maybe in QT, as portable also .. and get it to you for put on your page for both systems..

 

best regards

Blacky


Edited by Blackcrack, 21 July 2013 - 06:59 AM.


#9 VinylCyril

VinylCyril
  • Members
  • 3 posts
  •  
    Russian Federation

Posted 21 July 2013 - 11:10 AM

Hi!

 

Thanks for the awesome program. But seems like I'm clueless as how to actually get it working :)

Is my setup correct? On the USB stick, there's nothing but the Raspbian image.

When I press "Start", a shell window flashes for half a second and vanishes.

 

I guess I need something extra, but I don't know what. Most Qemu howtos don't deal with bootable USB's, so I'm kind of in the dark...


Edited by VinylCyril, 21 July 2013 - 11:11 AM.


#10 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 21 July 2013 - 11:37 AM

Hi.

Seems like a Qemu problem.

Which Qemu version are you using..?

You can try with this one: http://reboot.pro/files/file/147-qemu/



#11 VinylCyril

VinylCyril
  • Members
  • 3 posts
  •  
    Russian Federation

Posted 21 July 2013 - 12:25 PM

That one works fine, but it only has executables for x64 and x86 (which worked fine with a i386 Debian img). I'm trying to run Raspbian, which expects ARM.

 

I know at this point my original question is essentially resolved and I shouldn't be bothering you, but the uploader (of the Qemu version that you suggested) is not active anymore. Maybe you know of any other working versions that would support ARM? The one I originally found (from omledom.com) is broken, apparently :)

 

Big thanks already!



#12 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 21 July 2013 - 01:08 PM

If you look in the folder with qemu-system-arm.exe you'll find a stderr.txt file with this text: "Kernel image must be specified"
You can find more info here: http://www.raspberry...=3149&start=100

Or here:http://www.linuxques...tem-arm-898112/



#13 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 22 July 2013 - 03:09 PM

New version: 1.22

 

Changes:

 

Improvement: the "Wait time to flush data" option was moved from the Add/Edit window into the Options window.
Improvement: a VM image was added to the "VM Name" column.
Bugfix: sometimes the context menu of the list had the MoveUp and MoveDown menu entries enabled when they should of been disabled.
Improvement: A few web links were implemented.
Improvement: the Qemu exe parameter for attaching the real drive is now added to the command line before the other parameters. This way it will be added before other drives.
Improvement: when Qemu fails to start the VM a message with useful informations is shown.
And some other minor code improvements...

 

Download here

 



#14 VinylCyril

VinylCyril
  • Members
  • 3 posts
  •  
    Russian Federation

Posted 24 July 2013 - 01:36 PM

Hello!

 

I've been learning a lot about Qemu during the past couple of days, so I hope I won't sound as stupid as before.

Downloaded the kernel, read about Qemu command line parameters, etc.

 

I have a strong-ish assumption that your program works great with 0.x versions, because they allow the format you use for the "-drive" parameter, unlike the newer builds of Qemu that I could find.

Since Qemu 0.15 doesn't support arm1176, I had to use lassauge's 1.5.x. They register an error in the log:

lass-151\qemu-system-armw.exe: -drive file=\\.\PhysicalDrive1,if=ide,index=0,media=disk,snapshot=off: Block protocol 'host_device' doesn't support the option 'filename'
lass-151\qemu-system-armw.exe: -drive file=\\.\PhysicalDrive1,if=ide,index=0,media=disk,snapshot=off: could not open disk image \\.\PhysicalDrive1: Invalid argument

Could it be backslashes in system paths (\\.\PhysicalDrive1) instead of forward-slashes?

I updated to the latest version of your program, and the issue persists.

 

P.S. I tried using your program with the 0.15 version of Qemu, having specified arm1136 instead of arm1176, it didn't go well, there's error messages like "can't open root device sr0."



#15 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 24 July 2013 - 04:11 PM

Yes, my program uses "-drive file=\\.\PhysicalDrive[n],..." to add the real drive.
Seems like in the newer version doesn't like it...

I will investigate more and return with the results...



#16 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 24 July 2013 - 06:20 PM

I looked in Qemu code: yes, it uses "//./" but also uses "\\\\.\\".



static int find_device_type(BlockDriverState *bs, const char *filename)
{
    BDRVRawState *s = bs->opaque;
    UINT type;
    const char *p;

    if (strstart(filename, "\\\\.\\", &p) ||
        strstart(filename, "//./", &p)) {
        if (stristart(p, "PhysicalDrive", NULL))
            return FTYPE_HARDDISK;
        snprintf(s->drive_path, sizeof(s->drive_path), "%c:\\", p[0]);
        type = GetDriveType(s->drive_path);
        switch (type) {
        case DRIVE_REMOVABLE:
        case DRIVE_FIXED:
            return FTYPE_HARDDISK;
        case DRIVE_CDROM:
            return FTYPE_CD;
        default:
            return FTYPE_FILE;
        }
    } else {
        return FTYPE_FILE;
    }
}

But "\\.\" is also indirectly supported.

Anyway I tried with both in a batch file but I got the same result. I even tried with a volume (//./d:) and with /dev/cdrom, still doesn't work.
It seems that the problem could be somewhere in the Qemu code, since the error appears even when my program isn't used.

So, for now, I advice you to use the older version.
Also I think it's wise to test with a batch file first to be sure it will work.
You say that you have an error. Could you please show me the parameters that you used...?



#17 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 25 July 2013 - 03:55 PM

edited



#18 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 25 July 2013 - 05:09 PM

wow crewl options dialog !! :cheerleader: keep it up! :good:

maby an 2nd drive selecting, if hang it on an isofile from vbox, shold be enabled to overtake the 2nd drive settings for independed configuration/hang in an other iso or unmount the iso for next boot , also not need to open the vbox-masterdialogbox finally .. i have at exemple 2 controler, once, the fisrt the ATA-Controler the 2nd it is an SATA where it is the CDRom/iso file on it.. so shold seach the controler and the end connections and make possible to change it.. ide-> usb + other and sata iso/host-cdrom , i hope it's understandable the suggestion :)

 

maybe a optionsbox for qemu entrys also ? IT's certainly  useful for qemu also :)

 

best regards

Blacky

 

p.s.: slashes and backslashes comes from the linuxcode, mus be compatieble with linux also,

therefor use it slashes and backslashes :)


Edited by Blackcrack, 25 July 2013 - 05:20 PM.


#19 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 25 July 2013 - 06:30 PM

maby an 2nd drive selecting, if hang it on an isofile from vbox, shold be enabled to overtake the 2nd drive settings for independed configuration/hang in an other iso or unmount the iso for next boot , also not need to open the vbox-masterdialogbox finally .. i have at exemple 2 controler, once, the fisrt the ATA-Controler the 2nd it is an SATA where it is the CDRom/iso file on it.. so shold seach the controler and the end connections and make possible to change it.. ide-> usb + other and sata iso/host-cdrom , i hope it's understandable the suggestion  :)

 

Sorry, don't understand 100% :(

 

p.s.: slashes and backslashes comes from the linuxcode, mus be compatieble with linux also,

therefor use it slashes and backslashes :)

 

Yes, I knew that, I'm using Linux for years now...



#20 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 26 July 2013 - 05:06 AM

no problem :) maybe comes by step to step developing from this programm by self, because it is a need in anyway to have an own config-dialog at last for all ;) in any case it's a good way like it goes now.. keep it up :)

 

Config/optionswindow it's a need for both emulators in any case like i see it..

therewith it's this confgwindow ^^ very good :)

 

best regards

Blacky



#21 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 27 July 2013 - 07:09 PM

Here is a little preview:
 

ok0ry9.png

 

And an exe to test it. It's just the interface (for now):

Attached File  Test.zip   309.51KB   1227 downloads

What do you think..? Do you find it useful or useless...? And how can it be improved...?
I know that Blackcrack and maybe Steve will answer but I would appreciate feedback from more users. And not just "it's fantastic, keep up the good work" but some constructive criticism.
Thank you.



#22 Zoso

Zoso

    Silver Member

  • Advanced user
  • 640 posts
  •  
    Isle of Man

Posted 27 July 2013 - 07:59 PM

more options is better!

I'll test when I get a chance but right now Im using 1.2 and I can not get a full boot up from a USB HDD with pos2009 (XP embedded with nt6).

the same USB HDD boots perfectly in VMware with plop and directly on several machines. do you know how I can trouble shoot this?

it stops after the first stage drivers load. the stage that you see when you set the /sos option in the boot.ini
if I try a different kernl option it gets to the desktop but then I get a BSOD DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS crusoe.sys but I think that is only because Im using the wrong kernel and not related to the boot freeze when using the correct kernl, no certain though.

edit: I just remembered that I could not install pos2009 in VB because of lots of errors then I installed in VMware with no probelms so this is definately not an issue with your tool.

I tried to convert the vdmk to vhd after install and it still would not boot in VB. not sure whats going on with this.

#23 genetix

genetix

    Frequent Member

  • Advanced user
  • 132 posts
  •  
    Finland

Posted 06 August 2013 - 02:48 PM

Nice tool, damn, works quite well against real environment testing too. Comparing this against Plop CD/FLP -> USB method or direct physical access to USB as HD this works 10 times faster.



#24 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 06 August 2013 - 02:54 PM

youre right !  :)



#25 totoblack100

totoblack100

    Newbie

  • Members
  • 20 posts
  •  
    Madagascar

Posted 13 August 2013 - 02:44 AM

thx for the good work man!





Also tagged with one or more of these keywords: boot, usb, machine, virtual

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users