Jump to content











Photo
* * * * * 4 votes

Universal HDD Image files for XP and Windows 7

vhd tutorial

  • Please log in to reply
1106 replies to this topic

#926 i

i

    Silver Member

  • Advanced user
  • 539 posts
  •  
    United Nations

Posted 09 April 2013 - 05:57 AM

There was some unusual delay in W8 start up etc so, i used built-in defragmenter to analyze and result was GREAT!

  :w00t: 100% FRAGMENTED!

 

I'm also guessing registry & .cpl errors are expected (given the fact that bulky nVidia control panel items were NOT part of copying from original vhd)

 

 

Is there no freeware (registry error correction + junk cleaner + defragmenter + freespace cleaner) APPS that your app can use? orderwise?

I made a batch file for cleaning annoying junk before img_xp_update, if you know of more files that can be cleaned, here is the code:

 

IF EXIST %TMP%\* START UNLOCKER %TMP% /S /D
IF NOT EXIST %TMP%\NUL MD %TMP%
SET FOLDER=:\System Volume Information
SET NEXT=RECYCLE
:REDO
cacls C"%FOLDER%" /E /T /C /G "%USERNAME%":F >nul
cacls D"%FOLDER%" /E /T /C /G "%USERNAME%":F >nul
cacls E"%FOLDER%" /E /T /C /G "%USERNAME%":F >nul
cacls F"%FOLDER%" /E /T /C /G "%USERNAME%":F >nul
cacls S"%FOLDER%" /E /T /C /G "%USERNAME%":F >nul
rd /S /Q "c%FOLDER%" >nul
rd /S /Q "D%FOLDER%" >nul
rd /S /Q "E%FOLDER%" >nul
rd /S /Q "F%FOLDER%" >nul
rd /S /Q "S%FOLDER%" >nul
GOTO %NEXT%
:RECYCLE
SET FOLDER=:\$RECYCLE.BIN
SET NEXT=RECYCLE2
GOTO REDO
:RECYCLE2
SET FOLDER=:\RECYCLER
SET NEXT=TM
GOTO REDO
:TM


IF EXIST %WINDIR%\*.LOG DEL /F /S /Q %WINDIR%\*.LOG
IF EXIST %WINDIR%\INF\*.PNF DEL /F /S /Q %WINDIR%\INF\*.PNF
IF EXIST %WINDIR%\LastGood\NUL RD /S /Q %WINDIR%\LastGood
IF EXIST %WINDIR%\SYSTEM32\DRVSTORE\NUL RD /S /Q %WINDIR%\SYSTEM32\DRVSTORE
EXIT

Removing NTFS compression gives 90+MB (3.71GB USED)

 

:cheers:



#927 wimb

wimb

    Platinum Member

  • Developer
  • 2697 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 09 April 2013 - 06:45 AM

There was some unusual delay in W8 start up etc so, i used built-in defragmenter to analyze and result was GREAT!

  :w00t: 100% FRAGMENTED!

 

You can use Piriform Defraggler to defragment the mounted Win8-1.vhd and use CCleaner to Wipe Free Space on the VHD drive.

 

Defraggler has a commandline version df.exe that can be used, but I think it is better to consider it as a separate task 

and use the GUI program so that you have view of progress instead of waiting long unsure of what is happening ...

 

Folders like Recycler and System Volume Information are not copied.

Also a lot more junk is already prevented from being copied, so that is not such a problem at the moment.

 

:cheers:



#928 i

i

    Silver Member

  • Advanced user
  • 539 posts
  •  
    United Nations

Posted 09 April 2013 - 09:09 AM

I just updated my xp system with img_xp_update.exe, mounted xp.vhd and as usual found the above garbage mentioned in script. Maybe garbage is excluded in your img_xp_create.exe only?


