Jump to content











Photo
- - - - -

"Create a System Image" VHD to VM - How to Make It Bootable?


  • Please log in to reply
9 replies to this topic

#1 binam

binam

    Member

  • Advanced user
  • 38 posts
  •  
    United States

Posted 04 October 2013 - 07:05 PM

"Create a System Image" VHD to VM - How to Make It Bootable?

 

Win7sp1_Ultimate_64bit - I used "Create a System Image" to make a .vhd of an existing install --

of course it produces a "WindowsImageBackup" Folder w/ multiple files several folders deep --

 

I renamed the main .vhd image file to " 7.1sysimage.vhd ",

then used the standard bcdedit cmd lines to make it Native Bootable:

 

bcdedit /copy {default} /d "V:\7.1sysimage.vhd"
... device vhd=[V:]\7.1sysimage.vhd
... osdevice vhd=[V:]\7.1sysimage.vhd

 

I also used the approach in MS KB 223188 http://support.microsoft.com/?kbid=223188

so that Native Booting from the VHD will write to its own registry,
and not the existing install from which it was cloned --

 

"proved" by creating a file on the .vhd and not seeing it when booting back into the existing install.

 

So far, so good -- now, I realize that using "Create a System Image"
to make a VHD from an existing install is probably the lazy man's way,

but I plan to do it the "proper way" next,
by learning to use both imagex & DISM to do it.

 

But still, I'd like to learn something from this lazy man's approach --

so, when I try to boot this vhd from VirtualBox 4.2.18,

of course I get the error " FATAL: INT18: BOOT FAILURE ".

 

( When I use VMWare Standalone Converter to make a VM from this same existing install,

it runs fine in VirtualBox w/ the same settings (I/O APIC, SATA drive, etc) --

so I'm pretty sure it's because I've ONLY lifted the Boot partition, and not the SYSTEM partition,

from the Backup Image -- in other words, if I attach the V:\ 7.1sysimage.vhd,
there's no "Boot" folder, no "bootmgr" file, no "BOOTSECT.BAK" file. )

 

But wait - is this .vhd "Active" ? No .... so I attach it, then in Disk Mgmt, Rclick & set "Active".

Start it up again in VirtualBox, now get a more encouraging error :

 

A disk read error occurred

Press Ctrl+Alt+Del to restart

 

so ... I've read about some different commands to properly set the boot information, such as :

 

"bootsect.exe /NT60 F: /FORCE /MBR" , and

"bootrec.exe / fixmbr X:\ boot\ bootsect.exe / nt60 all / force"

 

but I'm just not clear on which command(s) to use,
or where to run them from,
or how to run them --

since I can't even boot the .vhd from the VM - should I attach it,
then \cd into it from a CMD line from the existing install?

 

and then run bootsect.exe or bootrec.exe from my WAIK install?

 

and also - when someone can help me understand WHAT to do,

will you also kindly help me understand exactly what the command(s) is doing?

 

Thanks very much for any helps ~



#2 binam

binam

    Member

  • Advanced user
  • 38 posts
  •  
    United States

Posted 04 October 2013 - 11:09 PM

Ok - I just tried this, with no change to the error message:

 

bootsect /nt60 o: /force

 

I attached the .vhd, then opened Deployment Tools CMD prompt,

& navigated to Tools\PETools\amd64 & ran the command.

 

Detached, then restarted VBox.

 

I sure will appreciate one of the Masters here to have a look at my request --

I'm quite sure it will be child's play to point out what needs done, and why.

 

Thanks again

 

btw - is there any means to edit a post? or does it depend on reaching a minimum # of posts ?



#3 binam

binam

    Member

  • Advanced user
  • 38 posts
  •  
    United States

Posted 05 October 2013 - 01:43 AM

Now, using 7zip I extracted bootrec.exe from a 64bit Recovery USB, then ran the following at the Deployment Tools CMD prompt:

 

bootrec.exe o: /fixmbr

bootrec.exe o: /fixboot

bootrec.exe o: /rebuildbcd

 

but still no change - same error.

 

well, i'll keep wildly thrashing about, using a shotgun approach - as grandpa would say:

"even a blind squirrel can get lucky & catch a nut, now & then".

 

if I truly understood what I needed to do, then I'd have zeroed in with the precision of a sniper,

and would've posted a tutorial on How to do it, vs. this HELP request.

 

eventually, in some time zone of the world, one of the Masters here will log on & read this,

hopefully understand my sincerity & efforts, and we will have a solution to something

which I'd bet $$$$ many others have a problem with, too --

 

Best!



#4 steve6375

steve6375

    Platinum Member

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

Posted 05 October 2013 - 10:15 PM

if there is no system partition then it hasn't got all the boot files.

Did you try mounting the VHD and then using bcdboot?



#5 binam

binam

    Member

  • Advanced user
  • 38 posts
  •  
    United States

Posted 05 October 2013 - 11:13 PM

Thank you for having a look here - i just installed a new ssd, and it will take me just a little bit to get back to my project-challenge.

 

I can follow your logic - I can mount the vhd, then call bcdboot?  I haven't known about that one ....

so right now I google it quick, and find a scott hanselmann piece about it ....

http://www.hanselman.com/blog/SwitchingMyWindows7BootDiskFromDToCWithBCDBootRatherThanBCDEdit.aspx

 

so just a quick skim through .... bcdboot should basically CREATE a boot sector?

 

ok, i will get back to it after dinner here and so forth .... again, thanks .... sometimes the slightest hint can create understanding,

and btw i also mean to have a thorough look into your RMprepUSB project & website as soon as I can sort out this challenge --

all of this ties into a thorough understanding & ability to successfully implement all of it.



#6 binam

binam

    Member

  • Advanced user
  • 38 posts
  •  
    United States

Posted 06 October 2013 - 05:02 AM

ok, created a fresh System Image after running Startup Repair from Recovery PE, booted into both OS installs to make sure everything was functioning cleanly, bcdedit clean too.

 

Mounted the image - it was given "G" drive letter, opened CMD as Admin, ran the command:

 

bcdboot c:\windows /s g:

 

returned the command "boot files added" or somesuch --

now I open G:\ in xplorer2 & I see " G:\Boot " Folder, as well as bootmgr file.

 

Now set G:\ "Active", unmount/detach, then create new VM in VirtualBox,

but still get error :

 

A disk read error occurred

Press Ctrl+Alt+Del to restart

 

so ..........  what do I need to do/to check next?

 

At least this far I learned about bcdboot.exe & its commands,

and saw that both a *:\Boot folder & bootmgr file were added where they did not exist before.

 

I think there's probably another couple commands I need to perform,

to connect it all together & make sure all the parts are talking to each other properly?

 

btw - the Storage settings are the same as for a successful .vmdk image of the same existing install,

generated by VMWare Standalone Converter.

 

- as Steve6375 said, System Image creates a separate "System".vhd and a separate "Operating System/Boot".vhd --

so at least bcdboot.exe began to add the folders/files usually found in the separate 100 mb "System" partition,

to the "Operating System/Boot" partition.

 

I faithfully await further coaching ~

 

ps - Steve6375 - my googling led me to one of your questions @ Technet :

http://technet.microsoft.com/en-us/library/dd744347

so, I'm reaching reaching to understand this thing (I.T. is my 'hobby', not my profession)

 

----------------------------------------------------------

 

next try: mounted w7sp1_64ibt in VBox, booted to it, ran Startup Repair -- it gave a couple errors,

so I select Yes do the repair, but when I reboot from hdd it still errors !!  fuuuuuuuuuun times !

 

-------------------------------------------------------------

 

next try: cd CMD prompt as admin to

 

g:\>bcdboot g:\windows

 

still ..... the error


Edited by binam, 06 October 2013 - 01:12 PM.


#7 cdob

cdob

    Gold Member

  • Expert
  • 1343 posts

Posted 06 October 2013 - 10:02 PM

Mounted the image - it was given "G" drive letter, opened CMD as Admin, ran the command:
 
bcdboot c:\windows /s g:

What about: bcdboot g:\windows /s g:
 

A disk read error occurred

That's another case. MBR or PBR dosn't match. System Image and Virtualbox uses different CHS LBA translation.
Try Bootice, write MBR and PBR at VHD image.
http://reboot.pro/to...-v078-released/

#8 binam

binam

    Member

  • Advanced user
  • 38 posts
  •  
    United States

Posted 06 October 2013 - 11:23 PM

@cdob - Thank You for stopping by, I've learned from you here, & over at cd911 --

 

I like to ack. these responses, because it takes me a little while to go study the suggestions before I try them,

so I'll likely not get to try Bootice until a day or so -- I did do the command you suggested, same error result ....

 

so, logically it makes a great deal of sense that if these apps use a different language for how to talk to the hard disk,

then what hope is there to have a successful conversation until a common language is implemented? so, Thanks for this tip ....

 

A metaphor for this whole exercise .....  it's like learning to change a flat tire whilst the car is perched on the edge of a cliff-road !

.... not very likely to encounter every day, but if you get the skillz to do this .... then just think how easier the flat-land will be!!  :)

 

