Jump to content











Photo
- - - - -

VHD Virtual Disks - Tips and Tricks

vhd fixed dynamic tools for vhd

  • Please log in to reply
34 replies to this topic

#26 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 10 June 2021 - 06:59 PM

Make a VHD Compact LZX compressed to hold our Portable Programs

 

This option works very fine for all kind of VHDs and also for Win10XPE, VHDs or WimPEs based on OSs older than 10 require to have wofadk.sys and its respective service to load it, see previous post for info about this.

 

Pros:

 

Easy to update the Portables.vhd and copy it to other internal or USB drive.

 

Inconvenient:

 

To run the Portables.vhd we need to attach the VHD first.

 

Solution to the Inconvenient:

 

Simple VHD Manager, download this portable program, attach the VHD by means of this program, (also it is capable to automatically attach it every boot).

 

Procedure:

 

Boot from your real OS or bootable VHD.

Attach the Portables.vhd by means of Simple VHD Manager.

Open Disk Management (diskmgmt.msc) and assign to the VHD your prefered drive letter (I use Y:)

Go back to Simple VHD Manager, select the VHD, open Options and select Attach Marked To System Boot.

Now you can close Simple VHD Manager.

 

This way every boot from your real OS or from a VHD, the Portables.vhd will be attached automatically and will keep same drive letter, even if you are booting from your USB device on a different machine.

 

alacran



#27 antonino61

antonino61

    Gold Member

  • Advanced user
  • 1521 posts
  •  
    Italy

Posted 10 June 2021 - 07:43 PM

it takes one hell of a long time, though, if u got many of them.



#28 Guest_AnonVendetta_*

Guest_AnonVendetta_*
  • Guests

Posted 11 June 2021 - 12:26 AM

@alacran: Why not just use SVBus to automount the VHD at boot? It will even be seen as a fixed disk, and should keep the same drive letter every time. This option, to me, seems more superior than relying on a program to do the same thing, since it uses an early stage boot driver instead. Maybe i'm wrong, but a program has the disadvantage that it cant start (to attach the VHD) until after the kernel has initialized and the OS enters protected mode. That is, of course, unless that program happens to make use of a driver (built in, 3rd party, whatever).

SVBus is probably also smaller than what you use, since it is a driver only, without a GUI (unless you count interacting with it via GRUB4DOS as a GUI).

#29 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 11 June 2021 - 02:56 PM

If we are Filedisk booting from Mini-10x64.vhd it is done by means of respective Windows boot files/folders (for MBR or for UEFI), as always.

If we are Rambooting from Mini-10x64.vhd it is done by means of grub2 (if required [only on UEFI]) + respective grub4dos (for MBR or for UEFI) + SVBus, to run respective Windows boot files/folders (for MBR or for UEFI) from the VHD loaded on RAM, as always.

There is no change in booting procedure, only thing Simple VHD Manager does is create a service to attach automatically (as filedisk) our Portables.vhd (NON bootable),  just after every time Mini-10x64.vhd boots, and Simple VHD Manager will not be used/needed anymore after creating the task only once, as since we assigned to Portables.vhd (using diskmgmt.msc) our prefered drive letter, that letter will be kept.

Of course we can do this manually without using Simple VHD Manager just opening TaskScheduler (taskschd.msc) GUI and creating the task (commandline required here to attach the VHD), but Simple VHD Manager can do it for us in its easy GUI and in less steps it takes to do this manually, also this is the easier way for non advanced users (and for lazy users as me).

alacran



#30 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 4 weeks ago

JFYI

 

Following info is with the only intention to keep all info related to VHDs available in this topic.

 

New alternatives to automatically mount a VHD to a fixed drive letter, especialli when booting forom a WinPE or an USB device where all drive letters are changed are:

 

VHD to fixed drive   Finds and runs in any drive, a folder containing a second program, that in turn mounts a VHD located into same folder, to Y drive letter.  The VHD is attached as Filedisk NOT loaded in RAM.  Usefull for limited Ram.

 

Load_RamDisk   Finds and runs in any drive \RamDisk\ImDisk.cmd, that in turn will Load to Ram (or will attach as filedisk) the selected VHD or IMG file, as long as the VHD or IMG file are located into same drive where RamDisk folder is.

 

alacran