IMHO, an optional checkbox to "Fully Optimize" inside img_xp_update.exe is great and the reason why it won't slow permanently is because, When a user does this one time, the next time is significantly faster.
(Fix REG errors, Set MFT zone=1, clean junk, defrag, clean free space)

I believe fragmentation issue is directly linked with "NTFS compression" enabled and therefore defrag option should be provided with or near it.


Also because image files are expected to be smaller, MFT reserve should be smaller (which results in more space in *.vhd and faster *.gz creation)
Interesting thread on MFT with jaclaz's replies  :loleverybody:
HKLM\System\CurrentControlSet\Control\Filesystem NtfsMftZoneReservation=1



#929 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 09 April 2013 - 12:06 PM

Also because image files are expected to be smaller, MFT reserve should be smaller (which results in more space in *.vhd and faster *.gz creation)
Interesting thread on MFT with jaclaz's replies  :loleverybody:
HKLM\System\CurrentControlSet\Control\Filesystem NtfsMftZoneReservation=1

Which you probably not completely digested yet :dubbio:.

 

A $MFT zone reservation size doesn't change the size of the $MFT.

This approach might, however:

http://reboot.pro/to...disk-emulation/

 

:cheers:

Wonko



#930 i

i

    Silver Member

  • Advanced user
  • 539 posts
  •  
    United Nations

Posted 09 April 2013 - 05:44 PM

:hmm: Yes, this is something i had in mind (creating a tiny test disk and expanding it) and you actually proved it working! Most of your posts are very informative, thanksssssss.... :) 



#931 wimb

wimb

    Platinum Member

  • Developer
  • 2697 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 10 April 2013 - 09:33 AM

VHD_W8C_53 is available for testing.
 
Download  - VHD_W8C_53
 
Run VHD_W8C_53.exe and Extract to simple path
 
:cheers:
 
Mini8
Attached File  Mini8.png   626.31KB   32 downloads
 


#932 gbrao

gbrao

    Frequent Member

  • Advanced user
  • 376 posts
  •  
    India

Posted 10 April 2013 - 11:40 AM

thanks again, i have not had the time to test it,

drive c: is 1.3GB compressed, right ? does that include any non-MS drivers (logitech?/audio?)  or apps ?

i just want to know the compressed size before anything else is installed.

a 'change log' would be nice.



#933 wimb

wimb

    Platinum Member

  • Developer
  • 2697 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 10 April 2013 - 11:53 AM

drive c: is 1.3GB compressed, right ? does that include any non-MS drivers (logitech?/audio?)  or apps ?

i just want to know the compressed size before anything else is installed.

a 'change log' would be nice.

 

Mini 8 Drive C: is originally 1.0 GB and after install of Printer (used for testing) and running some apps then 1.3 GB is used.

 

A lot was changed for this version.

- Revision of all lists that are used in copying files (old lists were derived from PreRelease version)

- Excluded several large folders to reduce even more the size

- program changes as to allow better control of what is copied in order to reduce size

- Option to Defrag the VHD is integrated

- registry tweaks to disable Prefetch, Skip autorun of ChkDsk for drive C - K, Disable AutoReboot and more ....

 

:cheers:

 

The result is nice, but future improvements are still needed:

- Audio is working on machine where Win8 was installed, but it is not yet working on other machine

Portability requires better (larger) DriverStore with audio drivers

- UEFI is not yet supported

- Universal booting on all machines needs improvement (better DriverStore)

- DriverStore corresponds now to PE4 and needs to be Universal



#934 i

i

    Silver Member

  • Advanced user
  • 539 posts
  •  
    United Nations

Posted 11 April 2013 - 10:09 AM

Tested from within port8 and while creating mini8,

 

01. it took a very long time

02. newly created 1.8GB was showing FULL. (my w8 had 50+MB only)

03. many errors and delays...  :dots:

04.Defrag option is good but defrag speed sucks (specially for a 1.8Gb image)  :lightbulb: 


