Convert Vhd To Vmdk Windows

5 views
Skip to first unread message

Daria

unread,
Aug 5, 2024, 1:27:22 AM8/5/24
to gritysunprom
Ineed to convert a vmdk to vhdx to be used with Hyper-V. I converted the file using this:

qemu-img.exe -p -f vmdk -O vhdx -o subformat=dynamic C:\Hyper-V\Imports\VMWare\FreeRadiusAAMES\FreeRadiusAAMES.vmdk C:\Hyper-V\VHDs\FreeRadius.vhdx


Failed to Power on with Error 'The requested operation could not be completed due to a virtual disk system limitation. Virtual hard disk files must be uncompressed and unencrypted and must not be sparse.


I used the VMWare VCenter Converter Standalone Client to convert a physical drive on my old PC to a virtual drive. The conversion worked fine and I ended up with a valid VMDK file. Next, I wanted to convert the VMDK to a VHD for use with Microsoft Virtual PC, since that's what I use on my new box. I used WinImage for the conversion and that worked fine, too. I can access the files from the virtual drive through WinImage.


However, when I create a new virtual machine using Virtual PC and add the existing VHD file, the machine doesn't boot. The initial boot screen flashes with the amount of RAM and then the screen goes black. If I turn off the VM and reboot in safe mode I can see the drivers being loaded until eventually it gets to crcdisk.sys and hangs indefinitely.


If your old PC uses an EIDE (possibly also SATA) disk you can probably just snapshot it and restore the snapshot to a blank VM disk and the VM should boot. See www.drivesnapshot.de for my favourite (free evaluation!) snapshot tool.


This should solve your problem. Basically, even if your windows supports IDE drives, if it was installed on anything else, the IDE drivers aren't used. In order to set them up, you need to follow the article


Check the disk type under Vmware. It could have been converted to a Scsi disk - for which virtual PC doesn't have a driver. You may need to revirtualize the original disk but choose to convert it to an IDE disk.


Tried to convert a physical windows vista home 32 bit machine using VMWare Converter Standalone 5.0. It did not boot.What worked for me:Creating the conversion is crucial, for the hard drive settings in particular, . For ME, I had to select IDE. (but other people had the opposite, example: In the VMWare Converter job task, rather than choosing the "Preserve Source" or the "IDE" -- I choose the "SCSI LSI Logic" .)


After this completes successfully (no errors), import the .VMX into Vmware and check the settings. IF it still didnt work, here is where "IDE" comes into play to help, when the hard disk controller created as IDE, when booting even if you get a Blue Screen STOP error (0x0000007b) you can fix it manually. To do so, you should run a program such as fix_hdc (in my case it was on an old Hiren Boot CD under Start -> Programs -> Registry Tools -> Fix_hdc -> Fix hard disk controller. ) There seem to be similar programs out there called MergeIDE and FixIDE that do the same thing. You will need a bootable CD to run these. Hopefully you can manage that.


Note: about "BCD" - If the computer is simple with 1 drive and 1 partition, your BCD should not be messed up so I suggest dont waste time with that unless you for sure think it got messed up. (Also it would give different errors and error out different places in the boot process. If you see the graphical progress bar, its not that. It would error on some text saying \winload.exe or something).


I am having some issues with a VHD that I have created from an old machine. The VHD was created using sysinternals disk2vhd software then converted to a VMDK using winimage. I am trying to load it in VMware but when it boots I get a BSOD. See below.


What VMware product are you using? ESXi? Workstation? You probably want to check the integrity of the vmdk; see if you can add it to an existing virtual machine, and verify that it will at least mount as a secondary drive.


So last night before I left I converted a machine that I had just built up to test a new method of backing up file. I have booted this in Workstation and installed the VM Tools. I powered the machine down and mounted the machine I am having trouble with into the VM. I can navigate around the file system and it appears to be solid.


Before you upload a Windows virtual machine (VM) from on-premises to Azure, you must prepare thevirtual hard disk (VHD or VHDX). Azure supports both generation 1 and generation 2 VMs that are inVHD file format and that have a fixed-size disk. The maximum size allowed for the OS VHD on a generation 1 VM is 2 TB. You can validate your VHD or VHDX file by refering to this documentation.


You can convert a VHDX file to VHD, convert a dynamicallyexpanding disk to a fixed-size disk, but you can't change a VM's generation. For more information,seeShould I create a generation 1 or 2 VM in Hyper-V?and Support for generation 2 VMs on Azure.


