Boot Win 7 VHD on Bare Metal PC from Empty Drive
#26
Posted 18 November 2011 - 10:51 PM
#27
Posted 18 November 2011 - 11:25 PM
Didn't catch sense of your idea of switching to USB / VPC from a tool to create & manipulate native boot VHDs (which is better to test from an internal drive).
Some usability ideas & Win 7 native boot VHD goals:
Native VHD Support in Windows 7
#28
Posted 19 November 2011 - 03:28 PM
MS Virtual PC doesn't fully support native boot VHDs - Hyper-V does.
Speaking of VHD support, this is the error code I get when trying to boot from a differenced VHD file, created as per my batch file (ergo, as per your instructions). This is the VHD I'm basing on the sysprepped Win7 VHD (which works fine).
0xC03A000B: The system does not support this version of the virtual hard disk. The block size is invalid.
English translation: The system does not support this version of the virtual hard disk. The block size is invalid.
Didn't catch sense of your idea of switching to USB / VPC from a tool to create & manipulate native boot VHDs (which is better to test from an internal drive). ../public/style_emoticons/default/dubbio.gif
I actually installed MOA241, and it's exactly what I wanted. To quote the author:
The MOA project started in 2003 as a plugin for Bart Lagerwijs PEbuilder. This plugin allowed to run VMware Workstation 4.5.2 from a Windows based LiveCD
Roll along 2011, and what you have is a true universal bootable USB/DVD with Windows 2003 x32 (SMP) running from a RAM disk, with an optional collection of various VHD and VMDK applications. The test ISO i made was about 350mb - with no VM apps installed, but a big set of drivers.
It will do dotnet with some tweaking, allowing stuff like Visual BCD Editor to be added, and of course it has no problem running the 32bit version of BCDEDIT from Win7.
And that means I can code C# applications that can be deployed from a live boot environment
Checked out that link, there are just so many M$ links to VHD stuff these days it's hard not to get lost. But it is good that we actually "going with the flow" rather than trying to hack something in to the operating system that isn't meant to be there. If Microsoft could just organise all their VHD information into a centralized location, then I wouldn't have ended up here to get Windows 7 too boot of a USB disk. It's really quite absurd, since I've later found Microsoft has complete video tutorials on this exact subject... but I only found them because I was using the right keywords in google. Keywords that someone who had never actually deployed a VHD to boot natively wouldn't even know.
#29
Posted 19 November 2011 - 03:36 PM
Once you start using MS Tutorials or any Blogs info on VHDs and trying to play with VHDs, you quickly realize how incomplete these Tuts are. Try for example to resize in VHD Resizer a VHD created with Disk2VHD. That prompted me to write several Tuts here to accumulate useful info scattered in small pieces all over the web or gained from experience.
#30
Posted 20 November 2011 - 07:06 PM
I'm presently reading http://www.microsoft...&displaylang=en which is quite detailed, but in a good way. 40 pages worth. Has this gem in a native boot example:
imagex /apply ”C:SourcesWindows 7 EnterpriseSourcesinstall.wim” 1 v:
Maybe I just never noticed that in other tutorials... but it beats the heck out of having to clone disks.
BTW I'd don't know if you've ever heard of the very nerdy challenge to find google search terms that will return exactly 2 results, but I found one yesterday.
http://www.google.co...ot differencing
-
COM Error Codes (VOLMGR, BCD, VHD, SDIAG)
msdn.microsoft.com/en-us/library/.../dd542650(v=vs.85).aspx 8 Sep 2011 – COM Error Codes (VOLMGR, BCD, VHD, SDIAG) .... The boot disk experienced failures. ... ERROR_VHD_INVALID_BLOCK_SIZE; 0xC03A000B ... in the identifiers of the parent virtual hard disk and differencing disk. ... -
Native Boot VHD - reboot.pro
reboot.pro › Groups › Windows Extreme › Windows 7
10 posts - 4 authors - Last post: 23 Apr 2010 A very poorly documented feature of a native-boot vhd installation is the ability to create a 'differencing' disk. Creating a differencing disk and ...
(Well I thought it was cool).
Some bad news in my MOA bootable 2003 mission - DISKPART won't play... closer inspection shows there are 3 kernel side .sys files that simply aren't there. I think I will actually paste the M$ diagram here, since I'll probably never be able to find it again, and it could be useful.
#31
Posted 20 November 2011 - 07:12 PM
Sorry to note that Diff VHDs created from a detached read only Base VHD file in Disk Management
a) I've never understood the meaning of "read only VHD". Are you referring to: ATTRIB +R BASE.VHD, or is there some secret VHD flag I can't find
diskmgmt.msc can created differencing VHD's? Maybe in 2008 R2, but I sure didn't notice that option in W7.
#32
Posted 20 November 2011 - 07:23 PM
I think the format issue was expected, since MS keeps playing with VHD format and NTFS as well, and since you're into native boot Win7 Diffs, it makes sense to abandon the 2003 mission altogether, especially keeping in mind, how many people are eagily waiting now for your new VHD Manipulator GUI.
#33
Posted 20 November 2011 - 08:25 PM
To configure booting to a differencing VHD
1. To create differencing VHDs that have a parent/child relationship with the VHDs you created previously, type:
diskpart
create vdisk file="D:W2K8R2_Diff0.vhd" parent="D:W2K8R2.vhd"
exit
2. To boot to the differencing VHDs, you need to update the BCD store to reflect these intended changes. To do this, type the following commands, and use the GUIDs for the Windows 7 VHD boot entry and the Windows Server 2008 R2 VHD boot entry that you created in Steps 8 and 9. You can run the bcdedit /enum all /v command to view the appropriate GUIDs.
BCDEdit -store c:BootBCD /set {24761cb1-3f82-11de-8235-0003ffa37a4a} device VHD=[D:]W2K8R2_Diff0.vhd
BCDEdit -store c:BootBCD /set {24761cb1-3f82-11de-8235-0003ffa37a4a} osdevice VHD=[D:]W2K8R2_Diff0.vhd
This concludes the steps that are required for this advanced deployment scenario.
Edited by sfinktah, 20 November 2011 - 08:27 PM.
#34
Posted 20 November 2011 - 08:31 PM
I think the only thing left is for me to try it from a WinRe/WinPe session rather than another Windows 7 session.
So what is this tool I'm writing actually going to do? I haven't delved deeply into VHD, but I have the API and the technical specs in tabs at the moment... AFAIK you can make em, you can compact em, you can shrink em, merge em, difference them, copy them... am I missing anything?
Surely there is a tool for this already... it's just too obviously something that needs to exist.
These are the exposed API functions that are available in Windows 7 to manipulate VHDs. (i.e., what I can make a program do):
Topic Description
AttachVirtualDisk
Attaches a virtual hard disk (VHD) or CD or DVD image file (ISO) by locating an appropriate VHD provider to accomplish the attachment.
BreakMirrorVirtualDisk
Breaks a previously initiated mirror operation and sets the mirror to be the active virtual disk.
CompactVirtualDisk
Reduces the size of a virtual hard disk (VHD) backing store file.
CreateVirtualDisk
Creates a virtual hard disk (VHD) image file, either using default parameters or using an existing virtual disk or physical disk.
DetachVirtualDisk
Detaches a virtual hard disk (VHD) or CD or DVD image file (ISO) by locating an appropriate virtual disk provider to accomplish the operation.
ExpandVirtualDisk
Increases the size of a fixed or dynamically expandable virtual hard disk (VHD).
GetStorageDependencyInformation
Returns the relationships between virtual hard disks (VHDs) or CD or DVD image file (ISO) or the volumes contained within those disks and their parent disk or volume.
GetVirtualDiskInformation
Retrieves information about a VHD.
GetVirtualDiskOperationProgress
Checks the progress of an asynchronous virtual hard disk (VHD) operation.
GetVirtualDiskPhysicalPath
Retrieves the path to the physical device object that contains a virtual hard disk (VHD) or CD or DVD image file (ISO).
MergeVirtualDisk
Merges a child virtual hard disk (VHD) in a differencing chain with one or more parent virtual disks in the chain.
MirrorVirtualDisk
Initiates a mirror operation for a virtual disk.
OpenVirtualDisk
Opens a virtual hard disk (VHD) or CD or DVD image file (ISO) for use.
SetVirtualDiskInformation
Sets information about a virtual hard disk (VHD).
If your requirements fit inside that, it's not difficult to make a quick app.
Edited by sfinktah, 20 November 2011 - 08:36 PM.
#35
Posted 20 November 2011 - 08:54 PM
When we see the new VHD Manipulator Alpha, we'll go from there. Regarding GUI theme & appearance, something along EasyBCD GUI looks simple, intuitive and attractive.
I think, especially tricky parts are creating chained VHDs and resizing them (verifications wise) - to begin with, there is a need to understand, how VHD Resizer determines which VHD can be resized or converted. The resizing feature is quite important, since initially one often creates a VHD "in the dark".
What I'd suggest is to backup one partition of a multiboot drive to VHD with Disk2VHD, and try shrinking that VHD (its a whole partitioned drive with one partition copied and others empty), and analyzing how it goes. Lets not forget, resizing a VHD can affect its OS ability to boot in some scenarios, so it may require BCD update.
#36
Posted 20 November 2011 - 11:57 PM
100 mb Windows Boot
32 gb Windows System + Crysis II
64 gb store for "images" (.vhd and other backups i made).
But when I used Paragon to make the VHD, I just told it not to copy the images partition, and the resultant VHD was about 22gb.
Actually, I used Paragon to make it into a VMDK, then starwind to turn that into a VHD. So I'm pretty much in the dark about it's situation... I also cleared up a lot of space on it, and would like to shrink it. So lets play with that.
#37
Posted 21 November 2011 - 12:03 AM
So it's just going to copy it...
#38
Posted 21 November 2011 - 12:08 AM
A.K.A. it won't resize a differencing VHD. Which makes perfect sense to me, since I am a long time user of VMware, and I know that you can only resize a disk once you have removed or merged all the snapshots.
If you did shrink a parent VHD, then any VHDs that were based on it wouldn't work anymore.
Am I missing something?
#39
Posted 21 November 2011 - 12:13 AM
This is my VHD (Disk 2)... just for the heck of it, I'm shrinking the partition to see what happens.
Edited by sfinktah, 21 November 2011 - 12:14 AM.
#40
Posted 21 November 2011 - 12:51 AM
#41
Posted 21 November 2011 - 01:23 AM
It will create one VHD for each disk on which selected volumes reside. It preserves the partitioning information of the disk, but only copies the data contents for volumes on the disk that are selected. This enables you to capture just system volumes and exclude data volumes, for example.
I see what you mean about the empty partition... not an issue with Paragon, but clearly an issue here. However, the point of the exercise still eludes me. VHD Resizer works by copying the old VHD to a new VHD. That's just what it does.
Unfortunately it either doesn't work on differential VHDs, or my particular VHD is in some way broken.
If you're telling me that sometimes it does allow you to use a differential VHD as a source image, then you have intrigued me.
Otherwise, I assume you either have to merge your VHDs, or in my case (pictured about) where the I resized the partition in the child vhd, I would run disk2vhd over the attached vhd (or mount it with imdisk).
It is indeed rather poor than VHD Resizer doesn't appear to handle a more complex VHD... but if it did, the only result you could expect would be a single merged (and resized) VHD anyway.
#42
Posted 21 November 2011 - 01:44 AM
BUT, lets stay on course for your alpha without much resizing, and see what happens.
#43
Posted 21 November 2011 - 06:22 AM
I didn't mention Diff VHDs when talking about resizing. But even with fixed Base VHDs, lets not forget that after resizing you still want to boot it - its not always possible however, just try yourself.
BUT, lets stay on course for your alpha without much resizing, and see what happen.
I think, especially tricky parts are creating chained VHDs and resizing them (verifications wise) - to begin with, there is a need to understand, how VHD Resizer determines which VHD can be resized or converted. The resizing feature is quite important, since initially one often creates a VHD "in the dark".
I think we need to clarify whether we are going to include Expandable VHDs in this tool. I would tend to say "no", and simplify our options. Your base system should really be a Fixed VHD anyway, and I'm assuming that most cloning procedures would create fixed VHDs.
What do you think?
#44
Posted 21 November 2011 - 07:38 AM
Unsurprisingly, the VHD doesn't boot. 0xc0000225. (STATUS_NOT_FOUND).
A quick google shows that this is error is commonly caused by people resizing their (real) windows drives with linux based tools, and end up changing the GUID of their windows volume. In all cases I read, the answer was to use Windows Recovery.
I would suspect this would be one of the more common errors one would get, and finding a solution would be part of what this alpha application would do.
I've certainly never had any luck with Windows Recovery on a VHD before, but Visual BCD Edit quite impressive. It will automatically create missing VHD osloader entries if you ask it nicely.
And our new entry works. Which raises a curious point, because the new entry is identical to the previous one. Yet, in some way which isn't visible in Visual or regular BCDEDIT, they are different. One boots, one says 0xc0000225. (STATUS_NOT_FOUND). I've gone back and double checked both options.
Unless your sharp eyes can see a difference that I can't...
#45
Posted 21 November 2011 - 09:48 AM
Unless your sharp eyes can see a difference that I can't...
I wouldn't define my eyes as "sharp" but the identifier (or GUID) has changed.
Wonko
#46
Posted 21 November 2011 - 09:55 AM
I wouldn't define my eyes as "sharp" but the identifier (or GUID) has changed.
That's because, just like you, it's Globally Unique.
-----------[i'm pretending this is my sig]-----------------------------------------------------------------------------------------------------------------------------------------
#47
Posted 21 November 2011 - 10:02 AM
(I overlayed the two)
------------------------------------------------------------------------------------------------------------- my pretend sig again --------------------------------------------------------------------------------------------------
Edited by sfinktah, 21 November 2011 - 10:03 AM.
#48
Posted 21 November 2011 - 10:37 AM
... and that's what you get for installing to expandable VHDs without enough free disk space to expand the VHD.
Edited by sfinktah, 21 November 2011 - 11:11 AM.
#49
Posted 21 November 2011 - 01:02 PM
As to including expandable VHDs - the tool should allow to do as a minimum everything Disk Management Console can do with VHDs and more, and that includes of course working with dynamic and (guess what ) differencing VHDs. If resizing is limited to making a smaller or larger VHD file copy after resizing its underlying partition, it should be no problem to include as well.
Of course, a physical drive where VHD is saved should have enough free space to hold a dynamic VHD when maxed out or booted from. Dynamic VHDs are quite attractive, when carrying several different OSs in VHDs on an external small drive or USB Thumb - because only one OS can boot at a time, so total space required is much less then sum of maxed dynamics. The physical drive should also have extra space for redirected Paging files.
#50
Posted 21 November 2011 - 05:00 PM
Bcedit output may be similar. But bcdedit dosn't list raw data.Which raises a curious point, because the new entry is identical to the previous one.
There is no drive letter stored in \boot\bcd.
There is a binary data relating disk signature and partition layout stored.
\boot\bcd is a registry hive. Load offline file and compare raw data.
Compare: Fixing Disk Signature Collisions
http://blogs.technet...08/3463572.aspx
Also tagged with one or more of these keywords: vhd, bare metal, boot, win 7, grub4dos
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users