Jump to content











Photo
- - - - -

Mini Windows made with WinNTSetup

mini-vhd

  • Please log in to reply
202 replies to this topic

#151 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 07 August 2022 - 05:51 PM

JFYI

 

There is also another option in WinNTSetup Mode:  Wimboot:WIMCOPY

 

This is just as Wimboot mode, but in this case the linked WIM file is copied into System Volume Information folder located on the Root of the VHD NTFS partition.

 

This could save a few MBs in used space, compared with a LZX Compact mode installation.

 

In fact It seems to me this approach may create future issues during re-capture and re-apply, if not done as Tusted Installer as System Volume Information is a System folder, and highly protected.

 

Nevertheless I think we could safely use Wimboot:WIMCOPY mode only for final VHDs that will not be re-captured, but it is always good to keep a copy of the original WIM file used to build the VHD.

 

Anyway I will test this approach and comment back.

 

alacran



#152 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 07 August 2022 - 10:51 PM

Testing an aproach similar to WinNTSetup Mode:  Wimboot:WIMCOPY

 

PREAMBLE:

 

For this test I builded a new 5 GB MinWin VHD in Compact LZX Mode, since the begining, with my usual programs installed after first boot:

  • 7-Zip x64
  • Classic Shell (Only Start menu was applied).
  • SumatraPDF x64
  • SVBus driver v1.3 (installed manually) but the REG file was pre-installed during first installation.

From MinWin ReadMe.txt file:

 

This folder contians the minwin profiles.

A minwin profile has 3 optional subfolder
    Add
        The content of this folder will added to the root of the applied or captured image

    Reg
        *.reg files will added to the applied or captured image
    Remove
        *.txt files with file pattern that should be excluded from apply or capture operation
        *.reg files will added to the applied or captured image

It also should have a WinSxS.ini
    This contians a whitelist for the \Windows\WinSXS folder
        Wildcards should only match one component, outdated version of this component will be removed

The default profile should show a minmal setup-able and useable installation.
    Don't report program xyz.exe does not work
    Alternative profiles or constructive reports are welcome

 

 

Making use of my Add folder, it allowed me to copy:

 

Port_Apps folder to VHD root, same used in Win_Reduce by wimb, but I also included PowerRun.

 

Utilities folder to VHD root, same used in Win_Reduce.

 

Users\Default\desktop folder with my favorite short cuts to some Portable Programs located on Y drive, same used in Win_Reduce, with some modifications.

 

Users\Default\AppData\Roaming\Microsoft\Windows\SendTo\ folder with my favorite links to some Portable Programs located on Y drive, same used in Win_Reduce, with some modifications.

 

\Windows\System32 folder containig RunScanner files, same used in Win_Reduce.

 

Additionally I created Reg-files folder and during installation in WinNTSetup in Tweks window I selected it, and all REG files were applied during first installation, it contains:

  • EVRootCA.reg  >>> Installs SVBus v1.3 certificate.
  • DisableMitigations.reg  >>>  Disables Meltdown and Spectre mitigations (improves performace in some CPUs).
  • FireFoxPortable_Default_Browser.reg  >>> Makes Y:\FirefoxPortable the default browser.
  • Remote_Regedit.reg  >>> REG file of RunScanner 2 by Paraglider a tool to offline access and edit a Remote Registry..
  • VLC_Fix_Y.reg  >>>  Makes Y:\VLC portable default audio and movie player.

NOTE: Some of this REG files are similar to those used in Win_Reduce, but were moddified to install them this way.

 

NOTE-2: I used for this build my Modded_SySWoW_2022-08-01.7z   2.89KB, for more info see post No. 132

 

Just in case some reader may want to try using my Reg-files folder, I attached it here:

 

Reg-files.7z   Password = alacran

 

After this I captured a WIM image of the NTFS partition using Wimlib-clc by Tokener.

 

 

INSTALLATION:

 

As so far WinNTSetup fails if installing a WIM file captured from a MinWin VHD, I decided to build a very similar approach to test this.

 

Manually made a 1390 MB VHD where:

 

Fist Primary active partition is 40 MB FAT-32

Second primary partition NTFS the rest

 

I created in root of NTFS partition a folder named Wimboot, and copied into it the MinWin WIM file.