Azure platform mounts an ISO file to the DVD-ROM when a Windows VM is created from a generalizedimage. For this reason, the DVD-ROM must be enabled in the OS in the generalized image. If it isdisabled, the Windows VM will be stuck at out-of-box experience (OOBE).


For VMs with legacy operating systems (Windows Server 2012 R2 or Windows 8.1 and below), make sure the latest Hyper-V Integration Component Services are installed. For more information, see Hyper-V integration components update for Windows VM.


Make sure that each of the following Windows services is set to the Windows default value. Theseservices are the minimum that must be configured to ensure VM connectivity. To set the startupsettings, run the following example:


If you receive an error message when runningSet-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name -Value ,you can safely ignore it. It means the domain isn't setting that configuration through a GroupPolicy Object.


Make sure you know the built-in administrator account and password. You might want to reset thecurrent local administrator password and make sure you can use this account to sign in to Windowsthrough the RDP connection. This access permission is controlled by the "Allow log on throughRemote Desktop Services" Group Policy Object. View this object in the Local Group Policy Editor:


Restart the VM to make sure that Windows is still healthy and can be reached through the RDPconnection. At this point, consider creating a VM on your local Hyper-V server to make sure theVM starts completely. Then test to make sure you can reach the VM through RDP.


Ideally, you should keep the machine updated to the patch level, if this isn't possible, make surethe following updates are installed. To get the latest updates, see the Windows update historypages: Windows 10, and Windows Server 2019,Windows 8.1, and Windows Server 2012 R2 andWindows 7 SP1, and Windows Server 2008 R2 SP1.


To avoid an accidental reboot during VM provisioning, we recommend ensuring that all WindowsUpdate installations are finished and that no updates are pending. One way to do this is toinstall all possible Windows updates and reboot once before you run the sysprep.exe command.


System Preparation Tool (sysprep.exe) is a process you can run to reset a Windows installation.Sysprep provides an "out of the box" experience by removing all personal data and resetting severalcomponents.


Not every role or application that's installed on a Windows-based computer supports generalizedimages. Before you use this procedure, make sure Sysprep supports the role of the computer. For moreinformation, seeSysprep support for server roles.


A custom unattend.xml file is not supported. Although we do support theadditionalUnattendContent property, that provides only limited support for addingmicrosoft-windows-shell-setupoptions into the unattend.xml file that the Azure provisioning agent uses. You can use, forexample,additionalUnattendContentto add FirstLogonCommands and LogonCommands. For more information, seeadditionalUnattendContent FirstLogonCommands example.


Disks in Azure must have a virtual size aligned to 1 MiB. If your VHD is a fraction of 1 MiB, you'll need to resize the disk to a multiple of 1 MiB. Disks that are fractions of a MiB cause errors when creating images from the uploaded VHD. To verify the size you can use the PowerShell Get-VHD cmdlet to show "Size", which must be a multiple of 1 MiB in Azure, and "FileSize", which will be equal to "Size" plus 512 bytes for the VHD footer.


In this example, replace the value for Path with the path to the virtual hard disk that you wantto convert. Replace the value for DestinationPath with the new path and name of the converteddisk.


In this example, replace the value for Path with the path to the virtual hard disk that you wantto resize. Replace the value for SizeBytes with the new size in bytes for the disk.


Install theAzure Virtual Machine Agent. Thenyou can enable VM extensions. The VM extensions implement most of the critical functionality thatyou might want to use with your VMs. You'll need the extensions, for example, to reset passwordsor configure RDP. For more information, see theAzure Virtual Machine Agent overview.


Don't panic if more than just the last file is smaller than 2146762752 bytes. Some VMware products create vmdk spans with different sizes. The size should match 512 times the number of sectors listed in the extent description in the main vmdk file (readable with any text editor or "cat").


None of these answers actually worked as of QEMU 7.1.0. It became as trivial as working on the single small .vmdk file that references the other larger vmdk image files. Supposing you have the following collections of files:


I just resurrected a 10 year old offline root certificate authority that had run on VmWare Workstation and so have had opportunity to verify @Stuart's answer as correct as of QEMU version 6.2.0 (probably earlier). qemu-img convert will indeed recombine all the files into a single .qcow2 file. But ...


It is critical that you identify and use the "top" file in the backing chain as the source file in qemu-img convert - you cannot reliably identify the top file by VmWare's naming conventions - they vary apparently.

3a8082e126
Reply all
Reply to author
Forward
0 new messages