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

#126 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 26 June 2013 - 07:43 PM

Again, I doubt that many will read it... For now I added this thread as a Start menu link in the installer version.
But, in the future, if many will show interest for this application, I will reconsider about creating a readme/pdf/help/site.

1.0 version

Installer: Attached File  Virtual machine starter setup.zip   826.96KB   501 downloads

Portable: Attached File  Virtual machine starter portable.zip   449.58KB   554 downloads

Sources: Attached File  Sources.zip   181.78KB   449 downloads



#127 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 27 June 2013 - 05:14 AM

well done !! :)

Tank you !!

 

edit: installing at moment XP on my' Ma's USB Stick (She's 75? how ever, crewl Computer Granny !!)

make for her an Real - XP - USB now :)))  funny.. -- it work's !!--

 

hey, idea, it is possible to integrate this coe in the Virtualbox for selecting the usb-stick as Medium ?

If yes, why do you not include you ad Developer short and include this codepart for it .. :)

Like Stephan told me, any can be Virtualbox developer and can submitting  or include code..

so, why not this :)

again, Tank you very mutch for this peace of gold :)

From now on can any installing an System on USB !!

Grate !! Thank you very mutch again !!

 

best regards

Blacky


Edited by Blackcrack, 27 June 2013 - 05:54 AM.


#128 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 27 June 2013 - 05:52 AM

well done !! :)

Tank you !!

 

best regards

Blacky

 

Thank you.

You're welcome :)

 

 

Btw, if anyone wants to modify the source code or use parts of it in another program, feel free to do so...



#129 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 27 June 2013 - 03:12 PM

hey, idea, it is possible to integrate this coe in the Virtualbox for selecting the usb-stick as Medium ?

If yes, why do you not include you ad Developer short and include this codepart for it .. :)

Like Stephan told me, any can be Virtualbox developer and can submitting  or include code..

so, why not this :)

 

 

 

I don't think that would be possible, because:
1. VirtualBox is made in C, VMS is made in Delphi (Pascal). Too different IDE's...
2. For VirtualBox developers it would of been very easy to implement the USB Boot or at least to automate the generation/adding/dismount/remount of rawdisk vmdks. But it seems they don't want that; more, it seems that this subject is kind of "touchy" for them because their answers are not so nice lately...



#130 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 27 June 2013 - 07:18 PM

Being so busy lately with the GUI version I neglected to implement the bugfixes and improvements in the nonGUI versions as well.
Here is the Qemu version for Steve (to implement in the next RMPrepUSB version):

Attached File  start Qemu VM.zip   203.05KB   441 downloads

Attached File  Sources.zip   2.44KB   407 downloads

Btw, you don't have to keep the name "start_VM". You can name it whatever you want, it will still work...



#131 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 28 June 2013 - 09:55 AM

An idea: how about choosing where in the VirtualBox's storage controllers the first/second drive will be added?
In VMS Add/Edit window for each drive I will add a combobox. When you click to change the value it will popup a list with "automatically (first available port)" + all available ports in all VM's storage controllers.


Does someone find this useful..? I'm asking because it will require a lot of work to implement and I need to know that it will be used (so it will worth implementing)...



#132 steve6375

steve6375

    Platinum Member

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

Posted 28 June 2013 - 01:56 PM

Personally I only want one USB drive.

Unless I can have two attached and have one of them seen as a 'removable' drive instead of a hard disk...



#133 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 28 June 2013 - 02:25 PM

Me too, I use only one USB drive at a time, but the question was: do you need to control WHERE the drive will be added by VMS to the virtual machine? I mean port number on SATA or master/slave/primary/secondary on IDE...



#134 steve6375

steve6375

    Platinum Member

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

Posted 28 June 2013 - 02:35 PM

The only choice I would like would be USB as 1st device or HDD as first device.

Then the VM would either boot from the USB or the first HDD. I don't really care what ports they are on except I would want the 1st HDD to be Primary Master if it was an IDE drive.

But I guess this is kind of tricky for you and it is no problem to make a separate VM for 'boot from HDD'. 



#135 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 28 June 2013 - 02:48 PM

On IDE you can do this by attaching the HDD as the primary slave and setting VMS to attach the drive on primary master or on secondary master.
On SATA you can set port count to 3, attach the HDD to 1 and set VMS to attach the drive to 0 or 2.