so .... today i took a little break, & using Disk Mgmt GUI, created a vhd, mounted my custom w7sp1ultx64 iso,

installed to the vhd in about 3.5 minutes !!!  (ssd + 16 gb RAM), then went on my merry way w/ a successful vhd.

 

but as stated before, i will learn what it takes to make an obstinate situation comply with boot-ability,

and that's what this forum kinda represents, right ?  re - boot  :)   [to boot again, to know again all about "the boot"]

 

Best!



#9 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 07 October 2013 - 10:08 AM

@binam

Some info, not necessarily applying to your case, but likely to be part f the issue.

The bootability depends (largely) on the BIOS on the machine (or virtual machine) that can use (or ignore, or "fix - on - the -fly") some values.

A "strict" BIOS (an example is the BOCHS/Qemu one) will want that a disk has a CHS geometry suitable to the size of the volume.

So, a smallish image (let's say a 100 Mb one) will need a 16/63 HS geometry, whilst a largish one (larger than the 8 Gb CHS barrier) will have the now "standard" 255/63 HS.

To this you add that some of the Windows bootsectors, though the system only use LBA, will check for consistency the HS values in the bootsector.

There are  ways to "correct" this behaviour by correcting the bootsector code, see:

http://blog.clemens....ndows_3170.html

http://www.911cd.net...ic=21702&st=129

http://reboot.pro/to...sector/?p=73205

 

JFYI, one among the reasons why I put together the MBRBATCH:

http://reboot.pro/to...atch-001-alpha/

was to deal/experiment with these different possible geometries when partitioning/formatting.

 

:cheers:

Wonko



#10 binam

binam

    Member

  • Advanced user
  • 38 posts
  •  
    United States

Posted 07 October 2013 - 10:42 AM

@wonko ~ Thank You for these reference-suggestions - especially reminding of the power of the batch

(the original & still king, despite-whatever the current version of Powershell ;)

 

... it's time for me to cycle back again thru the study pdfs i've made from yourself, Ranish, the Starman, etc., awhile ago -

hopefully at a higher understanding on this spiral-ladder-of-learning :good:






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users