Jump to content











Photo
* * * * * 1 votes

Booting VirtualBox with USB workaround

usb virtualbox grub4dos plop

Best Answer steve6375 , 26 February 2013 - 12:18 PM

Is the Win7 64-bit or special in any way? Did you try an plain MS Win7 32-bit ISO extracted to a USB drive?

How about creating a virtual HDD, mounting the HDD, copying the USB stick to the virtual HDD, dismounting it, then boot from it via VBox?

Go to the full post


  • Please log in to reply
307 replies to this topic

#26 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 04 June 2013 - 10:21 PM

Is there a way to do a similar thing with QEMU?

 

I think it will work with QEMU too but I will test to be sure.

 

It would be great to add this into my RMPrepUSB - QEMU option??

 

Yes, of course :)



#27 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 05 June 2013 - 06:36 AM

I tested with QEMU and it works.
However changes on USB drive are remembered and shown only if the "snapshot=off" parameter is used. Btw, I had the same problem in VirtualBox...

If you still intend to implement this in your program you have 2 choices:
1. you can adapt the sources from Delphi to the programming language you use (probably Visual Basic).
2. You can use the exe attached to this post.
Its configuration is made only with command line parameters:
[USB_drive_number] [WaitTime] [QEMUexe] [QEMU_parameters]
Let me know if you have problems with it or if you need some modifications to be done...



#28 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 05 June 2013 - 08:35 AM

Hi David

That .exe just drops perfectly into my rmprepusb  startfromusb.cmd batch file and seems to work just great! :clap: 

Just one problem - how do I stop the console window from appearing on the desktop?

I tried start /MIN  and start /B  but neither seem to work??



#29 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 05 June 2013 - 08:51 AM

Solved it, I just had to use SW_MINIMIZE instead of SW_SHOW.
I updated the attached files in my previous post. BTW, I could use SW_HIDE and it will not just be minimized, it will be hidden. But I think that it's wise to be just minimized, in case that something goes wrong with QEMU...



#30 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 05 June 2013 - 09:02 AM

Great! I will make a Beta release of RMPrepUSB using this if that is OK with you - I have been trying to get USB writes to work for ages but never found an easy solution!

This means the grub4dos default command and dd writes, etc. will all work under QEMU and be permanent - brilliant! :good: 



#31 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 05 June 2013 - 09:17 AM

You don't have to ask me, you can use the source code and the exe whatever you like :)

I just have one recommendation: test it on many computers and with different USB drives and different versions of Windows, to be sure there are no problems... 

 

Just now I am working at a way to detect if my program is started normal/minimized/maximized, so it can start VirtualBox and QEMU in the same way...



#32 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 05 June 2013 - 10:06 AM

It's done.

Now the modification from shortcut properties and also "start min/max" are both detected and transmitted to VirtualBox/QEMU window. In QEMU it's the console window that will receive this and not the VM window.



#33 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 05 June 2013 - 10:33 AM

Thanks!

I tested the QEMU previous version on Win 7 64-bit and XP and it seems OK so far. In fact, a large grub4dos USB flash drive which previously took 39 seconds to display the menu when booting under QEMU in snapshot mode  (it had lots if iftitle menu items!), now takes 36 seconds with start_VM - so it seems slightly faster on drive access too...



#34 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 06 June 2013 - 08:49 PM

I also made a version with GUI.
A few screenshots:


Clipboard01.png

 

Clipboard02.png

 

Clipboard03.png

 

LE: links to the files removed, better versions in my next post.



#35 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 07 June 2013 - 05:25 AM

cool !! just only a Pulldownmenus to select the USB-Sticks and the Exe-parameters by selecting the exe File :)

for primitives users too and it's finish for the Mass Marked ;) And the VBox-Peoples say ever, we don't need them..

we mus write a new Bios for them .. blabla.. it's not for us . Hey DavidB if i would be in Faze Book became

you a big fad "like it"  DavidB, WELL DONE *thumps up*!  only lil changes :)

With this possible can install Moondrake and Openmandriva too !

 

best regards

Blacky

 

 