#136 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 28 June 2013 - 02:54 PM

Sorry, mistype on HDD on SATA, corrected...



#137 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 28 June 2013 - 06:14 PM

Kind of too soon after just releasing 1.0 final, but, you know how it's happening - often good ideas come after not before :D

1.1 Beta 1 version


Improvements:

1. Before modifying the vbox file it will make a backup in "*-prev", just like VirtualBox Manager does.
2. When it has to detach a vmdk it will do it only with its own files (VMSDrive***.vmdk). Previous version detached any vmdk found in VM storage controllers, but this way could of delete a "legitimate" vmdk manually attached by the user.
3. It detects and solves the GUID "clashes" automatically when creating another vmdk. It was a small chance anyway that a "clash" will occur but still...
4. Now it tries to add the drive(s) in all the storage controllers not just the first.
5. Some small improvements to the error messages.

 

LE: link removed, you can find a better version in the next posts...



#138 steve6375

steve6375

    Platinum Member

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

Posted 29 June 2013 - 12:23 AM

Hi David

I seems to be having lots of problems ever since I started to configure VMs with

 

SATA controller (empty) 1 port

SCSI controller + VHDD

 

and

 

SATA Controller - SCSI Port 0 = VMSDrive000.vmdk   SCSI Port 1 = VHDD

 

 

First I got 'Access denied to the VMSDrive000.vmdk, but it would run OK from the VBox Manager and non-SCSI VMs would run OK from VMS.

Now I cannot run any VM from VM Starter as it says that VBox is still running. If I reboot then I get the same thing, first can't run the SCSI VMs and then can run any VM using VMS.

Have you tried any SCSI VHDDs or is it just me? I never had a problem before I started using SCSI VMs but that may be just a coincidence...??



#139 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 29 June 2013 - 02:29 AM

I tried before with SCSI, I tried again now, on my computer is fine.

Which VMS version are you using?
Which application showed "Access denied", VMS or VB?
When VMS says that VBox is still running, what is the exact message?

It may be possible that, started from VMS, VB is crashing trying to run that machine with SCSI and a part of it still stays in memory making VMS believe that it's still running.
Could you please send me the vbox file, so I can have a look and maybe even test it?



#140 steve6375

steve6375

    Platinum Member

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

Posted 29 June 2013 - 08:01 AM

I have tried last 3 versions of VMS. Currently 1.1 is in use. (Portable -  I just copied to exe file to the Desktop.)

Files attached. 

If I do a fresh boot and run the 1st or 2nd VM (USB2test or TESTVMS)  using VMS then they run OK

 When I run BOOT USB VT ON from VMS is just seems to wait a while and then return back to the VMS Starter form.

If I run VBox Manager then the machine state is 'Aborted'.

Now anything I try to run from VMS gets a 'Out of time waiting for VBoxSVC.exe to close...' message.

If I kill the process in Task Manager, then TSTVMS it runs OK, if I run BOOT USB VT ON from VMS - same -thing - it just returns back to the VMS form with no error message and the status in VBox Manager is 'Aborted'.

cheers

Steve

P.S, If I try to run the aborted VM from VBox Manager I get this VBox error message:

Failed to open a session for the virtual machine USB BOOT VT ON.

No error info.

Result Code: RPC_S_SERVER_UNAVAILABLE 0x800706BA (0x800706BA)
Component: ProgressProxy
Interface: IProgress {c20238e4-3221-4d3f-8891-81ce92d9f913}

 

P.S. I seem to have fixed the VM now by removing the SATA controller and setting the VHDD to port 1 instead of port 0

Attached Files



#141 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 29 June 2013 - 08:17 AM

Thank you.

I will try to find what is the problem.

It's strange that VBM can't start it either, which tells me that could be something wrong in the vbox file...

 

Just now I took quite a scare... Because of a Paragon Backup&Recovery 2012 error, all my data from D volume (including the latest VMS sources) disappeared.

I was able to recover it on my USB HDD but I can't be sure that it's 100% ok.

Now I'm copying the data back. It will take some time...



#142 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 29 June 2013 - 08:45 AM

