Jump to content











Photo
* * * * * 1 votes

Win7 / PE Hybrid


  • Please log in to reply
20 replies to this topic

#1 jeffspeff

jeffspeff

    Newbie

  • Members
  • 13 posts
  • Location:Kentucky, USA
  •  
    United States

Posted 24 July 2010 - 09:44 PM

So, I've been messing around with WAIK for a while now, and I've made some pretty good wim images. However I wasn't satisfied. What I've tried to do is install Win7 to a VHD file. I then booted from it and installed all my goodies that I never could get to work right in WAIK. I then used imagex to capture and compress my finished vhd and convert it into a .wim file. I used the same bcd file as I've been using, also, I'm booting from USB. The paths in the bcd point to the .wim file and also reference the ramdisk like it's supposed to. I added the FBWF registry keys located in HKLM\CurrentControlSet001\Services\ from my best working WIM. If you don't know, the FBWF file specifies things like ramdisk size, ramdisk driver, and some other stuff. I know it's essential to winpe booting, but not sure if it's the same way for a full blown version of win7.

The error I get now when attempting to boot my hybrid wim is that it can't find a required boot device. I got this error before when messing with a winpe wim and bcd was referencing an invalid location for the ramdisk. So my question is how do you go about setting a ramdisk upon boot?

#2 jeffspeff

jeffspeff

    Newbie

  • Members
  • 13 posts
  • Location:Kentucky, USA
  •  
    United States

Posted 25 July 2010 - 01:35 AM

I've stumbled across something that might be a back way to accomplish this, but I am very unfamiliar with the tools. I believe a combination of grub4dos and/or firadisk would work. But that seems less elegant than the waik way (assuming waik uses a few registry keys and file or two). If anybody else has any feedback on these tools, it would be greatly appreciated.

#3 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 25 July 2010 - 08:15 AM

It seems to me that your approach has some points in common with this one :dubbio::
http://www.boot-land...?...ic=9830&hl=

Should you have missed it, have a look at it, maybe there is something that can be of use as inspiration. B)

:cheers:
Wonko

#4 jeffspeff

jeffspeff

    Newbie

  • Members
  • 13 posts
  • Location:Kentucky, USA
  •  
    United States

Posted 25 July 2010 - 11:05 PM

I'm not sure how imgx is supposed to work, but it seems that it's trying to copy the entire 40gb vhd partition onto my flash drive which is 16gb and it gives errors and won't do it. Im almost certain that I just need to find a way to transfer the wim image to ramdisk upon boot. I don't know if that's handled by the boot manager or registry settings or what?

#5 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 26 July 2010 - 09:04 AM

I'm not sure how imgx is supposed to work, but it seems that it's trying to copy the entire 40gb vhd partition onto my flash drive which is 16gb and it gives errors and won't do it. Im almost certain that I just need to find a way to transfer the wim image to ramdisk upon boot. I don't know if that's handled by the boot manager or registry settings or what?

Well, I am not sure HOW you are trying to use it.

Maybe if you try to describe in more detail the original idea some ideas/suggestions may come out.

But to use a RAMDISK approach you will need heaps of RAM (or a very small image).

We do have a couple of working approaches using grub4dos + Ramdisk (Firadisk or WinVblock), that are evolvong towards DIRECT (without loading into RAM) maping of a "plain" RAW HD image.

There is also a "side" app, WimCaptEx.exe:
http://www.boot-land...?showtopic=9765
from which you may get - reading between the lines - some info about services involved. :cheers:

But really cannot say if there is anything else of relevance until I understand the procedures you have in your mind.

:cheers:
Wonko

#6 jeffspeff

jeffspeff

    Newbie

  • Members
  • 13 posts
  • Location:Kentucky, USA
  •  
    United States

Posted 26 July 2010 - 05:24 PM