I've got planty of RAM in this crazy laptop (24GB) and people like me (4GB+) wouldn't mind if your app can create an empty RAM disk, create a VHD THERE and do all stuff FAST

 

New ToDo steps for your img_xp_create.exe or IMG_XP_Compact or VHD_XP_Create or VHD_W7_Compact:
00. Calculate Free RAM space + hdd space (provide checkbox "Do it on RAM" and grey out if less RAM)
01. Create empty RAM disk of user selected (*GB VHD size+50MB)
02. Create a Tiny 3MB VHD image there and extend it's size to user selected *GB (for small MFT)
03. Let remaining process of your VHD_W8C_53 remain same

04. See defrag run at aeroplane speed  :happy_dance:

05. When everything is done, copy *.vhd to hdd for use or set *.GZ out to user selected drive

 

I haven't seen change logs of imDisk but if it can use 4GB+ on x86 then one can create great stuff.

 

 

Also Orderwise, following can be fastest on a RamDisk (i do it normally):  :yahoo:

01. Fix and remove Invalid REG errors, 

02. Remove Invalid broken shortcuts linked to %systemDrive%

03. Clean junk,

04. Defrag,

05. Clean free space



#935 wimb

wimb

    Platinum Member

  • Developer
  • 2697 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 13 April 2013 - 10:07 AM

VHD_W8C_54 is available for testing which is probably Final Version and in any case working quite well. :)
 
Download  - VHD_W8C_54
 
Run VHD_W8C_54.exe and Extract to simple path
 
VHD_W8_Compact.exe - Make Portable x86 Windows 8 in 2.5 GB VHD booting from  USB or HDD
x64 version needs 3.5 GB VHD because of extra 1 GB SysWOW64 folder.
 
The portable App was tested in Windows 7/8 with User Account Control Off -  x64 and x86 version OS have been used.
Source is Windows 8 fresh installed on local partition  - Size 10 GB for 32-bits Enterprise Evaluation Or 20 GB for x64 Professional.
 
==================================================================================================
Source preparation:
Win8 x64 ISO Or Win8 32-bits Enterprise Evaluation ISO file can be used 
9200.16384.WIN8_RTM.120725-1247_X86FRE_ENTERPRISE_EVAL_EN-US-HRM_CENA_X86FREE_EN-US_DV5.ISO
 
Boot with Windows 7/8 or 7 PE and then use WinNTSetup2 to Install Windows 8 on local partition.
Win 8 Setup ISO file was mounted via R-mouse in ImDisk Virtual drive
In WinNTSetup2 - Tweaks - Select all System Tweaks so that UAC is off etc.
 
After booting with Windows 8 then Check to have Switched Off :
UAC + Defender + pagefile + System Restore + Hibernate + Windows Update + Action Center settings Disable ALL options
Hibernate OFF is needed via cmd window with
powercfg -h OFF

==================================================================================================

 

Changes:
- Full DriverStore is copied which is needed to be Universal for booting on any computer
- UEFI Secure Boot support in case of x64 Win8 Source and using x64 Win 7/8 OS - requires FAT32 Target Boot Drive.
- Selectable Target Boot Drive for Boot files and NTFS Target System Drive where Win8-x.vhd VHD file is copied
- ActionCenter removed to avoid setting NTFS dirty on all local drives :ph34r:
which occurs in case of Win8 Boot failure after cutting too deep and then causing ChkDsk running at Reboot
May be Drive Status option is causing the trouble :unsure: so removal of ActionCenter might help ....
 
:cheers:
 
@i
My computers have only 2 Or 4 GB RAM so using RAM disk to process 2.5 GB VHD is no option for me at present.
On my slowest system then the integrated Defrag takes about 5 min for 2.5 GB VHD which seems acceptable .....
 
I can boot with Portable x64 Win8 VHD and then create x86 Win8 VHD from fresh Installed x86 Win8 on local partition.
No problem here .....


#936 i