Just looking in the vbox file I see that in storage controllers section (end of the file) there are 3 drives attached but only the VMS vmdk is declared in the Harddisks section (the beginning of the file).

Which application showed "Access denied" in the first place, VMS or VB?



#143 steve6375

steve6375

    Platinum Member

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

Posted 29 June 2013 - 09:08 AM

VMS caused no error (either from VMS or VBox) - the VMS form disappears, there is a wait of 6-10 seconds and then the VMS form re-appears - no error mesage or anything.

I was getting the 'access denied'  error from VBox (poss. VMS crashed and left the file open?).



#144 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 29 June 2013 - 09:39 AM

More probable VB crashed because only VB triggers the close of VBoxSVC.exe after VirtualBox.exe is closed. VMS never opens or closes VBoxSVC.exe, just checks if it's closed and warns the user.

And, btw, it's not impossible to make VMS crash but it's very improbable because I implemented n-th safeguards which localize and deal with the problem...

 

It could of been a "clash" between VB and VMS over the vbox or, more probable, over the vmdk file. If in that moment the HDD was intensively used, it may have delayed their write and VB couldn't find valid files (or access them because VMS is setting exclusive share when it writes the vmdk file) when was loaded...

I'm thinking of implementing a way to only flush these files on disk (not the entire volume) - maybe this will fix the problem..

 

If it's happening again, just stop for the moment (don't start VMS and VB anymore) and send me both vbox and vbox-prev files (to compare them).



#145 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 29 June 2013 - 11:30 AM

1.1 Beta 2 version

 

LE: link removed, better version in the next posts...

Changes:

Bugfix: in rare circumstances it could add the vmdk to the storage controller even if the PortCount value wouldn't allowed.
Preventive bugfix: the vbox and the vmdk files are flushed to disk before opening the VM.



#146 steve6375

steve6375

    Platinum Member

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

Posted 29 June 2013 - 06:25 PM

Just tried you new version and did this

 

1. I have a VM set up as 

 

IDE Primary Master = (none)

IDE Primary Slave = VHDD

 

Then added a new entry into VMS with a USB Port 1 stick defined --->> VMS puts a vmdk at the IDE Secondary Master....and booted off the VHDD!!!

 

Is the logic broken somewhere?

Thanks

Steve



#147 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 30 June 2013 - 02:24 AM

Well, I tried and it doesn't do this with my vbox's...
Most probably there are some unusual "leftovers" in the vbox file which make VMS "think" those ports are occupied.
Could you please send me that file so I can check this and eventually adapt VMS to these errors..?
Thank you.



#148 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 30 June 2013 - 06:32 AM

In the meantime I found and implemented a way to reduce the number of writes into the vbox file :D
Trying to do the same for the vmdk file...



#149 steve6375

steve6375

    Platinum Member

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

Posted 30 June 2013 - 06:47 AM

Here are the Vbox and vbox-prev files.

 

I had a working config by manually setting the VMSDrive000.vmdk created by VMS as IDE Primary Master and the VHDD was IDE Primary Slave.  (that was the only way I could get it to boot from the USB stick)

I then ran VMS and it booted from the VHDD.

 

PREV

IDE Pri Master = VMSDrive000.vmdk C:\Users\Administrator\.VirtualBox\Machines\USB2 Boot\VMSDrive000.vmdk

IDE Pri Slave = VHDD

 

NOW

IDE Primary Master = (empty)

IDE Pri Slave = VHDD

IDE 2nd Master = VMSDrive000.vmdk  at C:\Users\Administrator\.VirtualBox\Machines\USB2 Boot\VMSDrive000.vmdk

 

 

VMS seems to have removed the VMSDrive.vmdk, created a new one with a new ID and then added it to the 2ns Master slot?

Attached Files



#150 DavidB

DavidB

    Silver Member

  • Developer
  • 611 posts

Posted 30 June 2013 - 08:51 AM

Thank you.

 

Well, usually it's not a good idea to assign/move/delete the VMSDrive***.vmdk file manually.
But I adapted the code to work with that.

1.1 Beta 3 version

Changes:

Improvement: it will write in the vbox file only if it's absolutely necessary. This way it will decrease the chances of a "clash" between VB and VMS.
And the above improvement...

 

LE: link removed, better version in the next posts...

Working now to reduce the number of writes in vdmk files also...






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users