I've noticed that there are a lot of different boot disk projects all aiming to achieve the most functionality. More functionality means less restrictions. I've also found that it is very cumbersome to install software into a waik based wim. The best way that I was able to install software was to boot into the wim install a prog that monitors all my files and registry hives, then install my wanted software and manually backup all the registry keys and files created only to slip them into a mounted wim from my main os. Needless to say I didn't like this. I then learned about vhd's. What I did was use use a script provided from msdn (though unsupported by microsoft) that will convert any .wim into a vhd. I converted the install.wim from my win7 dvd into a vhd on my local drive. I then edited my bcd to allow dual boot. Once booted into my vhd i installed all the software I was trying to get working in my waik wim. (note: i installed x86 windows into the vhd, not x64.) I then used imagex to capture and compress my vhd back into a wim. I had didn't think it would be that easy, but I had still had foolish hopes. Needless to say, it didn't work. Since then I'm fairly certain that the reason for not booting is due to the bcd stating ramdisk (boot) paths as it's supposed to for a winpe image, but my install of windows within the wim isn't making the ramdisk as it's supposed to. At first I thought it had something to do with just registry keys, so I replaced the original system hive with a default system hive from waik, that didn't work either. I then went through using file compare software comparing the windows directory of my full win7 wim with the win7 directory of a default waik wim; I copied all the files from waik to win7 that were missing, not overwriting existing ones. I found that there were a lot of drivers and such having to do with windows ramdisk. But when I was committing my wim, i forgot to close all the folders out and of course got an error. I had hoped that it could be safely ignored, but the wim still wouldn't boot; not sure if all the files didn't get committed properly, if that still isn't the right answer.

The reason I'm trying to do it this way is because to me it would be much much easier to install software, get a working wim and then work on decreasing the size of the image by taking out everything that isn't needed/wanted. This way you maintain max functionality and seems that it might be easier than trying to manually add missing features into a waik wim.

#7 jeffspeff

jeffspeff

    Newbie

  • Members
  • 13 posts
  • Location:Kentucky, USA
  •  
    United States

Posted 26 July 2010 - 05:53 PM

Just an update. I've verified that all the files were copied over correctly, I was also thinking that it may have something to do with some reg keys in the software hive, so i copied a default waik software hive over, committed the changes; and.... it still didn't work. I'm wondering though if i need to change reg key in system to make the ramdisk 6gb or so? I only have 6 on my computer. I'm really starting to come to a loss here.

#8 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 26 July 2010 - 05:55 PM

Still you fail to convey (or I completely miss :unsure:) the general idea (and the details that simply aren't there).

The "waik" wim, converted to .vhd or not, is a PE 3.x.

Then till now I cannot see anything "hybrid", it's a PE 3.x with programs added to it.

This is more or less (please read exactly, at least IMHO) the approach Wimb and Kullenen Ask/vv_vurat are using/developing:
http://www.msfn.org/...-from-winpe-30/
http://www.msfn.org/...e-windows-7-pe/

Or not? :dubbio:

Why don't you check the tool "as is" ?:
http://www.911cd.net...showtopic=21883

The point is still that if you make a "monolithic" .wim it will become HUGE and you will need an incredible amount of RAM (and quite a lot of time for loading it to RAMDISK).

:cheers:
Wonko

#9 jeffspeff

jeffspeff

    Newbie

  • Members
  • 13 posts
  • Location:Kentucky, USA
  •  
    United States

Posted 26 July 2010 - 05:59 PM

Still you fail to convey (or I completely miss :dubbio:) the general idea (and the details that simply aren't there).

The "waik" wim, converted to .vhd or not, is a PE 3.x.

Then till now I cannot see anything "hybrid", it's a PE 3.x with programs added to it.



I didn't throw a waik wim into the vhd, i put a full windows 7 wim into the vhd. The vhd is running a full blown all features present version of windows 7; no waik or pe present.

#10 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 26 July 2010 - 06:13 PM

I didn't throw a waik wim into the vhd, i put a full windows 7 wim into the vhd. The vhd is running a full blown all features present version of windows 7; no waik or pe present.

Then there is a communication problem :unsure::

What I did was use use a script provided from msdn (though unsupported by microsoft) that will convert any .wim into a vhd. I converted the install.wim from my win7 dvd into a vhd on my local drive. I then edited my bcd to allow dual boot. Once booted into my vhd i installed all the software I was trying to get working in my waik wim.

AFAIK install.wim is still a PE 3.x. :dubbio:

You either INSTALLED Windows 7 to the .vhd or you did not.

:cheers:
Wonko

#11 jeffspeff

jeffspeff

    Newbie

  • Members
  • 13 posts
  • Location:Kentucky, USA
  •  
    United States

Posted 26 July 2010 - 06:20 PM

Then there is a communication problem :unsure::

AFAIK install.wim is still a PE 3.x. :dubbio:

You either INSTALLED Windows 7 to the .vhd or you did not.

:cheers:
Wonko



Transfer the install.wim file to a vhd and boot from it and tell me if it is pe or not. I thought the same when I first did it, but it after it booted, i quickly realized that it is not pe based. It was just as though I had booted from a dvd and installed windows 7; had me go through creating user names, computer names, paswords, etc. Windows updates are present, all the .net frameworks are there, everything.

#12 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 26 July 2010 - 06:23 PM

Transfer the install.wim file to a vhd and boot from it and tell me if it is pe or not.


I may :dubbio: (or anyway someone could be able to do it), would you post a link to the script you used.

What I did was use use a script provided from msdn (though unsupported by microsoft) that will convert any .wim into a vhd. I converted the install.wim from my win7 dvd into a vhd on my local drive. I then edited my bcd to allow dual boot.



:unsure:
Wonko

#13 jeffspeff

jeffspeff

    Newbie

  • Members
  • 13 posts
  • Location:Kentucky, USA
  •  
    United States

Posted 26 July 2010 - 08:23 PM

Here's the link I used. I saved the file to my c:\ and you have to run it with the cscript command

http://code.msdn.microsoft.com/wim2vhd

#14 jeffspeff

jeffspeff

    Newbie

  • Members
  • 13 posts
  • Location:Kentucky, USA
  •  
    United States

Posted 27 July 2010 - 01:30 AM

My latest idea is that somewhere in the registry and/or some files are being changed when i'm booting from this vhd after first extracting it from the wim. So what i'm going to try is:

1) Extract install.wim into a vhd. Copy that partition onto a flash drive, make sure it boots.
2) Any files that exist in waik wim that don't exist in install.wim will be copied over. Make sure it still boots.
3) Backup and replace each registry hive on the flash drive with a default registry hive from waik pe wim. Convert hdd image back to wim and test.