By means of Wimlib-clc I installed into NTFS partition it, in Wimboot mode having as source the WIM file into Wimboot folder.

 

The new MinWin-WBCOPY.vhd Rambooted very fine without any issue.

 

To re-capture it I previously created a new WimbootCompress-WBCOPY.ini file and used it during recapture.

 

The new WimbootCompress-WBCOPY.ini is the same as the original WimbootCompress.ini just with the addition in [ExclusionList] of following line:

 

\Wimboot

 

The re-capture was made fine, and as expected, the Wimboot folder was not captured, the resulting WIM file was same size as the original WIM file used.

 

Using this approach we can make smaller size VHDs having about the same free space than if appling in Compact LZX mode.

 

Please see attached photo of NTFS partition, left is just after installed and right is just after Ramboot.

 

It seems to me for a building not using WinNTSetup, it's better and easier to copy the WIM file to Wimboot folder than copy it to System Volume Information folder that is a System folder and very hard to access it, only way is as Trusted Installer.  But we need to keep in mind just having the precaution to edit the WimbootCompress.ini adding the previously mentioned line or use a pre-edited custom WimbootCompress-WBCOPY.ini as I did.

 

Using this approach we have following benefits:

  1. Used space just after installed is smaller than in Compact LZX mode, (37 MB smaller).
  2. All info is contained into a single file, (the VHD), just as in Compact LZX mode.
  3. All the info is fully loaded to Ram, just as in Compact LZX mode.
  4. No issues if the USB 3.0  device in not relly very fast, except longer loading to Ram time.
  5. Smaller file size if the VHD is externally lz4 compressed when compared with a Compact LZX VHD also lz4 compressed, (21 MB smaller).

Well, it seems to me this is the smallest build that can be created without editing the text files into Reduce folder to delete things as PowerShell and the very minimum .Net framework required to run PowerShell, any thing beyond that will be very risky.

 

IMHO it works very fine as it is, and the size is fantastic, and I will not try to further reduce it.   As I said some time ago my goal was a VHD about 1.5 to 1.6 GB and this MinWin build went further than my wishes.

 

alacran

Attached Thumbnails

  • MinWin-WBCOPY.png
  • Comparative.png

Attached Files


  • devdevadev likes this

#153 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 08 August 2022 - 02:32 PM

my dear alacrán,

 

as I know u r a man of good intellect and understanding, would u pls be so kind as to explain to me where to put the winboot:wimcopy instruction on a GUI? if it is on the command prompt, what is the full command? what is the advantage (meager or pointless though it might be) of having the wim file in the system volume information folder? thanx in advance, I m just curious.



#154 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 08 August 2022 - 08:29 PM

@ antonino61

 

my dear alacrán,

 

as I know u r a man of good intellect and understanding, would u pls be so kind as to explain to me where to put the winboot:wimcopy instruction on a GUI? if it is on the command prompt, what is the full command? what is the advantage (meager or pointless though it might be) of having the wim file in the system volume information folder? thanx in advance, I m just curious.

 

For now WinNTSetup fails if installing a WIM file captured from a MinWin VHD.

 

From my previous post:

 

INSTALLATION:

 

As so far WinNTSetup fails if installing a WIM file captured from a MinWin VHD, I decided to build a very similar approach to test this.

 

 

Benefits of having the WIM source file embeded into the VHD are:

 

From my previous post:

 

Using this approach we have following benefits:

  1. Used space just after installed is smaller than in Compact LZX mode, (37 MB smaller).
  2. All info is contained into a single file, (the VHD), just as in Compact LZX mode.
  3. All the info is fully loaded to Ram, just as in Compact LZX mode.
  4. No issues if the USB 3.0  device in not relly very fast, except longer loading to Ram time.
  5. Smaller file size if the VHD is externally lz4 compressed when compared with a Compact LZX VHD also lz4 compressed, (21 MB smaller).

 

 

The option to install in Wimboot:WIMCOPY mode is in Mode same plece where all other install mode options are, see attached picture.

 

alacran

Attached Thumbnails

  • WIMCOPY.png

  • antonino61 likes this

#155 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 08 August 2022 - 10:32 PM

