Creating VHDs for SteadyState Imaging Options and Other Uses

Discussion in 'other software & services' started by Mr.X, Mar 12, 2024.

  1. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    5,257
    Location:
    .
    Hello fellas,

    Knowing that you are very knowledgeable people, I want to ask you if you can assist me on how to install Windows on a VHD or VHDX. I want to open a dedicated public thread here on Wilders though, kind of a tutorial.
    I want to learn all thte basics and not so basics, how to backup, etc.

    There's a guy from MDL who says conventional installations are old and obsolete methods from the 90's.


    If you are willing to be helpful I will be more than grateful.

    Also there's a guy from MDL who says conventional installations are old and obsolete methods from the 90's.
    Is that even true?

    https://forums.mydigitallife.net/threads/discussion-cold-disk-imaging.52728/page-23#post-1823052
    https://forums.mydigitallife.net/threads/discussion-cold-disk-imaging.52728/page-24#post-1828136



    TIA
     
  2. busy

    busy Registered Member

    Joined:
    Apr 10, 2006
    Posts:
    507
    Could this be the usage method you are talking about?
    Code:
    https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/boot-to-vhd--native-boot--add-a-virtual-hard-disk-to-the-boot-menu
     
  3. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    The following instructions were compiled at the request of @Mr.X and @TheRollbackFrog

    The instructions are for creating a vhdx (virtual hard disk) on a physical system, and deploying a Windows OS on it.

    I tested these instructions on a Windows 11 Pro 23H2 system, and deployed Windows 11 Pro 23H2 inside the vhdx. It should be the same for Windows 10 system/vhdx deployment. I do not have Windows 10 anymore so I could not test it. Let me know if something does not work.

    You will need a system with enough free space (at least 40 GB), Windows 11 ISO from Microsoft, and EasyBCD.

    Let me know if some point in the instruction is not clear.

    .
     
  4. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    By the way, I am not sure how a vhdx can be used as an imaging software replacement. I will do further research on it.

    The only way it can be used as a imaging software is if you setup the OS inside the vhdx the way you want, with all the software etc. At this point just make a copy of the vhdx and move it to a different location. This can be used as a point in time image of the system. Now you can use the OS inside vhdx any way you want, install garbage on it, test dodgy software etc. When you are done, just delete the vhdx file, and replace it with the copy you backed up. Everything you did after the copy was made will be instantly gone.

    An imaging software on the other hand offers much more like incremental/differential images. You do not have to restore all the way back to the original image, just to the incremental created before the problem occurred.

    The main benefit for a vhdx is that you can deploy multiple OS's in the same partition/drive. They are each contained within their own vhdx, so are not aware of each other. You can boot into any one of them at a time. These vhdx's are portable, so can be taken to another system or connected to a VM. All you need to do is to make it bootlable on the other system.
     
    Last edited: Mar 12, 2024
  5. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    5,180
    Location:
    The Pond - USA
  6. pb1

    pb1 Registered Member

    Joined:
    Apr 4, 2014
    Posts:
    1,450
    Location:
    sweden

    How long time does it take to make a copy, and, to restore the mentioned copy?
     
  7. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    Depends on the size of the vhdx, and whether it is being copied to and from an SSD or a HDD.

    Just tested on my system. A vhdx of 11.2 GB copied from one SSD to another SSD, took about 12.4 sec to complete.
     
  8. pb1

    pb1 Registered Member

    Joined:
    Apr 4, 2014
    Posts:
    1,450
    Location:
    sweden
    Since posting i have read some about it on the net, and i began think, what is the actual benefit of using this, instead of a traditional os?
    To me it seems as the same thing, but in another way. So, what are the benefits?
     
  9. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA

    The benefits will vary from person to person. Some of the main benefits are:

    -Install Multiple OS's on the same system without having to make separate partitions for each OS.

    -Each OS is installed in a single file, so is easy to manage.

    -OS's are portable and can be taken to and connected to a different physical system, or can be booted in a virtual machine if desired.

    -Can be used for testing software, and when the testing is done, the original vhdx can be restored fairly quickly to get the system back to factory state.

    -Unlike running a test OS inside a VM like Vmware or Virtualbox, where the guest OS runs on top of the host OS, thus both OS's are running at the same time causing a performance impact, when one boots into a vhdx, only one OS is running. So there is no performance impact.

    -Can be used as a cloud based OS to service customers. If a customer needs a fresh OS, a vhdx based one can be deployed within seconds.

    -Businesses who need a virtual environment for testing software etc. do not need to buy a license for a VM software, like Vmware or Virtualbox. vhdx functionality is included free of charge with Windows.
     
    Last edited: Mar 12, 2024
  10. Pliskin

    Pliskin Registered Member

    Joined:
    Feb 8, 2009
    Posts:
    446
    I use WinNTSetup

    Tutorial
    https://www.youtube.com/watch?v=T3hqtiH6ufM
     
  11. pb1

    pb1 Registered Member

    Joined:
    Apr 4, 2014
    Posts:
    1,450
    Location:
    sweden
    Hm, that was many things speaking for it.

    The copying you mentioned earlier, i suppose that is Windows "copy & paste" functionality?
    So the copying of a partition is done as a file, the data, not the partiton per se?
    I get the impression it is only a C: partition without boot, system reserved etc, or?
     
  12. Adric

    Adric Registered Member

    Joined:
    Feb 1, 2006
    Posts:
    1,791
    I've been using VHDs for a while now. A few things to remember:

    o VBox only supports vhdx in r/o mode so they are not meant for booting from there. See here.

    o W7 will not boot from a vhdx (0xc03a0001 ERROR_VHD_DRIVE_FOOTER_MISSING)
    Note: Trim for C: in vhd not supported. Vhd vs Vhdx explained at here.
     
  13. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    Yes the copy was done with Windows built in function. The entire OS is in the form of a .vhdx file. That file with just the Windows 11 OS on it is 11.2 GB on my system. It will dynamically grow as you keep on adding software to it.

    The way I have deployed windows to vhdx, I believe there will only be one OS partition. You can always install Windows on this vhdx the old fashioned way by booting through a Windows installation media. I believe doing it that way will create the EFI, MSR and WinRE partitions. I have not played around with that in a long time. The instructions for doing it that way are slightly different, because you will first have to mount your vhdx using diskpart before Windows installation media can see it.
     
  14. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    I personally have not setup or used a vhd in a long while. I don't see a use for it in my case as I have Vmware Workstation. So anytime I need to test a software or a malware, I just boot up a OS inside Vmware. There is a performance hit, but for that short duration I don't mind.

    I also have not had dual OS's on my system in years. Again I don't see a benefit of having multiple OS's. However, a lot of people have multiple OS installed on their main system at a given time, and it is a lot easier to do that in form of a vhd than creating a different partition for each OS.

    These instructions were complied at the request of Mr.X and TheRollBackFrog, who wanted to create, test and play with vhds. Hopefully I was able to help them out with their requirements.
     
  15. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    Its a good software. But I had a catastrophic issue with it many years ago around 2010-11, installing Windows 7 I think. It might be a bug in that particular version, and most likely was fixed soon after, but I have not used WinNTSetup since then.

    In any case the instructions I wrote seem complicated at first glance, but they are not. In fact, you only need to remember the syntax for two dism commands. Everything else is simple and straight forward.
     
  16. pb1

    pb1 Registered Member

    Joined:
    Apr 4, 2014
    Posts:
    1,450
    Location:
    sweden
    Ok, thanks.

    I was thinking of install vhdx on a clean disc so i only get 1 W11 Os. How do i do that?
    Alternatively, which way do you recommend to do it?
     
  17. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA

    If you want to have only a vhd based OS on your system then during Windows installation, you will have to create a vhd thorough cmd and diskpart, and attach the vhd to the system before Windows installation media can see it and install Windows on it.

    However, I recommend using a vhd as a secondary OS just in case something goes wrong with the vhd, then at least you have your main system to fall back on. You can just set your vhd as the default OS, then every time you boot your PC, you will always boot into the vhd instead on the main OS.
     
  18. pb1

    pb1 Registered Member

    Joined:
    Apr 4, 2014
    Posts:
    1,450
    Location:
    sweden
    I have found a guide for that on the net which i was thinking to follow. But if you could post one here in a day or 2 it would be much appreciated.

    Does things go wrong often?

    I will of course save my images i now have so i can implement them if needed.
     
  19. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA

    I can type the commands for you right now. I won't be able to test it for you.

    Things can go wrong, but as I mentioned before I have never before installed a vhdx only OS, I have always installed a vhdx as a second OS, so I cannot confirm if there will be issue down the road.

    Here are the steps: Let me know if there are issues.

     
  20. pb1

    pb1 Registered Member

    Joined:
    Apr 4, 2014
    Posts:
    1,450
    Location:
    sweden
    Thank you!

    Since i will install W11 it will have to be at least 64GB i suppose?
     
  21. pb1

    pb1 Registered Member

    Joined:
    Apr 4, 2014
    Posts:
    1,450
    Location:
    sweden
    Got around to try this today but a problem arose, CMD does not see my disk so i can not create a vhdx file. It lists the usb - only. Trying to solve this but, well, it is not going to good. So far no guide on the net has helped.
     
  22. pb1

    pb1 Registered Member

    Joined:
    Apr 4, 2014
    Posts:
    1,450
    Location:
    sweden
    I succeded at last. In my vhdx C:partition, there is a 4gb vhdx file, why is that, should i save it and or, what can i do with it etc etc?

    I tried to copy C: to an external disk, it took forever and with at lot of files that could not be moved and questions about them all the time. Hence the forever. How do i do away with that?
     
  23. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    Inside cmd you need to use the diskpart utility. Diskpart is a full fledged command line partition manager and will be able to see your disk.


    Are you saying you have a 4 GB vhdx file inside your 64 GB vhdx partition? I don't know how that happened, but you can delete it.

    When you want to copy, you should not be booted into the vhd at that time. You should make a copy while booted from an external media. You can use any external media, like an imaging software's boot media that has a file explorer built in. That way you are only coping a vhdx file and it is very fast.
     
  24. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    I was able to test your setup inside vmware workstation. If you already have an EFI, MSR and WinRE partitions on your disk then all you need to do it to choose to create your vhdx file on your C partition. Then the Windows installation will use the existing EFI partition for boot files and WinRE partition for WinRE.

    The Windows installation creates another set of EFI, MSR and WinRE partitions, you can safely delete the unused ones. So at one time you only need one each of EFI, MSR and WinRE partitions. The only tricky part is to figure out which ones are being used by the vhd based Windows and which ones are extra ones. I did not do this step in Vmware, as I was just testing to see if a vhd only installation will work. It worked fine, though I still prefer to have my vhd based OS as a secondary OS on the system.

    If your C partition is 64 GB then create a vhdx of no more than 54 GB to be on the safe side. The vhdx is dynamically expanding, so will expand to the full 64 GB size if needed in future.
     
    Last edited: Mar 15, 2024
  25. pb1

    pb1 Registered Member

    Joined:
    Apr 4, 2014
    Posts:
    1,450
    Location:
    sweden
    Hi.

    Well, i deleted the 4gb file.

    If i install it in the existing Os, how will i be able to copy the vhdx to external usb?
    A silly question, what is it one copies, the content in the partiton or what?

    Maybe i should create a smaller partition because i want speed in copying, or?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.