I'm transferring the install.wim image over to vhd right now. I'll post my results.

#15 vvurat

vvurat

    Frequent Member

  • Advanced user
  • 323 posts

Posted 27 July 2010 - 06:56 AM

My latest idea is that somewhere in the registry and/or some files are being changed when i'm booting from this vhd after first extracting it from the wim. So what i'm going to try is:

1) Extract install.wim into a vhd. Copy that partition onto a flash drive, make sure it boots.
2) Any files that exist in waik wim that don't exist in install.wim will be copied over. Make sure it still boots.
3) Backup and replace each registry hive on the flash drive with a default registry hive from waik pe wim. Convert hdd image back to wim and test.

I'm transferring the install.wim image over to vhd right now. I'll post my results.


if it works tell me how too.

#16 jeffspeff

jeffspeff

    Newbie

  • Members
  • 13 posts
  • Location:Kentucky, USA
  •  
    United States

Posted 27 July 2010 - 07:38 AM

When a wim loads is the entire image loaded into the ramdisk, or does the ramdisk serve as a buffer and files are loaded as needed?

#17 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 27 July 2010 - 07:39 AM

OK, now everything is clear. :cheers:

Quote from source:
http://code.msdn.microsoft.com/wim2vhd

The Windows® Image to Virtual Hard Disk (WIM2VHD) command-line tool allows you to create sysprepped VHD images from any Windows 7 installation source.


And later:

Q: How does the conversion process work?
A: During the conversion, a .VHD file is created and mounted as a physical drive on the technician system. An image from the .WIM file is then applied to the .VHD, and tweaked to make the image bootable in a virtual machine, or on a physical system. This process is documented in the Windows 7 Beta Automated Installation Kit. WIM2VHD is an example of one possible way to automate that process.


The script does NOT "convert a .wim to a .vhd! :dubbio:

What I did was use use a script provided from msdn (though unsupported by microsoft) that will convert any .wim into a vhd. I converted the install.wim from my win7 dvd into a vhd on my local drive. I then edited my bcd to allow dual boot.


It creates a .vhd with a fully installed Windows 7 in it, sysprepped.

Sysprep:
http://en.wikipedia.org/wiki/Sysprep

In other words it is a "different" (nice :cheers:) way to INSTALL windows 7 (inside a .vhd).

:unsure:
Wonko

#18 jeffspeff

jeffspeff

    Newbie

  • Members
  • 13 posts
  • Location:Kentucky, USA
  •  
    United States

Posted 27 July 2010 - 07:42 AM

That would explain why I was getting errors when trying to convert a waik wim file. Sorry for being misleading there.

#19 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 27 July 2010 - 08:52 AM

Joakim :cheers: just posted a possible way on your other thread on 911cd :cheers: :
http://www.911cd.net...o...c=23969&hl=

:cheers:
Wonko

P.S.: Just to keep everything as together as possible:
http://social.msdn.m...6f-7b0f23cb20af

Since no explanation has been posted, I might as well post what is necessary to boot from inside a wim for non-PE.

Include 3 drivers;
fbwf.sys
ramdisk.sys
wimfsf.sys