i

    Silver Member

  • Advanced user
  • 539 posts
  •  
    United Nations

Posted 14 April 2013 - 10:11 AM

@i

My computers have only 2 Or 4 GB RAM so using RAM disk to process 2.5 GB VHD is no option for me at present.
On my slowest system then the integrated Defrag takes about 5 min for 2.5 GB VHD which seems acceptable .....
 
I can boot with Portable x64 Win8 VHD and then create x86 Win8 VHD from fresh Installed x86 Win8 on local partition.
No problem here .....

There must be plenty of computers out there with more RAM, couldn't you give options for them? (if not yourself for the future?) besides, you're not publishing and targeting features only for yourself   :P also, if you add any of these "speeding" options, i'm sure you won't run out of testers, specially like me :smiling9:

 

Anyone who makes use of,..

map --mem-min=4G

... obviously has enough x86 RAM (a Minimum of 2.96GB available and approx 2630MB free). Not just speed, think about the decrease in hdd I/Os with such options (basically all the advantages of a RAM disk).

 

 

On the defrag speed and errors issues, i found out my free space was 50~MB (disabled ntfs compression on a 3.9GB for test earlier) so your work is most probably right.



#937 hank0113

hank0113
  • Members
  • 4 posts
  •  
    Canada

Posted 16 April 2013 - 08:22 AM

@wimb

 

I made a Portable x86 Windows 8 with VHD_W8C_54. Everything works fine so far except I can't install any Windows Installer-based program. It always gives me install error with error code 2755. And MSIs installed fine with the source VHD. May it be because of some critical files missed while copying files to portable VHD?



#938 Motasem

Motasem

    Frequent Member

  • Advanced user
  • 169 posts
  • Interests:War Make's Men And Problems Make's You Expert
    MooT®
  •  
    Jordan

Posted 16 April 2013 - 01:48 PM

great work thanks wimb aloooot :1st:



#939 wimb

wimb

    Platinum Member

  • Developer
  • 2697 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 18 April 2013 - 06:01 AM

I made a Portable x86 Windows 8 with VHD_W8C_54. Everything works fine so far except I can't install any Windows Installer-based program. It always gives me install error with error code 2755. And MSIs installed fine with the source VHD. May it be because of some critical files missed while copying files to portable VHD?

 

Same error 2755 occurs here for Windows Installer, but How to solve it ?

 

It is not a missing system32 file and the registry is exactly the registry of the full version.

There must be still some missing file, but I don't know yet how to solve this issue.

 

Anyone knows the solution ?

 

@Motasem

Thanks for testing and happy that it is working OK for you.

 

@i

I will have a look at using RAMDISK for making VHD so that Defrag will be faster.

How much time does it take for you to Defrag a 2.5 GB VHD when using RAMDISK ?

 

:cheers:



#940 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 18 April 2013 - 09:15 AM

Same error 2755 occurs here for Windows Installer, but How to solve it ?

 

It is not a missing system32 file and the registry is exactly the registry of the full version.

There must be still some missing file, but I don't know yet how to solve this issue.

 

Anyone knows the solution ?

Checks/ideas are here:

http://support.micro...kb/811881/en-us

http://forums.techgu...-2755-when.html

http://colinmackay.c...der-encryption/

 

I remember one of the most nightmarish :ph34r: experiences with the stupid MSI installer on Win2K (when Virtualbox came out) that ended up being an issue with the permissions (in the directory where the MSI file was saved), which I (promptly :unsure:) solved worked around by copying the installer to a FAT formatted volume, see:

http://reboot.pro/to...machine/?p=7811

I would try that first thing, as it costs nothing or next to nothing.

 

:cheers:

Wonko



#941 wimb

wimb

    Platinum Member

  • Developer
  • 2697 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 18 April 2013 - 09:46 AM

Checks/ideas are here:

http://support.micro...kb/811881/en-us

 