(Manndrake and Openmandriva be a Brunch from Mandriva Community Linux,  Jean Manuel Croset gave the Linux back to the Community you can find dem in  #Moondrake & #Openmandriva /  *-cooker on Freenode )


Edited by Blackcrack, 07 June 2013 - 05:31 AM.


#36 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 07 June 2013 - 02:04 PM

You're welcome.

I have made some improvements:
1. The list of VMs and their parameters is now stored in Unicode format (UTF16). It's not compatible with the format of the previous version but now, with the other 2 improvements, it's not so hard to rebuild it :D
2. You can choose directly the USB drive number with a popup menu.
3. When adding a VM entry from VirtualBox you can choose which VM should be added and its (UU)ID will be inserted automatically.



#37 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 07 June 2013 - 04:37 PM

i have test it out, taked a "TestXP-Install"-vmashin  select the usb-stick (the Drivenummer is very helpful,

dan you maybe add it behind the Drive-entrys Drive %drive% :\ to be show "Drive E:\ " on the Gui to known to be drives :)

and the User can chose the "Drive E:\" :) more better as "1" or "2" by the way, it'S maby better if you let hidden System drive C ;)

 

 

the Virtualbox start but use not the USB-Drive, maby it is very helpful if you let pop open an cmd-window

ala log-window and let show what have done for copy and past there to know what's the problem why

not choose the uuid from the USB btw the uuid from "e" by me the vbox, have 4 Drives, sata x4 2cdroms 2harddisk

so it it is the usb-stick with 16Gig e:

 

best regards

Blacky



#38 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 07 June 2013 - 05:08 PM

Actually, the 'A'..'Z' letters that we see in a file manager in Windows are not really "drives" but "volumes". A drive can have more than one volume. For example my internal HDD has C and D.
The virtual machines use physical drives (0, 1, 2, ...) not those letters, that's why is necessary to show them like that in the popup menu. But, since each corresponding volume(s) are shown, it's easy to choose.

In this thread at some point it says that you have to create a special HDD file called usb.vmdk and to add it to the VirtualBox machine. This way you could access and even boot the USB drive in the virtual machine.
This program dismounts (a sort of "half eject") the USB drive before the VM startup and remounts it after it closes. This way it prevents data corruption and the changes made inside the VM (adding/erasing files/folders) are visible after.



#39 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 07 June 2013 - 05:16 PM

If I run Start_VM.exe for Oracle VBox from a fresh boot (win 7 -64-bit) then it fails to run VBox.

If I run VM Virtual Box Manager and then run Start_VM.exe it works. If I then close VBox Manager and run Start_VM.exe it still works.

Is there a way to make Start_VM.exe work from a fresh boot so I don't have to run VBox Manager or am I doing something wrong?



#40 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 07 June 2013 - 05:49 PM

It's showing the message "Unable to launch VirtualBox !"? That's strange...
On my computer doesn't do that but I have Windows XP...
Could you please create a shortcut to that VirtualBox VM on the desktop and try to start it after a fresh boot? Maybe even try more than once to be sure...



#41 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 07 June 2013 - 05:53 PM

Actually, the 'A'..'Z' letters that we see in a file manager in Windows are not really "drives" but "volumes".

Yes. :)

 

A drive can have more than one volume. For example my internal HDD has C and D.

Oh noes, still the same issue. :frusty:

A hard disk drive can have more than one volume.

A hard disk like device or image can have more than one volume.

A HDD is a Hard Disk Drive.

 

 

The virtual machines use physical drives (0, 1, 2, ...) not those letters, that's why is necessary to show them like that in the popup menu. But, since each corresponding volume(s) are shown, it's easy to choose.

Yes, yes, yes! :thumbsup:

 

Quick reminder ;):

A volume gets a drive letter or is mounted to a drive letter -> common terminology volume = drive

 

A volume (the thing that gets a drive letter) is accessed as \\.\LogicalDrive

 

A hard disk drive (the actual device, or "whole thing") is a disk (and contains volumes or drives) and is accessed as \\.\PhysicalDrive -> common (wrong) misunderstanding  drive = hard disk drive

 

A hard disk drive contains volumes that can be primary partitions (and get a drive letter if not hidden) or logical volumes inside extended (and they also get a drive letter if not hidden).