I have just made it! Gonna tell u how to in a bit. Wish my wife's laptop had been more powerful. Just get a wimboot imago of ur miniwin with good old vhd wimboot, and then base it in miniwim + wimboot:wimcopy mode (made sure both are activated). It will do it and boot ok. Alas here it is damn slow

Edited by antonino61, 08 August 2022 - 10:55 PM.


#156 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 08 August 2022 - 10:57 PM

i have written the above from a cell phone and only now have I managed to come back here, it is frustratingly slow, my wife's 2-thread cpu is at pains with its 99% activity. make sure u have a powerful cpu to try this. space gain is as u said.



#157 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 09 August 2022 - 06:11 AM

One more thing in favor of this config i think i have found is used space does not grow overnight

#158 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 09 August 2022 - 03:38 PM

Things seem 2 go a tiny bit better if u ramboot the vhd, for all that might matter

#159 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 10 August 2022 - 06:52 AM

New version WinNTSetup 5.2.6

 

Dowloads:

 

Mega - MediaFire

 

 

 

WinNTSetup 5.2.6

- fixed Feeds did not got disabled on Windows 10
- added log files wimgapi_error.log and wimlib_error.log
- added VHD-DIFF option
- added commandline option VHD-DIFF -file:{file} -parent:{file}
- added commandline switch for VHD-CREATE -mbresp
- added commandline switch for VHD-CREATE -vhdbootletter:{0|1}
- added commandline switch for NT6 -vhdbootfiles:{0|1}
- new commandline switch -syspart and -tempdrive support VHD(X) files
- workaround: added AMD's Shadercache to wimscript exclusion (buggy SecurityDescriptors)

 

alacran


  • antonino61 likes this

#160 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 10 August 2022 - 08:46 AM

Will we get a bit of briefing on each of them command switches?

#161 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 10 August 2022 - 04:06 PM

JFYI

 

I can confirm WinNTSetup v5.2.6 is now capable to install a WIM file captured from a MinWin VHD.

 

I tested this applying the image using WinNTSetup in Wimboot mode to a 2 partitions  512 MB VHD:

 

Comparative wih same image applied using wimlib to a similar VHD:

 

MinWin-WB-Fix.png  >>>  512 MB Wimboot, made with WinNTSetup VHD, used space in NTFS partition is 315.5 MB, 32% fragmented.

MinWin-WB.png  >>>  512 MB Wimboot, VHD made with wimlib v1.13.5, used space in NTFS partition is 58.4 MB, 0% fragmented.

 

NOTE: Wimboot mode was used in both cases.

 

As you can see the resulting used space into the VHD NTFS partition is 5.4 X the used space compare with the used space if applying the image using Wimlib-clc or directly wimlib-imagex, also the VHD applied using  WinNTSetup is highly fragmented 32%, when the other is 0% fragmented.  Please see attached photos.

 

In order to find the cause of this big difference, using WOF_Compress by wimb, I made Full list of Wof Status of both, and compared them by means of notepad++ and its Compare plugin, I was able to find there are 2034 full size (real) files, that in the VHD made with wimlib are Pointers with 0 bytes files each.

 

I verified the WimbootCompress.ini file into it, and it is there my last modded version, create during testing a similar approach to Wimboot:WIMCOPY mode, commented on this post,  where I only added to the original the following lines:

 

[PrepopulateList]

 

\Windows\System32\pwdrvio.sys
\Windows\System32\pwdspio.sys

 

[ExclusionList]

 

\Wimboot

 

CONCLUSION:

 

As WinNTSetup used wimlib v1.13.5, and the WimbootCompress.ini file is the same in both cases, all this increase in size, caused by 2034 full size (real) files, is caused for an additional process that decompressed this files and making them real files, that is coded into WinNTSetup, and should no apply to at least Windows 10 2004 (20H1) and newer (haven't tested before this), maybe is not a bad idea to verify the WimbootCompress.ini into 2019 versions just to confirm (but I don't have them).

 

Also attached here:

 

Full size files.7z   >>>   Password = alacran

 

WimBootCompress_for_WIMCOPY_.7z   >>>   Password = alacran

 

alacran

Attached Thumbnails

  • MinWin-WB-Fix.png
  • MinWin-WB.png

Attached Files



#162 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 10 August 2022 - 04:55 PM