#31 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 4 weeks ago

Differencing VHDs.

 

Also known as Differential VHDs, this is a little especial kind of VHDs, my very good friend misty allready made back in March 2012, this very good topic:  VHD Differencing Disks and Native VHD Boot   Of course the info also applies to Win10 or Win11.

 

I will quote here some relevant parts from misty topic:

 

 

In diskpart, use the following command syntax to create a differencing disk -

 

create vdisk file=PATH_TO_DIFFERENCING_IMAGE parent=PATH_TO_PARENT_IMAGE    E.g.

 

create vdisk file=C:\Differencing.vhd parent=C:\Parent.vhd

 

You must keep both files (the parent VHD and the differencing VHD) in the same directory on a local volume for native-boot scenarios. For native-boot VHDs, the parent VHD and the differencing disk cannot reside on different volumes, even if they reside on the same local disk. However, when you attach a differencing VHD that is not used for native boot (for example, if you plan to use it for image management), the parent VHD can be in different directories, and on a different volume or even on a remote share.

 

During my tests booting Windows 8 Consumer Preview from a differencing VHD I was able to boot a differencing disk whose Parent disk was in a different directory. It would not boot when the Parent disk was moved to another volume on the same physical disk - in fact the menu entry disappeared from the boot menu after the parent disk was moved.

 

They may be very useful to keep the (original) Parent VHD unchanged, when booting from the Child VHD, all changes we make are only stored in the Child VHD, it is created as an (expandable) Dinamic VHD, that will growup (when we add new info) until it reaches a maximum size same as the Parent VHD.

 

Comparative with Ramboot a VHD:

 

We can get same results as when we Ramboot a VHD, keep the original VHD unchanged.

No need to install SvBus driver as they can boot natively by means of Win bootmanager.

Standard and VHDs installed in Compact mode in internal or external devices, work fine as Differential VHDs. As I can confirm.

VHDs installed in Wimboot mode in internal HD, also work fine using this approach. As I can confirm.

 

alacran



#32 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 4 weeks ago

JFYI

 

From a Post of yaya (on January 2021) in G4E Topic in wuyou.net (Chinene forum): http://bbs.c3.wuyou....652&pid=4221838

 

 

Differential VHD is supported, please test.
map --mem --parent-vhd-name="parent VHD file name (with path)" child VHD file name (with path) (hd)
chainloader (hd-1)

 

I will test this and let you know.

 

EDIT: I haven't being able to make this work, already asked for info about the right commands to make it work, in grub4dos page in GitHub:

 

 

From ChangeLog_UEFI.txt:

2021-01-31 (yaya)

Supports starting a first-level differential VHD image.

 

From: http://bbs.c3.wuyou....652&pid=4221838

 

`Differential VHD is supported, please test.

map --mem --parent-vhd-name="parent VHD file name (with path)" child VHD file name (with path) (hd)
chainloader (hd-1)`

 

And this commands are not working here. So plese let me know the required commands to:

 

Filedisk and Ramdisk boot a differencing or differential VHD using grub4dos for MBR and also for UEFI version.

 

Thanks in advance for your help

 

Your friend:

 

alacran from reboot.pro

 

 

alacran



#33 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 4 weeks ago

Testing MinWin Differencing VHDs, Filedisk and Ramdisk booting in CSM/MBR and UEFI environment.

 

To make things easier I used as Parents my already builded 2 partitions MinWin VHDs, just adding to them -0 before the .vhd extention, and using their previous names for the Child VHDs, with the idea to use already made enties in BCDs and grub.cfg, of course Differential VHDs do not require to have 2 partitions when booting by means of Win bootmanager, ntloader or Ventoy.

 

Filedisk booting from internal HD (MBR/CSM):

Differential VHDs made from standard VHDs, VHDs installed in Compact or Wimboot mode work fine from:

Win bootmnager, grub4dos (for MBR/CSM) + ntloader, a1ive file manager.


Filedisk booting from internal HD (UEFI):

Differential VHDs made from standard VHDs, VHDs installed in Compact or Wimboot mode work fine from:

Win bootmnager, grub4dos (for UEFI) + ntloader, a1ive's grub2.
 

 

Having the VHD in (hd0,2), and ntloader and initrd.lz1 in (hd0,0) root, used following commands in both menu.lst, (valid for MBR/CSM and UEFI):

 