First hard disk drive is in grub4dos (hd0)

First primary partition (volume or drive or however the thing that gets a drive letter) on first hard disk is in grub4dos (hd0,0).

First volume (or drive or however the thing that gets a drive letter)inside extended partition is in grub4dos (hd0,4).

 

More examples:

IMDISK does NOT deal with disks (but with volumes or drives or \\.\LogicalDrives).

VDK (Virtual disk driver) deals mainly with disks or \\.\PhysycalDrives

A .vhd is an image of a disk (whole thing).

The *whatever* that you can partition (and has a MBR as first sector) is a disk (whole thing) or \\.\PhysicalDrive

 

You cannot use "drive" by itself as it may be understood both :ph34r: as volume or \\.\LogicalDrive (more common) or as hard disk drive or \\.\PhysicalDrive.

 

You have to leave it to the good MS guys to mix the terms (and shake them well) :whistling:.

 

:cheers:

Wonko



#42 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 07 June 2013 - 06:37 PM

It's showing the message "Unable to launch VirtualBox !"? That's strange...
On my computer doesn't do that but I have Windows XP...
Could you please create a shortcut to that VirtualBox VM on the desktop and try to start it after a fresh boot? Maybe even try more than once to be sure...

Same issue if run from VM shorcut:

 

Failed to open a session for the virtual machine USB Boot.

The object functionality is limited.

Result Code: E_ACCESSDENIED (0x80070005)
Component: Machine
Interface: IMachine {22781af3-1c96-4126-9edf-67a020e0e858}



#43 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 07 June 2013 - 06:58 PM

That seems to be a VirtualBox bug...

It resembles with this one: https://www.virtualb...rg/ticket/11143

 

You can try what it says there (start the exe as an administrator) and/or you can try a complete reinstallation...

 

LE: another solution is to make a batch file that will start and close VM Virtual Box Manager at Windows startup...

Or you can try to find which exe/dll specifically needs and is started by the VM Virtual Box Manager...



#44 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 08 June 2013 - 07:27 AM

I have made some small improvements on all the versions.

Attached Files


  • steve6375 likes this

#45 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 09 June 2013 - 05:24 AM

Sorry for the triple posting...

I installed Windows 7 x86 in VirtualBox (since I have Windows XP x86 installed in the real computer I can't install 7 x64). Inside it I installed VirtualBox (!) and tried the VM starter (both versions).
After every fresh boot it started ok the VM...
I don't like Windows 7 and especially x64 version but, one of these days, I will try to install it on the real computer. Maybe this way I could find an workaround for that bug...

Another thing.
I just had a "crazy" idea: since with VBoxManage.exe you can do pretty much everything (create/modify/start/delete VM) and with Qemu you can configure it 100% with command line parameters, maybe I could design an interface where the user can create or modify a VM and set its devices/parameters (including creating and adding usb.vmdk).
This way it will be easier for the user to boot from a USB drive... Maybe too easy :D
Anyway I'm interested to hear your thoughts about this...



#46 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 09 June 2013 - 05:51 AM

Hi,

 

naa, np for me, i become you writings vuia Mail and have there for an own mail-folder on my TB :)

 

a good Suggestion, maybe "QuickVBox" an newer Qemu.Configurater want in anyway good for the newer Versions

of qemu, the other are all stopped, never in developement and how ever an Dual-Head for 2 diffrent

Emulationsprogramms want be good anyway :) But  make me one favor make it as

1. Open Source (=for enable to any can help) 2. Build up a Forum for it(=For any can tell an Bug and suggestions)

and create there a download section for it (=to be this Forum / Place your' Headquarter :) )

 

In you Forum can you have a possible to support by self some VBox-Programms and Qemu Programms,

maybe as point of contact for QEmu & VBox Hobby Programmer and around if it.

Some Forum/Page i think it's not exist an

" Happy Emulations Hobby Programmer Portal"

(this is the Point of Contact for all Emulations-Programmer")

 

and there with can you add at all under one Roof,

free and Open Source and one Link to Reboot.pro as Syster-Board :)

 

is this not an Suggestion for you ? And maybe at all who don't know were they can go

to become a real help in Qemu and the Programmer who can announce they active

Programs for Qemu and VBox :) In WinNT and Linux

