Jump to content











Photo
- - - - -

USB Boot Grub4dos into .VHD


  • Please log in to reply
4 replies to this topic

#1 The Mitchelli

The Mitchelli
  • Members
  • 2 posts
  •  
    United Kingdom

Posted 03 March 2014 - 11:29 AM

Hi,

 

Greetings all. I am new to this community so I hope I am in the right place and am asking in the right way.

 

I am trying to make a USB bootable windows 8.1 vhd that I can use on my work windows laptop via virtual box, then boot natively when plugged into my Mac Mini via Grub4Dos

 

I had created a windows to go installation which behaves exactly as I want on my Mac, but I can't use it on my work laptop (which has access to the bios disabled so I can't set it to boot) hence the need for a Virtual PC of some kind.

 

I created a .VDH of windows with a fixed disk.

I used RMPrepUSB to create a bootable USB with Grub4dos

I copied over the easy2boot files

I create a copied my vhd to _ISO\VPC\USBBoot.vhd

I defragged the USB and ensured all files are contiguous

Under MAINMENU folder I created a menu file ZZZF4BootVPC.MNU

 

in that folder I have the following:

 

iftitle [if "%GFX%"=="" if not exist NOF4HD] ^F4 Windows 8.1 VHD [F4]\n Windows 8.1 VHD
map (hd0,1)/VPC/USBBoot.vhd (hd0)
map --hook
chainloader (hd0)+1
 
When testing with QEMU in RMPrepUSB v2.1.716 I get the following error:
 
map (hdo)/vpc/USBBoot.vhd (hd0)
 
Error 17: Cannot mount selected partition
 
Press any key to continue...
 
This is way beyond my level of understanding so I have had to scour the web for a mix of resources and try to create my own solution. I clearly have something wrong (although was mildly pleased the usb boots and the menu works. 
 
Any help appreciated.
 
 


#2 steve6375

steve6375

    Platinum Member

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

Posted 03 March 2014 - 11:42 AM

First the VHD needs to be of the 'Static' type for grub4dos to directly boot from it. i.e. if you made a 20GB virtual disk, the VHD would be 20GB.

However, when grub4dos boots a VHD, the VHD really needs to contain a WinPE RAMdrive implementation.

 

I would suggest you try a different approach by booting to bootmgr from the USB drive instead (any type of VHD can be used for this).

 

Copy bootmgr and \BCD and \boot folders to the USB drive.

Boot from WinPE (e.g. a Win8 Install ISO on a USB stick)

Run Win8 bcdboot on the USB drive

 

see http://www.rmprepusb...ls/win8vhdonusb



#3 The Mitchelli

The Mitchelli
  • Members
  • 2 posts
  •  
    United Kingdom

Posted 03 March 2014 - 12:01 PM

Thank you for your quick reply.

 

You make an interesting point with the alternative approach and it is something I would like to explore. However when looking at the link you posted it has the following warning:

 

As we are going to install a copy of Windows 8 onto a system (even though Windows 8 will actually be on an external USB drive and in a file), 

the internal hard disk boot files will be changed by Windows 8 Setup! 

This means that the Windows 8 Setup program will make you internal hard drive dual/multi bootable because it will add the entry for the Windows 8 VHD:

 

This is not what I am looking to do, as the only windows PC I have access to is my work laptop, I don't want to have the system appear dual boot and mount the .vhd

 

Would it be possible to install the windows 8 bootmanager only onto usb, then edit it, to point to a VHD on the same usb drive making it a self contained system? 

 

With regards to your point of static/ I had thought converting a VHD to fixed from dynamic was achieved the same. How can I check if a VHD is static or not?

 

Again, many thanks for your help, it is much appreciated.

 

Steve



#4 steve6375

steve6375

    Platinum Member

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

Posted 03 March 2014 - 12:07 PM

Hi

Well you won't be running Setup to install Win8 as you already have a VHD with it installed.

Presumably, you have a /boot and /bcd folder on your MAC?

Copy these to the USB drive and the VHD, then boot to WinPE and use bcdboot as in the steps in the link I posted . Or maybe you could use EasyBCD to edit the BCD on the USB drive.

 

You can check the VHD using RMPrepUSB. Use the File Info button and ask for LBA 0 - it should show you a partition table/MBR sector.



#5 steve6375

steve6375

    Platinum Member

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

Posted 03 March 2014 - 12:17 PM

P.S. This may be useful too (same process).

 

if your USB drive has grub4dos on it, you can just use 

chainloader /bootmgr

to boot to Win8






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users