Merge this into your target SYSTEM hive, mounted as sys;
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\sys\ControlSet001\Control]
"SystemBootDevice"="ramdisk(0)"

[HKEY_LOCAL_MACHINE\sys\MountedDevices]
"\\DosDevices\\C:"=hex:fc,57,b2,d9,4e,68,cb,4d,ab,79,03,cf,a2,f6,b7,50

[HKEY_LOCAL_MACHINE\sys\Setup]
"SystemPartition"="\\Device\\Ramdisk{d9b257fc-684e-4dcb-ab79-03cfa2f6b750}"

[HKEY_LOCAL_MACHINE\sys\ControlSet001\services\FBWF]
"DisplayName"="fbwf"
"Group"="FSFilter System Recovery"
"ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\
52,00,49,00,56,00,45,00,52,00,53,00,5c,00,66,00,62,00,77,00,66,00,2e,00,73,\
00,79,00,73,00,00,00
"Description"="File Based Write Filter Driver"
"ErrorControl"=dword:00000001
"Start"=dword:00000000
"Tag"=dword:00000005
"Type"=dword:00000002
"DependOnService"=hex(7):66,00,6c,00,74,00,6d,00,67,00,72,00,00,00,00,00
"WinPECacheThreshold"=dword:00000200

[HKEY_LOCAL_MACHINE\sys\ControlSet001\services\FBWF\Instances]
"DefaultInstance"="Fbwf Instance"

[HKEY_LOCAL_MACHINE\sys\ControlSet001\services\FBWF\Instances\Fbwf Instance]
"Altitude"="226000"
"Flags"=dword:00000000

[HKEY_LOCAL_MACHINE\sys\ControlSet001\services\FltMgr]
"AttachWhenLoaded"=dword:00000001
"DisplayName"="@%SystemRoot%\\system32\\drivers\\fltmgr.sys,-10001"
"Group"="FSFilter Infrastructure"
"ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,\
72,00,69,00,76,00,65,00,72,00,73,00,5c,00,66,00,6c,00,74,00,6d,00,67,00,72,\
00,2e,00,73,00,79,00,73,00,00,00
"Description"="@%SystemRoot%\\system32\\drivers\\fltmgr.sys,-10000"
"ErrorControl"=dword:00000003
"Start"=dword:00000000
"Tag"=dword:00000001
"Type"=dword:00000002

[HKEY_LOCAL_MACHINE\sys\ControlSet001\services\Ramdisk]
"DisplayName"="Windows RAM Disk Driver"
"ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\
52,00,49,00,56,00,45,00,52,00,53,00,5c,00,72,00,61,00,6d,00,64,00,69,00,73,\
00,6b,00,2e,00,73,00,79,00,73,00,00,00
"ErrorControl"=dword:00000001
"Start"=dword:00000000
"Type"=dword:00000001

[HKEY_LOCAL_MACHINE\sys\ControlSet001\services\Ramdisk\Debug]
"DebugComponents"=dword:7fffffff
"DebugLevel"=dword:00000005

[HKEY_LOCAL_MACHINE\sys\ControlSet001\services\WimFsf]
"DisplayName"="Windows Imaging File System Filter Driver"
"Group"="FSFilter Compression"
"ErrorControl"=dword:00000001
"Start"=dword:00000000
"Type"=dword:00000002
"DependOnService"=hex(7):46,00,6c,00,74,00,4d,00,67,00,72,00,00,00,00,00

[HKEY_LOCAL_MACHINE\sys\ControlSet001\services\WimFsf\Instances]
"DefaultInstance"="Wimfsf Instance"

[HKEY_LOCAL_MACHINE\sys\ControlSet001\services\WimFsf\Instances\Wimfsf Instance]
"Altitude"="161000"
"Flags"=dword:00000000

[HKEY_LOCAL_MACHINE\sys\ControlSet001\services\WimFsf\Parameters]
The "WinPECacheThreshold" can be adjusted according to supported values. Btw, it is possible to set the value to 400 (1 Gb), but you cannot use that much... Any explanation?

Notice the key under MountedDevices. It is used to override the default (X:)as set by /minint and winpe. I would still like an explanation for why it is necessary to set winpe on, although the system inside the wim is not a PE.

Joakim



#20 vvurat

vvurat

    Frequent Member

  • Advanced user
  • 323 posts

Posted 27 July 2010 - 10:32 AM

not so easy

#21 jeffspeff

jeffspeff

    Newbie

  • Members
  • 13 posts
  • Location:Kentucky, USA
  •  
    United States

Posted 27 July 2010 - 12:08 PM

Awesome! That helps a ton!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users