Just tried ur modded wimboot compress - space gain is sensible, but no booting. Then i added the previous prepopulation list and it
got bigger again and did boot. I guess iwill have to do some Turing in wimboorcompress

#163 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 11 August 2022 - 10:38 AM

@ antonino

 

That modded version of WimbootCompress.ini file is for Win 10, AFAIK you are using Win 11, so you will have to mod your own.

 

alacan


  • antonino61 likes this

#164 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 11 August 2022 - 02:24 PM

You will have twigged that i am modding my version on a trial and error basis - by ;ing every item and de-;ing it back if the vhd has not booted or deleting that string if it has.

well, despite my trial-and-error criterion, or rathr, thanx to it, i have managed to identify the wimbootcompress,ini string that wants adding to let win11 boot - \Windows\AppPatch\drvmain.sdb
hope it helps
  • virgus likes this

#165 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 16 August 2022 - 05:26 AM

I suggest to take a look to this topic: VHD to fixed drive

 

It is very useful to automatically find in any internal HD or USB device a VHD, (having all our Portables collection), and attach/mount the VHD as drive Y

 

alacran


  • antonino61 likes this

#166 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 16 August 2022 - 03:04 PM

Dear alacran again,
If my last post in vhd to hd or something applies better here, pls consider it here.

#167 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 19 August 2022 - 10:44 AM

MinWin Medium Profile

 

I will share with all of you my MinWin Medium Profile.

 

It already includes VHD to fixed drive v1.2  in \Program Files\VHD_Loader folder, and links on desktop to run it manually on demand.   But before use it please read the README.txt file included there.

 

Also is included all required to make it work automatically every boot, (by means of creating a service), please see the README.txt file for instructions.

 

I didn't want to include the REG file(s) to be integrated during MinWin installation, to let the user decide if prefer better to run the main EXE file manually or automatically every boot.

 

For those of you that are curious (as myself), open the spoiler to read the content of the main README.txt file

 

Spoiler

 

MinWin_Medium_Profile_2022-08-20.7z    Password = alacran

 

Hope this can be useful for some of you.

 

alacran

Attached Files


Edited by alacran, 20 August 2022 - 02:54 PM.
New version


#168 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 21 August 2022 - 02:49 AM

REG file to add Take Ownership in Context Menu (Command line NOT PowerShell)

 

This can be very usefull when need arise:

 

Only valid for Administrators users.

 

Take Ownership in Context Menu.7z    Password = alacran

 

This option is not always shown in the context menu, when the current user tries to open/run/delete a folder/file and it is not possible it is usually because the selected file or folder has certain safety permissions limitations for this user, then is when this option and its icon are shown in the context menu, it has certain protections to avoid damage to your OS, but use it wisely only when you are sure of what you are doing.

 

NOTE: It doesn't fully work in Win-7, only works for single file, if applied to folders the recursive feature doesn't work, as some parameters are not recognized by the Win-7 command line.

 

alacran

Attached Thumbnails

  • Take Ownership-1.png
  • Take Ownership-2.png

Attached Files


  • antonino61 likes this

#169 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 21 August 2022 - 09:46 PM

for alacrán

here u go

Attached Files


  • alacran likes this

#170 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 22 August 2022 - 01:47 AM

Hi, antonino61

 

You will have twigged that i am modding my version on a trial and error basis - by ;ing every item and de-;ing it back if the vhd has not booted or deleting that string if it has.

well, despite my trial-and-error criterion, or rathr, thanx to it, i have managed to identify the wimbootcompress,ini string that wants adding to let win11 boot - \Windows\AppPatch\drvmain.sdb
hope it helps

 

That file is a pointer in my Win-10 2004 VHDs, not a real size file, and they boot fine, not a single issue, also just checked the attachment from your last post and that line is not listed under [PrepopulateList] section, in fact compared with the original WimbootCompress.ini file in Win-10, the one you send me is exactly the same line by line.

 

So the OS developers themselves do not consider it is required to be a real full size file, so It seems to me there is some other program that is running during booting that can't access it, because the OS hasn't fully booted to make it available/readable by means of the wof.sys driver yet, so this looks to me as a very exceptional case, as I know you use Primo Ramdisk to load and write/read/run some things to the virtual unit(s) created by Primo Ramdisk during boot, to me this is very possible the cause of the issue in your PC.

 