Thanks Wonko :)

 

 

In Windows Explorer, right-click the %SystemRoot%\Installer folder, and then click Properties.

 

The problem is caused by missing Windows\Installer folder.

Making empty Installer folder in Windows solves the problem. :)

 

Somehow I must have missed that detail, but after your helpful remarks then I had a better look

and it turned out there was an easy solution .....

 

The 2.5 GB Win-8 VHD with 32-bits 1.3 GB OS are quite handy.

They are really Universal and adjust easily in no time to any hardware ......

 

:cheers:



#942 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 18 April 2013 - 10:18 AM

The problem is caused by missing Windows\Installer folder.

Making empty Installer folder in Windows solves the problem. :)

 

Somehow I must have missed that detail, but after your helpful remarks then I had a better look

and it turned out there was an easy solution .....

Good :).

 

sometimes, like in many similar cases, I wonder how much would have been the cost to the good MS guys to check for the existence of that folder and creating it if necessary INSTEAD of producing an error (cryptic) if there isn't one  :whistling:

 

:cheers:

Wonko



#943 hank0113

hank0113
  • Members
  • 4 posts
  •  
    Canada

Posted 19 April 2013 - 02:52 AM

The problem is caused by missing Windows\Installer folder.

Making empty Installer folder in Windows solves the problem.

 

This does solve some problems. Before I can't install any of the VC++ 2005, 2008, 2010 and 2012 redist. After making the empty Installer folder, now 2010 and 2012 can be installed.

 

However, when installing 2005 and 2008, it still gives me errors like:

 

Error 1935.An error occurred during the installation of assembly 'Microsoft.VC80.ATL,type="win32",version="8.0.50727.6229",publicKeyToken="1fc8b3b9a1e18e3b",processorArchitecture="x86"'. Please refer to Help and Support for more information.
 

I tried to find solutions on the internet, but couldn't find one because most of them are irrelevant since Portable Win8 is a stripped-down system.



#944 wimb

wimb

    Platinum Member

  • Developer
  • 2697 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 19 April 2013 - 06:48 AM

However, when installing 2005 and 2008, it still gives me errors like:

 

You can Install VC++ 2005 and 2008 in Windows 8 Source before using VHD_W8_Compact.exe

 

Some adjustments in VHD_W8\copy_8vhd.txt and mini_8vhd.txt are needed to get all related files

 

You can try to use following modifications:

 

 

\Windows\winsxs\manifests\*_microsoft.vc80.*

\Windows\winsxs\manifests\*_microsoft.vc90.*
 
\Windows\winsxs\manifests\*_policy.*
 
\Windows\winsxs\*_microsoft.vc80.*\*.*
\Windows\winsxs\*_microsoft.vc90.*\*.*
 

 

Then use VHD_W8_Compact.exe and see if that is sufficient for you.

 

:cheers:



#945 wimb

wimb

    Platinum Member

  • Developer
  • 2697 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 20 April 2013 - 04:25 PM

VHD_W8C_55 is available for testing.

Download - VHD_W8C_55

Run VHD_W8C_55.exe and Extract to simple path

Changes:
- Windows\Installer folder made for support of Windows Installer programs
- winsxs copy modified for support of VC++ Redist
- Full Copy Version added - handy when copy to new (larger) VHD is desired

More Info http://reboot.pro/to...-38#entry171053

 

:cheers:

 

Attached File  VHD_W8C.png   29.73KB   12 downloads == Attached File  Mini8.png   643.69KB   11 downloads

 

 



#946 i

i

    Silver Member

  • Advanced user
  • 539 posts
  •  
    United Nations

Posted 20 April 2013 - 10:21 PM

@i

I will have a look at using RAMDISK for making VHD so that Defrag will be faster.

How much time does it take for you to Defrag a 2.5 GB VHD when using RAMDISK ?

 

:cheers:

 

Here you go:

SCREEN.png

 

 