This commands works fine in almost all PCs at home.

 

title Differential VHD (hd0,2)/MinWin-LZX.vhd - SVBus FILEDISK - 1.5 GB - ntloader
uuid (hd0,2)
kernel /ntloader hires=0 uuid=%?_UUID% file=/MinWin-LZX.vhd
initrd /initrd.lz1

 

In another of the PCs, I already know I have to use the alternative commands.


title Differential VHD (hd0,2)/ MinWin-LZX.vhd - SVBus FILEDISK - 1.5 GB - map as Chainloader
uuid (hd0,2)
chainloader /ntloader initrd=/initrd.lz1 hires=0 uuid=%?_UUID% file=/MinWin-LZX.vhd

 

Filedisk booting from USB device (MBR/CSM):

Differential VHDs made from standard VHDs and VHDs installed in Compact mode work fine from:

Win bootmnager, grub4dos (for MBR/CSM) + ntloader, a1ive file manager.

Differential VHDs made from VHDs installed in Wimboot mode boot fine only if using Win bootmanager.

Filedisk booting from USB device (UEFI):

Differential VHDs made from standard VHDs and VHDs installed in Compact mode work fine from:

Win bootmnager, grub4dos (for UEFI) + ntloader, a1ive's grub2

.
Differential VHDs made from VHDs installed in Wimboot mode boot fine only if using Win bootmanager.

 

 

Filedisk booting from USB device using Ventoy,  in MBR/CSM and UEFI environments:

Differential VHDs made from standard VHDs and VHDs installed in Compact mode work fine.

Differential VHDs made from VHDs installed in Wimboot mode DO NOT work fine

 

 

RAMBOOT:

 

So far I haven't being able to Ramboot (from HD or USB), in MBR/CSM or UEFI environment any Differential VHDs made from any source.  And I'm still waiting for an answer to my question in GitHub page of grub4dos, mentioned in previous post.

 

In all cases that work fine my Y_Drive.vhd, was automatically attached as Ramdisk or Filedisk, by means of Load_Ramdisk, and/or VHD to fixed drive, and ready to use when arriving to desktop.

 

Conclusions:

 

1 - Differential VHDs made from Standard and Compact mode installed VHDs are the more versatile.

 

2 - From previous No. 1, Differential VHDs made from Compact mode installed VHDs, are the best option, as they can be smaller in size, saving storage space.

 

3 - IMHO we get better results if we Ramboot from VHDs installed in Compact, Wimboot or Wimboot-WIMCOPY mode by means of G4D or G4E, as an example a Win10 MinWin Wimboot VHD of 500 to 700 MB boots fantastic in a PC having 2 GB of Ram.

 

4 - For general use only potential use I can see for Differential VHDs, is Filedisk booting from big size VHDs that don't fit in available Ram, and still keep our original (Parent) VHDs unchanged.

 

5 - But if using a Ventoy USB device, as there is not an option for Ramboot a VHD, the Differential VHDs made from Compact mode installed VHDs, are very useful to keep our original (Parent) VHDs unchanged.

 

NOTE:

 

I have noticed it is a good practice after creating the Differential VHD in command line using diskpart, to attach/mount it at least once, if not it doesn't boot fine sometimes.   It seems certain files are written automatically to it when mounted the first time, as after dismounted its size is notoriously bigger, as its size changes from less than 100 KB to about 10 MB.

 

alacran



#34 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted 3 weeks ago

Testing boot Differential VHDs made from dynamical VHDs installed in Wimboot mode:

 

From previous Post we confirmed MinWin Differential VHDs made from fixed size VHDs installed in Wimboot mode, boot fine as Filedisk from internal HD on MBR/CSM or UEFI environments using Windows boot manager or grub4dos + ntloader.

 

I made in my internal HD, in the drive dedicated to hold my VHDs, a new installation of my already made MinWin.wim file, in Wimboot mode in a dynamical (expandable), single NTFS partition, 2 GB VHD, and named it as MinWin-WB-0.vhd.  The resulting VHD has when mounted an internal used space of about 60 MB, when unmounted occupies less than 100 MB, but never booted from it, it was not fragmented internally, but as usually happends to all expandable VHDs, it was externally fragmented in the drive where it resides, after unmout it just defragmented the VHD file using Defraggler portable (located in my attached Y-Drive.vhd).

 

