Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best way to make a new VHD from a Windows 10 ISO
#11
I have a hunch that Steve2926 has hit the target in his post above where he points that BCD might be the culprit here.

E.g., here's the internal disk layout of my Windows 10 VHD, automagically created with VirtualBox under Linux, which boots fine placed on a MBR disk.

[Image: winvhd.png]

That "System Reserved" partition is in fact the EFI boot store and it becomes active only after Ventoy successfully boots the VHD -- prior to that the main boot store is Ventoy's own "VTOYEFI" partition present in the physical boot drive (also hidden).

I have gone the VHDX path before, since my go to recipe for installing Windows 7 in a virtual disk apparently didn't work any longer with 10 -- and, at first, everybody just said it couldn't even be done.

Bear in mind that, should you decide to try it, you'll be restricted to VHDX under mandatory GPT formatted drives and the new UEFI booting scheme

This absolutely won't work with MBR style drives. I have had nothing but endless grief trying to juggle those restrictions under Windows.
Reply
#12
Midas, thank you for your ideas on this topic. And then thanks to Steve2926 of his idea of using a VHDX instead of a VHD. I gave that format a try today. But I still have no luck. The same error as described in the first post in step 4 shows up.


So no matter if I use a VHD or a VHDX-file the partitions look like "Disk 0" on this screenshot, that I found on the Internet:[Image: efi-system-partition.png]

I noticed that in the VHD-image created by Rufus basically
  • the partition "System Reserved 50 MB NTFS Primary Partition" at the beginning is missing, instead I have a 260 MB (in this screenshot 100 MB) EFI System Partition" there
  • the "505 MB Recovery Partition" at the end is missing.
That is interesting, although I don't know if that matters here. I would guess that it does matter, because the VirtualBox-approach does create a different layout that is working, as Midas has shown. By the way, the partition layout is the same at creation time and after the first boot. So Windows 10 does not create any additional partitions during its first boot process - at least not until the previously mentioned error shows up.

Interestingly, the Rufus-page mentions that Windows ISO is compatible with Ventoy: https://github.com/pbatard/rufus/wiki/FA...ot-support:
Quote:[...] or you might as well use Ventoy (which is most likely what you are looking for) or RMPrepUSB or Easy2Boot or YUMI as there already exist quite a few solutions to perform what you seek.



So I thought about another method, described at https://www.neowin.net/news/guide-how-to...using-vhds:

Using Ventoy I booted from the Windows ISO, pressed SHIFT + F10 at the setup screen and created a VHD with DISKPART-commands there on the fly. However, at some point of the installation process it shows me the exact same error as mentioned in the first post shown in step 4. I repeated the same approach using a VHDX, just to make sure. So even two approaches, one with Rufus, one using the DISKPART-commands of Windows cannot produce a new, bootable VHD or VHDX. I try to investigate further, any ideas are of course welcome.
Reply
#13
I got this to work with qemu-utilts on Ubuntu Linux, I had to resize my VM yet I ended up converting my VHD into a RAW image. Then had to convert it back to VHD
qemu-img convert -f raw image.raw -O vpc image.vhd
It not fast but im booting windows 10 from ventoy agian.
This would also work with a disk containing windows.
Just replace image.raw with /dev/(yourWinDisk)sda,sdb, etc
Reply
#14
I found this on my notes from last year's Windows 10 install -- maybe it will help someone.

Quote:Installing Windows 10 to VHDX on 'bare metal', what worked

Basically following the recipe below with the following caveats:

- "Native boot for Windows 10 requires the .vhdx format, not the .vhd format."
  This is accomplished by specifying the required file extension in the create commands.

- Windows 10 requires UEFI enabled disks to be formatted to GPT -- NOT MBR! -- and the ideal partition scheme is way more complex...

Cf. https://docs.microsoft.com/en-us/windows...-boot-menu


Previously, I had been following this recipe to setup Windows 7 to VHD from 'bare metal':

http://www.johnpapa.net/bootoffmetal/


As noted the partition scheme is way more convoluted -- and I suspect it could be even more so, with the ideal setup having some kind of boot store set outside the virtual disk that nontheless mirrors the one inside it (and vice-versa...).


Premiere Wrote: $ qemu-img convert -f raw image.raw -O vpc image.vhd


Thanks for the tip, I'm sure it will be handy in the future. Cool
Idea When a post helps you in any way, please rate it. Thank you. [Image: rateit.png]
Reply
#15
Premiere, thank you for your hint. That is indeed interesting. You said:
Quote:Just replace image.raw with /dev/(yourWinDisk)sda,sdb, etc

What is "/dev/yourWinDisk" then? I want to start from a Windows ISO image, not from an existing partition on a hard disk. But maybe I've got you wrong.



Midas, thank you for your comment. I've already tried the format VHD as well as VHDX, it seems to make no difference here, the error message is still the same.
Reply
#16
(01-27-2021, 07:18 AM)romf Wrote: Premiere, thank you for your hint. That is indeed interesting. You said:
Quote:Just replace image.raw with /dev/(yourWinDisk)sda,sdb, etc