2.5GB MINI8 (10GB VHD ON HDD AND TARGET SET TO R:)  
START TIME: 		  3:37:00
END TIME:			  3:39:20
92% DEFRAG TIME END:  3:42:06
FINAL MESSAGE:	3:43:30	
TOTAL TIME TAKEN: (COPY 2:20m) (DEFRAG 1:24m)


COPY 4GB W8.VHD from HDD (not ssd :p) TO R:	120MiB/S~
DEFRAG OF 4GB.VHD BY ULTRADEFRAG 6.01 ON ImDisk 4.2GB RamDisk R:
START TIME:	   3:56:00 
END TIME:		3:56:40
SECOND PASS
START TIME:	   3:57:00
END TIME		 3:57:07
TOTAL TIME TAKEN: 47 SECONDS

Edited by i, 21 April 2013 - 06:47 AM.

  • tersett likes this

#947 wimb

wimb

    Platinum Member

  • Developer
  • 2697 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 21 April 2013 - 08:06 AM

Using RAMDISK gives for me a reduction of about 50% in time to defrag VHD by using Defraggler.

It means I can defrag the 2.5 GB VHD in about 2.5 min instead of 5 min

 

Ultradefrag gives another reduction in time of about 50% as compared to using Defraggler,

but the result is not as desired.

Ultradefrag will defrag files only and does not defrag freespace for me,

whereas the Occupancy is optimised by Defraggler giving large size of Freespace.

 

I did make RAMDISK option in the program and got it working,

but was not impressed by the improvement being a reduction of about 50% in time to defrag,

I got a problem with bcdboot which does not like VHD in RAMDISK so that boot files were not made in the usual way.

The bcdboot problem and the limited improvement made me decide to remove the RAMDISK option from the program.

 

:cheers:


  • tersett likes this

#948 tersett

tersett
  • Members
  • 2 posts
  •  
    United States

Posted 21 April 2013 - 07:32 PM

This is great work!!! I am quite sure MS Developers are looking at this because of the "New" (lol) Windows to Go. But a USB drive will need the minimum of 32GB and its only for Windows 8. You guys rock!!



#949 wimb

wimb

    Platinum Member

  • Developer
  • 2697 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 22 April 2013 - 06:32 AM

This is great work!!! I am quite sure MS Developers are looking at this because of the "New" (lol) Windows to Go. But a USB drive will need the minimum of 32GB and its only for Windows 8. You guys rock!!

 

Thanks :)

 

The 1.4 GB core of Windows 8 is indeed quite useful and very powerful.

 

Removal of a lot of stuff by using VHD_W8_Compact.exe 

gives a portable 2.5 GB VHD that is Universal and adjust easily in no time to any hardware ......

 

:cheers:



#950 hank0113

hank0113
  • Members
  • 4 posts
  •  
    Canada

Posted 23 April 2013 - 12:14 AM

VHD_W8C_55 is available for testing.

Download - VHD_W8C_55

Run VHD_W8C_55.exe and Extract to simple path

Changes:
- Windows\Installer folder made for support of Windows Installer programs
- winsxs copy modified for support of VC++ Redist
- Full Copy Version added - handy when copy to new (larger) VHD is desired

Thanks for making changes for VC++ Redist. I did a quick check on changes in copy_8vhd.txt and mini_8vhd.txt. It seemed to me those changes would not make any difference in terms of files being copied. I then look at the VHD file I created with VHD_W8C_54, those VC++ related did get copied. That being said, I haven't actually tested this new version though. Or maybe I am missing something, could you please explain in more detail how those modification would make any changes to the output VHD?

 

I also noticed that in copy_8vhd.txt and mini_8vhd.txt, you commented that "FiraDisk and WinVBlock do not work in Win 8". However, I have been using firadisk in Win 8 for months and did not have any problems.







Also tagged with one or more of these keywords: vhd, tutorial

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users