Using MinWin-WB-0.vhd as the Parent VHD, I created by command line a Differential VHD, named MinWin-WB-1.vhd, which by design is also a dynamical (expandable) VHD, having also when mounted an internal used space of about 60 MB, and also occupies less than 100 MB, when unmounted, before first boot.

 

After that I created for the MinWin-WB-1.vhd both BCDs entries, and both grub4dos menu.lst entries for MBR and UFI, and booted from it as Filedisk, as expected all worked flawlessly in all cases, not a single issue, of course after booting and using it for some time the internal used space increased to about 280 MB, having it mounted and running from it, when checked the fragmentation on the drive holding it, the MinWin-WB-1.vhd file (2 GB when online) was very fagmented externally, and decided to defragment the VHD file (not its content, that was fine), just to see if this could create some issue, having it online, used Defraggler portable again, the process finished very fine without any issue, and it rebooted later very fine again.

 

After switch off, I booted from a WinPE (for faster boot), to take a look to the drive holding it, the size of the MinWin-WB-1.vhd (now offline) was about 300 MB, all contiguous, and located now in a place of the drive where it can freely expand when mounted to its 2 GB full size without getting fragmented again, as long as I keep the precaution to have it attached when adding a new file to that drive.

 

Then I repeated the process againg, this time using MinWin-WB-1.vhd as Parent VHD and created MinWin-WB-2.vhd as its Child VHD, it booted very fine from MS bootmanager, but not from grub4dos + ntloader, so this shows grub4dos + ntloader only works fine for first level Differential VHDs.

 

Conclusions of this test:

 

1 - If Parent VHD is a dynamical VHD installed in Wimboot mode we can assign to it a bigger size, without impacting the combined size of the VHDs set since the beginning.

 

2 - The used size (Parent + Child) of a set of Differential VHDs made from dynamical VHDs installed in Wimboot mode, is smaller than if using as parent a fixed size VHD, and this allows to have more free space in the child VHD.

 

3 - The total used size (Parent + Child + WIM file) of a set of Differential VHDs made from dynamical VHDs installed in Wimboot mode, is smaller than if using as parent a fixed size VHD installed in Compact LZX mode (the more versatile in previous Post), and also allows to have more free space in the child VHD.

 

4 - First level Differential VHDs made from dynamical VHDs installed in Wimboot mode, boot fine as Filedisk from internal HD on MBR/CSM or UEFI environments, using Windows boot manager or grub4dos + ntloader, but not from a USB device if using grub4dos + ntloader.

 

5 - Second level Differential VHDs made from dynamical VHDs installed in Wimboot mode, boot fine as Filedisk from internal HD or USB device, using Windows boot manager, but DO NOT boot fine in both cases if using using grub4dos + ntloader.

 

 

Final conclusions, including the info in previous post I can say:

 

I- Windows boot manager is the best option to (MBR/CSM and UEFI) boot as Filedisk all kind of Differential VHDs, from internal HD or USB device.

 

II - Windows boot manager supports Filedisk booting multi level Differential VHDs.

 

III - Differential VHDs made from dynamical VHDs installed in Wimboot mode, are the best option for space saving.

 

alacran



#35 alacran

alacran

    Platinum Member

  • .script developer
  • 2704 posts
  •  
    Mexico

Posted A week ago

JFYI

 

In order to keep all info available in this topic:

 

From: http://reboot.pro/in...e=2#entry221771

 

JFYI

 

This is the answer from yaya related to Differential VHDs:

 

From: https://github.com/c...ment-1258001726

Quote

 

G4E once realized the first level difference, but it has no practical use, just an experiment. This function has been removed in the new version. No longer supported!

 

Differential VHDs are not directly supported anymore in G4E.  So no way to Ramboot them.

 

Only option remaining in grub4dos to filedisk boot differential VHDs (in MBR and UEFI), is by means of using the external command ntloader, as in my ntloader menus included in this project.

 

Also Ventoy is capable to filedisk boot differential VHDs (in MBR and UEFI).

 

alacran

 

alacran







Also tagged with one or more of these keywords: vhd, fixed, dynamic, tools for vhd

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users