But anyway I'm very glad you solved the issue, here in my Win-10 2004, it is only 243 KB, and being a so little size I don't see any big impact in the used size if having it under [PrepopulateList] section.

 

My modded version of WimBootCompres.ini for 10 2004 was attached on February 3 2022 to this post

 

And I asked wimb to include it as optional, in VHD_WIMBOOT the same day in this post

 

wimb added a few more lines and he named it WimBootCompress-Mini.ini, that can be optionally used for Win10 2004 and newer, you can just add that line to the list in VHD_WIMBOOT_Trusted-67 here:

 

VHD_WIMBOOT_Trusted-67\VHD_WIMBOOT\makebt\WimBootCompress-Mini.ini

 

So this is nothing new and it has being available for months.

 

alacran

Attached Thumbnails

  • Mini option.png

  • antonino61 likes this

#171 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 22 August 2022 - 06:15 PM

here u go again

this is the right one I guess, as I extracted it from install.wim no.6 

 

 

Attached Files



#172 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 22 August 2022 - 08:11 PM

Also checked the attachment from your last post, and same thing [PrepopulateList] section in WimbootCompress.ini is just the same as in Win10 2004 (20H1) and newer.

 

alacran



#173 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 22 August 2022 - 10:07 PM

Having our favorite VHD automatically attached as Y drive. Mount an smaller VHD located into it to X drive.

 

PREAMBLE:

 

I have an old SFX made in 2018, that was made to be run under WinPE environment, and is composed of two parts, the main program that is extracted to %WINDIR%\Temp, which is fine, and a Loader that is extracted to the root of X:\, and executed, when executed it verifies the presence of certain EXE file in X:Windows\System32, and then only if that file is present, the Loader copy some drivers, integrates the Registry keys, and finally loads and runs the main program.  

 

So it is made this way as a protection to not copy the mentioned drivers, and their respective Keys in the Registry of our main OS, that as we all know is running in C:\ drive.

 

Untill today I wasn't able to run that SFX when Rambooting from any of my Mini VHDs or MinWin VHDs, that also are running in C:\ drive.

 

PROCEDURE:

 

In order to bypass the restriction when rambooting from a MinWin.vhd, as there is no risk to permanently add unwanted drivers or Registry Keys, because all is written in Ram, just as in a WinPE, I made the following:

  1. Make a new folder into Y drive, any name is valid (no spaces in the name), I used VHD_from_Y.
  2. Make into that folder a 40 MB VHD NTFS formated, any name is valid (no spaces in the name), I used Drive_X.vhd.
  3. Make into the new VHD (Drive_X.vhd), a Directory junction to C.\Windows.
  4. I made Mount to X_x64.exe, and copied it into same folder.
  5. Make a shortcut on desktop pointing to Mount to X_x64.exe

And that's all, now when Rambooting from my MinWin.vhd, Y drive VHD is mounted/attached automatically, and if I need to run that SFX just need to first run Mount to X_x64.exe from the link in destop and then run the SFX.

 

Just in case some readers may have a similar case, I attached here my VHD_from_Y folder, ready to use, just extract it to the root of Y drive, make a shortcut to Mount to X_x64.exe in your VHD desktop, and it will attach/mount to X drive, a single VHD (single NTFS partition), any VHD name is valid (no spaces in the name), located into same folder.

 

VHD_from_Y.7z   Password = alacran

 

alacran

Attached Files



#174 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 23 August 2022 - 06:13 PM

my dear alacran,

would u pls tell me why stuff in drive y can be placed more conveniently than where it already is (hdd or usb)?

would u also tell me why it is better to preload this stuff along with the system vhd?

u sort of explained it somewhere, but u did not contrast it with other possible scenarios to make it comparatively clear, at least to me.



#175 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 23 August 2022 - 08:22 PM

@ antonino61

 

A week ago I made a post with the info quoted, read the linked topic, all is explained very clearly there:

 

I suggest to take a look to this topic: VHD to fixed drive

 

It is very useful to automatically find in any internal HD or USB device a VHD, (having all our Portables collection), and attach/mount the VHD as drive Y

 

alacran

 

But if your current way to do it looks fine to you, continue doing it your current way.

 

alacran






3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users