(btw, i get at moment a helping hand on #Moondrake and #Openmandriva ,

the back given Mandrake to the Community from Jean Manuel Croset  :) )

 

So can you Build up a Portal for all the Peoples who use VBox and Qemu

and other VM's "The Virtual Mashin's Portal" or easy "The VM Portal"

 

but take a look for to be at all Free or open Source ;)

 

best regards

Blacky

 

 

Sorry for the triple posting...

I installed Windows 7 x86 in VirtualBox (since I have Windows XP x86 installed in the real computer I can't install 7 x64). Inside it I installed VirtualBox (!) and tried the VM starter (both versions).
After every fresh boot it started ok the VM...
I don't like Windows 7 and especially x64 version but, one of these days, I will try to install it on the real computer. Maybe this way I could find a workaround for that bug...

Another thing.
I just had a "crazy" idea: since with VBoxManage.exe you can do pretty much everything (create/modify/start/delete VM) and with Qemu you can configure it 100% with command line parameters, maybe I could design an interface where the user can create or modify a VM and set its devices/parameters (including creating and adding usb.vmdk).
This way it will be easier for the user to boot from a USB drive... Maybe too easy :D
Anyway I'm interested to hear your thoughts about this...


#47 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 10 June 2013 - 08:29 AM

Ok, thanks.

Meantime I have made some other small improvements to the GUI version:
1. In the VMs list drag'n'drop can be used to rearrange entries;
2. Since VirtualBox is using both '\' and '/' in storing path of VMs (in "VirtualBox.xml"), I had to implement both of them in my code.
And, yes, I know that both are normal to be used but it's a little odd because in both cases the VMs are on a Windows system.
3. Before starting the VM is checking the USB drive(s). If it/they doesn't/don't seem accessible it warns the user.
4. When it saves the VMs list on HDD it creates a backup of the previous list first.
5. Some other small bugfixes.



#48 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 11 June 2013 - 05:43 PM

I have made some improvements to the interface of the GUI version:
 

Clipboard01.png

 

Clipboard02.png

 

Clipboard03.png



#49 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 11 June 2013 - 05:49 PM

whant maybe good if you named you packs per version or date for decide between the packs /versions :)

looks realy nice, a very nice Gui and a realy well working Systemedit :)

 

i have select a usb with 16 Gig but take it not as C: in vbox :\

but i think it's the bug who you was speak about..

 

on Exe-parameters an [edit] button who automatical check the VMtype and open an spezialy

Parameters-editor for the VM's to create by click and select the parameters and by [Okey] button include in the exe-parameters text frame from

 

EXE parameters[________________][Edit]

 

best regards

Blacky


Edited by Blackcrack, 11 June 2013 - 06:44 PM.


#50 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 12 June 2013 - 01:49 AM

whant maybe good if you named you packs per version or date for decide between the packs /versions :)

 

The exe version (in FileInfo) was changed every time lately but you're right, I will add information about version number to my posts...

 

looks realy nice, a very nice Gui and a realy well working Systemedit  :)

 

Thanks.

 

 

i have select a usb with 16 Gig but take it not as C: in vbox :\

but i think it's the bug who you was speak about..

 

Sorry, but the automatic creation of usb.vmdk and adding it to the VM is not yet implemented. I know that you want a program that will do all and, in a way, that's my goal too, but the thing is, looks like we're the only ones interested in doing this... And since it's not so easy modifying my program to do it, right now I'm not so sure it's worth the work...

 

on Exe-parameters an [edit] button who automatical check the VMtype and open an spezialy

Parameters-editor for the VM's to create by click and select the parameters and by [Okey] button include in the exe-parameters text frame from

 

EXE parameters[________________][Edit]

 

That's not so easy to implement too... There isn't a file from where you can read these parameters so my program will have to read the configuration of the VM and translate each of its characteristics into an exe parameter. Which is very hard work...

But, if you already created the VM in VirtualBox, you don't need to input any exe parameter, just add the VM ID and it will work fine...






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users