What is "/dev/yourWinDisk" then? I want to start from a Windows ISO image, not from an existing partition on a hard disk. But maybe I've got you wrong.



Midas, thank you for your comment. I've already tried the format VHD as well as VHDX, it seems to make no difference here, the error message is still the same.
Convert VMDK image to RAW, Qcow2, VDI & VHD
[b]I.[/b] Convert VMDK image to RAW:
qemu-img convert -f vmdk image.vmdk -O raw image.raw
[b]II.[/b] Convert VMDK image to Qcow2:
qemu-img convert -f vmdk image.vmdk -O qcow2 image.qcow2
[b]III.[/b] Convert VMDK image to VDI:
qemu-img convert -f vmdk image.vmdk -O vdi image.vdi
[b]IV.[/b] Convert VMDK image to VHD:
qemu-img convert -f vmdk image.vmdk -O vpc image.vhd
You can also try Reconvert the one you have with this utility and let me know if it works a bet it does.
Also make sure the ventoy drive is setup correctly.
NTFS cluster 2048 and the plugin is installed on the small boot partition in the ventoy folder.
sudo apt-get install qemu-utils
Windows.ISOs work fine for me. You really wouldn't want to convert an ISO. It's not supported I'm pretty sure.
VIRTUAL BOX , you can even use the dynamic VHD.
VMWARE PLAYER Also is FREE $ GOOD.
I really feel that taking the original disk and converting it into an image would be the best way.
Reply
#17
Thanks again, Premiere.

Ok, you're describing how to convert an image to another format. That is a handy tool indeed if you need it. In this thread I am still looking for any advice on on how to create such an image (in whatever format, e.g. VHD, VHDX) while I am working in my live system inside a running Windows 10 VHD booted by Ventoy. There I would like to take a new Windows 10 ISO that has been downloaded previously either by using the Microsoft's Media Creation Tool or directly using a download manager and prepare a new VHD that I can boot the next time using Ventoy so that I can abandon my existing VHD with a dated version of Windows 10 that I used to create the successor, most likely with a more modern version of Windows 10. But how to get this is still not resolved for me.
Reply
#18
(01-28-2021, 07:43 AM)romf Wrote: I would like to take a new Windows 10 ISO that has been downloaded previously either by using the Microsoft's Media Creation Tool or directly using a download manager and prepare a new VHD that I can boot the next time using Ventoy so that I can abandon my existing VHD with a dated version of Windows 10 that I used to create the successor...


No solution here, just saying that I really like your thinking. I hope someone manages to find a way to do this. Cool
Reply
#19
(01-28-2021, 07:43 AM)romf Wrote: Thanks again, Premiere.

Ok, you're describing how to convert an image to another format. That is a handy tool indeed if you need it. In this thread I am still looking for any advice on on how to create such an image (in whatever format, e.g. VHD, VHDX) while I am working in my live system inside a running Windows 10 VHD booted by Ventoy. There I would like to take a new Windows 10 ISO that has been downloaded previously either by using the Microsoft's Media Creation Tool or directly using a download manager and prepare a new VHD that I can boot the next time using Ventoy so that I can abandon my existing VHD with a dated version of Windows 10 that I used to create the successor, most likely with a more modern version of Windows 10. But how to get this is still not resolved for me.
To do that you would need a few tools from Microsoft and you would need to manually extract the wim install image to the mounted VHD on Linux it called wim-tools.And wim-image is the command,  I THINK it's called  DSIM for Microsoft. You would need to manually set the boot partition with parted on windows I think it's DISKPART,  , really its possible, would take me a few days to figure out and remember all the commands.
Then there is also a command that installs the boot loader. Really would take a while to set up a working script.

ASLO Note that THE image is mounted differently on Linux than it is on a virtual machine so I also bet the same for windows. Can you mount a Virtual box image in WINDOWS?
I think the plugin only searchs the offset for virtual machine made VHD. When windows makes a VHD I think it my be raw image.
Reply
#20
Premiere Wrote:You would need to manually set the boot partition with parted on windows I think it's DISKPART, really its possible, would take me a few days to figure out and remember all the commands. Then there is also a command that installs the boot loader. Really would take a while to set up a working script.

Just note that, in my last post above, there's a tutorial (check that last link) on how to do this without anything else than a USB Windows live setup image and, yes, it's mostly done with DISKPART.


Premiere Wrote:ASLO Note that THE image is mounted differently on Linux than it is on a virtual machine so I also bet the same for windows. Can you mount a Virtual box image in WINDOWS? I think the plugin only searchs the offset for virtual machine made VHD.

I know for sure you can mount VHD in a live Windows, even if it's running from a virtual disk itself, because I have done it.

Here's a couple of no-install free tools that may interest anyone working from Windows:

- Simple VHD Manager (https://www.sordum.org/8705/simple-vhd-manager-v1-4/)

- Disk2Vhd (https://docs.microsoft.com/en-us/sysinte...s/disk2vhd)
Idea When a post helps you in any way, please rate it. Thank you. [Image: rateit.png]
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)