How to convert a VHDX file to VHD?
I made an image with disk2vhd and unfortunately I chose VHDX instead of VHD. I didn’t see any information about what to choose. Anyway, now that file is all I have, the original PC is trashed. So I need to know how to run it as a Virtual Machine in Windows 7. VirtualBox doesn’t have an option to open VHDX and WM Converter doesn’t have an option to open VHDX (or to convert to VHD).
6 Answers 6
You can do that conversion with VirtualBox :
VBoxManage.exe clonemedium "input_file.vhdx" "output_file.vhd" --format VHD
Default Path to VBoxManage.exe
C:\Program Files\Oracle\VirtualBox\
It looks like this is broken in VirtualBox 5.0. The report is labeled as «critical», but hasn’t been modified in 7 months, so not very optimistic.
Also, one can encounter the VHDX: Image has a non empty log which is not supported (VERR_NOT_SUPPORTED) error message.
Before anything, make a backup of the original .VHDX, just in case.
You said you have Windows 7. In that case, you can easily convert VHDX to VHD with PowerShell.
Go to «Run. » ( Windows + R ) and type Powershell .
Then, in the PowerShell command line, type the command PS C:\> Convert-VHD –Path YOUR VHDX PATH –DestinationPath YOUR DESTINATION PATH
It should be converted then.
You can find additional information about the Convert-VHD command here.
Ok, I give it a try. But it says >> Applies To: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2
Even after upgrading to PowerShell 4.0 I just get The term ‘Convert-VHD’ is not recognized as the name of a cmdlet, function, script file, or operable program. on Windows 7
To convert vhdx to vhd use the free StarWind V2V Image Converter
I made the same mistake, when creating the Virtual disk from the physical with Disk2VHD, there is a check box at the top right (second down) that is ticked by default to create a vhdx, Remove this check and it will create a vhd instead.
I managed to extract files from a Windows 10 VMDH «Windows Image Backup» and to write them to a Windows 7 machine: I installed Windows Server 2012 (free 180 days evaluation) in a virtual machine and connected it to my local hard disk via a network share. This way I could «mount» the VMDH backup and write the important files back to my local drive.
cd "C:\Program Files\Oracle\VirtualBox"
VBoxManage convertfromraw "C:\Full-Path-To\image.VHDX" "C:\Full-Path-To\new-image.VHD" --format VHD
After that, I would prefer giving the result VHD image a new UUID by using this command:
VBoxManage internalcommands sethduuid "C:\Full-Path-To\new-image.VHD"
Extra step I usually do when converting/cloning images in VirtualBox as it tends to show many errors when it finds 2 images with the same UUID. Unlike Hyper-V doesn’t care for that.
Note: These commands mentioned above are case sensitive! (convertfromraw — internalcommands — sethduuid)
Как преобразовать файл VHDX в VHD?
Я сделал образ с disk2vhd и, к сожалению, я выбрал VHDX вместо VHD. Я не видел никакой информации о том, что выбрать.
В любом случае, теперь этот файл — все, что у меня есть, оригинальный компьютер уничтожен. Поэтому мне нужно знать, как запустить его как виртуальную машину в Windows 7.
VirtualBox не имеет возможности открывать VHDX, а WM Converter не имеет возможности открывать VHDX (или конвертировать в VHD).
Вы можете сделать это преобразование с VirtualBox:
VBoxManage.exe clonehd "PATH_TO_YOUR_FILE.VHDX" --format VHD "PATH_TO_CONVERTED_FILE.vhd"
Похоже, это не работает в VirtualBox 5.0 . Отчет помечен как «критический», но не изменялся в течение 7 месяцев, поэтому не очень оптимистично.
Также можно встретить VHDX: Image has a non empty log which is not supported (VERR_NOT_SUPPORTED) сообщение об ошибке.
Прежде всего сделайте резервную копию оригинального .VHDX, на всякий случай.
Вы сказали, что у вас Windows 7. В этом случае вы можете легко конвертировать VHDX в VHD с помощью PowerShell.
Перейдите к «Run . » ( Windows + R ) и введите Powershell .
Затем в командной строке PowerShell введите команду PS C:\> Convert-VHD –Path YOUR VHDX PATH –DestinationPath YOUR DESTINATION PATH
Это должно быть преобразовано тогда.
Вы можете найти дополнительную информацию о Convert-VHD команде здесь .
Хорошо, я попробую. Но он говорит >> Применимо к: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2
Web Tips, Etc.
The Path to Success: Physical Server converted to VirtualBox
SysInternals Disk2VHD is great as long as you use VHD format NOT VHDX ! ! ! Avoid VHDX if you want to use the resulting image in VirtualBox. This holds true until you see that VirtualBox fully supports VHDX format. Right now — October 2014 — CentOS7 — VirtualBox 4.3 — VHDX is supported as a «readonly» disk. That means, you must convert VHDX to VHD (or something) before you can really use it.
So stick to VHD. Uncheck the box for VHDX support .
When you run Disk2VHD on your physical server with Windows, select ALL the partitions AT ONCE and create ONE (1) VHD file. Do not make separate VHD files. Make ONE. Make sure you include the reserved system boot partition, plus your Windows7 operating system partition, plus any data partitions.
You can then use the resulting SINGLE VHD file on the IDE controller of your new VirtualBox machine. You can probably use it in HyperV and VMWare but I only tested in Oracle VirtualBox.
OOPS made separate files
This error messages is symptomatic of having created separate VHD files for each partition, say if you tried to boot just the Win7 partition on the IDE controller:
This will happen even if you convert from separate VHDX files to separate VDI files. The boot sector details get lost when you make separate partition images.
OOPS VHDX
«Failed to open the hard disk file» «Could not open the medium» «VD: error VERR_NOT_SUPPORTED opening image file»
If you have already gone with VHDX it is not entirely too late. You can convert VHDX to VHD using the command line tool available on Windows and Linux hosts. This works if you have converted ALL relevant partitions. While it will convert single partitions, the resulting image will not boot. How do I know? I tried it.
vboxmanage clonehd MYDATAFILE.VHDX —format VHD mydatafile.vhd
Use the full path to each file if you are not converting files in the current directory.
Windows:
CentOS:
vboxmanage clonehd /home/path/MYDATAFILE.VHDX —format VHD /home/path/mydatafile.vhd
Remember to set permissions such that the virtualbox «user1» can load the final file.
chown user1:vboxusers /home/path/mydatavile.vhd
- Get link
- Other Apps
Convert Hyper-V VHDX to VHD
You ask yourself – why would you do this, who is this tutorial for? VHDX is after all newer hard disk format with many benefits.
I need this command quite often, since Azure is limited to .vhd files and my template library for local lab deployment is mostly vhdx (gen 2 virtual machines).
Here is a quick trick to convert .vhdx to .vhd. You can do it by selecting one of the two methods below.
Method 1
Open Powershell with elevated privileges (as admin) and type in following command:
Convert-VHD –Path c:\temp\Vmdisk.vhdx –DestinationPath c:\temp\VMDIskNEW.vhd
Here is how it looks like in real life
And soon enough, it is done
There is also another (easier for some) method of doing this vhdx to vhd conversion.
Method 2
Again, I have a vhdx disk that I want to convert, copied to c:\temp folder.
I will then open Hyper-V Manager. I created simple empty VM (Generation 2), to which I will then attach this VHDX.
Select VM (it can also be your regular VM, just be careful with handling disks) and select Settings from the right window
After Settings are opened, click on SCSI Controller, Hard Drive – Add
New Hard Drive will appear under SCSI Controller and it will be empty, select Browse and point to VHDX drive you want to convert from VHDX to VHD. Path to your VHDX should be then visible in the field.
Ok, now that the vhdx we wish to convert is attached to our temporary VM, we will select Edit button (we are still in Settings area under Storage Controller).
New Wizard will appear, before start – make sure you selected right vhdx disk, you really want to convert. It would be extremely wise not to do this procedure on your production VM machine.
We will select Convert action | Next
If you are going to use this machine in Azure, you will select Fixed size. Otherwise select what you see fit.
You will then have to select location and the name for converted vhd. I selected as depicted below. Next
Check your settings and select Finish. Conversion process will then start.
You can now Remove VHDX you attached for the conversion, from your VM.
With this step we are concluding this tutorial, in which I showed two methods for converting VHDX to VHD.