Windows 10: Fun trying to convert an existing install to a vhd!

Discus and support Fun trying to convert an existing install to a vhd! in Windows 10 Virtualization to solve the problem; This is not specifically windows 10 but I thought it might be of interest. I currently have dual boot 10 home and 10 pro, and it leaves the... Discussion in 'Windows 10 Virtualization' started by cereberus, Aug 6, 2016.

  1. cereberus Win User

    Fun trying to convert an existing install to a vhd!


    This is not specifically windows 10 but I thought it might be of interest.

    I currently have dual boot 10 home and 10 pro, and it leaves the partitions decidely non-optimal. I decided I would create a virtual hard disk of the Home drive partition and delete the home partition.


    My drive is 1000 GB - partitioned as 3 drives (approx) 250 Home, 250 Pro, 500 Data.


    The Home drive only actually uses around 40 GB.


    So I used disktovhd to convert home drive (ignoring all others) to an expandable vhd (only 40 GB) on Data drive (over 400 GB free).


    I then used bcdboot command to enable booting from it, and rebooted.


    But it would not boot complaining not enough space on host (data) drive!


    I rebooted to windows, attached the vhd from disk management and I was surprised - disk to vhd nominally maps all partitions from the whole drive (ie 1000 TB) even if you do not want them! After quite a bit of googling, I discovered when you use an expandable vhd, it only loads if there is enough space to fit whole of original disk (so it can expand to that in future).


    So the vhd had nominally 750 GB of unallocated space1 More googling, and there is a tool vhdresizer which will reduce it in size. However, tool is so old, and requires a really old version of .Net, I could not get it working.


    So I thought, i will just image the Home drive partition only to the Data drive using Macrium Reflect, and convert that to a vhd. I was gob smacked to see the MRF image exhibited similar behaviour and the vhd still thought drive was 1000 GB!


    So I thought I would try creating a virtual disk and use Macrium to clone the Home drive partition to a new vhd, bbut it looked ok but would not boot.


    So, after trial an error, I finally did it using a smaller 150 GB drive in a usb caddy as follows.


    1) Image backup Home drive to Data Drive


    2) Restore backup to 150 GB drive


    3) Create image backup of 150 GB drive and convert to vhd on Data drive (I probably could have used disk2vhd for this step ie 1 action only).


    Then it worked. OK - maybe there are quicker ways but this did the job. So I was now able to wipe the home drive, and assign the space to data drive.


    The home drive vhd is on the data drive and only takes 40 GB but can expand up to 150 GB over time.

    :)
     
    cereberus, Aug 6, 2016
    #1

  2. How do I convert a VHD to VMDK?

    I have made a VHD using DISK2VHD and I wanted to know how to convert the VHD to a VMware VMDK file.

    I have tried to download VSphere Converter, but my VMware account refused to send me my account activation emails.

    If there is any other software or converters I can use, that would be great

    -Dare.
     
    DareDeveloper, Aug 6, 2016
    #2
  3. How do I convert a VHD to VMDK?

    Thank you, but after a day of waiting, my email to activate my VMware account, so I figured out how to convert it.
     
    DareDeveloper, Aug 6, 2016
    #3
  4. lx07 Win User

    Fun trying to convert an existing install to a vhd!

    What you could do if you wanted a smaller maximum size (which you are right is the size allocated when you native boot) is make an empty vhdx max size 40GB (or whatever maximum you want), mount it and use macruim to restore the image to that. This has worked for me so I'm not sure why yours would not boot.

    Anyway good you got it working *Thumbs
     
    lx07, Aug 6, 2016
    #4
  5. cereberus Win User
    Thanks - I'll try again- maybe it glitched or I made a mistake.

    Basically, I did the same thing with a real drive and took the scenic route *chuckle.
     
    cereberus, Aug 6, 2016
    #5
  6. lx07 Win User
    I broke the laptop I used for work and rather than get a new one moved it onto vhd (it had a 500GB drive and as I only needed OS and programs I put it on vhd with maximum size 20GB). Works well for me but in retrospect 20GB might have been a bit optimistic. I do find that vhds grow and shrinking them never really works very well - after time the vhd is always much bigger than the space used so it is good to limit it if you can.

    One other thing to bear in mind you can't upgrade systems on vhd. You'll have to connect the vhd to Hyper-V or VirtualBox or something to do the upgrade but that is a project for next year *Smile
     
    lx07, Aug 6, 2016
    #6
  7. cereberus Win User
    Yeah I tried again, and for some reason it fails whilst trying bcdboot command.
    Not a big deal.

    I was aware of vhd restriction re. build upgrades. It seems funny you can do it in hyper-v but not natively but easy enough to do but just a nuisance.
     
    cereberus, Aug 7, 2016
    #7
  8. lx07 Win User

    Fun trying to convert an existing install to a vhd!

    Do you have UEFI or BIOS? With UEFI you use bcdboot, with bios you use bcdedit... Solved Can't native boot Hyper-V generation 2 vhdx - Windows 10 Forums

    If bcdboot isn't working you could try bcdedit...

    It is a nuisance and considering you can clean install to vhd it seems odd. There is some complicated technical reason I'm sure.

    I use the same vhd for both native boot and Hyper-V and it is activated with a separate license on the Hyper-V machine. When booting native it picks up the digital entitlement of the underlying hardware. When switching between Hyper-V and native boot though I do have to re-authenticate my MS ID (put in my pin) or all the store apps crash. Like you said a nuisance.

    Probably you could upgrade using Hyper-V (and Windows would be deactivated if you don't have a separate key as the machine ID is different) and it would become activated again when you native boot again but I'm not sure about that. Perhaps upgrading using Hyper-V with the virtual switch disconnected if you don't have a separate key for the Hyper-V VM would be wise.
     
    lx07, Aug 7, 2016
    #8
  9. cereberus Win User
    MIne is uefi. It is odd bcdboot works fine with a vhd created from an MRF image or disktovhd, but when I create a new smaller one and restore partition, it falls over. I am wondering if this is connected to the disk id in some way?

    Thinking about it, how does Hyper-v handle a vhd from a native boot? Aren't all the drivers mixed up or is it clever to change to hyper-v emulated drivers. More importantly, how does it work in reverse?
     
    cereberus, Aug 7, 2016
    #9
  10. lx07 Win User
    What matters is whether the vhd is formatted mbr or gpt.

    It works just the same as if you clean install windows or if you pull a real disk out of one PC and stick in another. When it boots the first time it says "Getting devices Ready"... With Hyper-V all the drivers already exist in the Windows image so you don't need to load any. If you do it the other way around (make a Hyper-V VM and then native boot it) you'll need to load your drivers for display, networking and what not.

    Are they mixed up? No, not really. If you boot both ways the drivers for your real hardware and for the virtual hardware are both installed. When you boot Windows it starts the drivers based on the hardware ID (something like PCI\VEN_blablabla) so it starts only the drivers for the hardware that it finds. This will be either real hardware (native boot) or virtual (Hyper-V). The other drivers are installed but not used so you lose a (small) amount of disk space but that is all. The "Getting devices ready" message only happens the once.

    Hope that makes sense..
     
  11. cereberus Win User
    Re. vhd - I use gpt as uefi for sure.

    RE, drivers - that makes sense. Thinking about it that is sort of how wintousb works when you move a bootable usb drive to another PC (works fine for 8/10 but less so for 7 as its default drivers are getting quite long in the tooth now).

    I wonder if it would be so slick in vmware or virtualbox?
     
    cereberus, Aug 7, 2016
    #11
  12. lx07 Win User
    I migrated a Windows 8 install from virtualbox to hyper-v and it worked fine simply by attaching the vhd to a new hyper-v vm. I had to re-activate it obviously. Not sure if you use Linux at all but Hyper-V drivers have been built into the kernel for the last few years also so it is similarly easy to move from virtual to actual hardware.

    Don't know about going the other way (i.e to VBox or VMware). I bet it would work - maybe I'll try it out when I have a bit of time.
     
  13. cereberus Win User

    Fun trying to convert an existing install to a vhd!

    Cheers.
     
    cereberus, Aug 7, 2016
    #13
  14. Kari Win User
    I have no issues in mounting a Hyper-V virtual machine's VHD file and then using bcdboot X:\Windows add it to boot menu, regardless what type of disk my host and the added VHD have.

    It works perfectly well with BIOS / MBR formatted disk on host and UEFI / GPT on native boot VHD, and with UEFI / GPT formatted host and BIOS / MBR formatted native boot VHD.

    Extract from the beginning of my tutorial Hyper-V - Native Boot VHD - Windows 10 Forums:


    Fun trying to convert an existing install to a vhd! [​IMG]
    Note Notice that you can use the method told in this tutorial on both BIOS (MBR) and UEFI (GPT) systems, mounting both MBR partitioned Generation 1 VHD files and GPT partitioned Generation 2 VHD files regardless if the host is MBR or GPT partitioned.

    A VHD from Generation 2 UEFI vm can boot natively on a BIOS (MBR) host, and a VHD from Generation 1 BIOS vm boots without an issue on UEFI (GPT) host.

    This method can be used to natively boot VHD files from Hyper-V virtual machines running Windows 8.1, Windows 10, Windows Server 2012 R2 or Windows Server 2016.
    The method used in tutorial is BCDBOOT.
     
  15. Kari Win User
    @cereberus, about your issues: the Disk2VHD tutorial, it's Part Three shows you what to do if you used Disk2VHD to create a VHD of a GPT partitioned system. Unfortunately Disk2VHD does not include all UEFI partitions in VHD, therefore a free third party tool is needed after you have created the VHD to convert it to MBR. The conversion process is easy and fast. It can then be mounted and added to boot menu with a simple bcdboot X:\Windows command.

    See Part Three in this tutorial: Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD - Windows 10 Forums

    I have never had issues in native boot adding a VHD made from GPT disk with Disk2VHD which is converted to MBR before adding it.
     
Thema:

Fun trying to convert an existing install to a vhd!

Loading...
  1. Fun trying to convert an existing install to a vhd! - Similar Threads - Fun trying convert

  2. Convert an existing Windows 10 Installation from Legacy BIOS to UEFI

    in Windows 10 Gaming
    Convert an existing Windows 10 Installation from Legacy BIOS to UEFI: Convert an existing Windows 10 Installation from Legacy BIOS to UEFI without using 3rd party software. https://answers.microsoft.com/en-us/windows/forum/all/convert-an-existing-windows-10-installation-from/d58e3a80-2d7b-46d5-af56-1fc7958ac53c
  3. Convert an existing Windows 10 Installation from Legacy BIOS to UEFI

    in Windows 10 Software and Apps
    Convert an existing Windows 10 Installation from Legacy BIOS to UEFI: Convert an existing Windows 10 Installation from Legacy BIOS to UEFI without using 3rd party software. https://answers.microsoft.com/en-us/windows/forum/all/convert-an-existing-windows-10-installation-from/d58e3a80-2d7b-46d5-af56-1fc7958ac53c
  4. convert a VMDK into a VHD ?

    in Windows 10 Customization
    convert a VMDK into a VHD ?: Is there any manual way to convert a VMDK to a VHD ?I have tried all the tools Starwind, Winimage, disk2vhd etc they all generate a VHD file but when I create a ne Virtual Computer & attach the disk none works.I get repeated errors "The virtual machine "New Virtual Machine"...
  5. Can't convert a VHDX with Convert-VHD in PowerShell or in Hyper-V Manager

    in Windows 10 Installation and Upgrade
    Can't convert a VHDX with Convert-VHD in PowerShell or in Hyper-V Manager: I have a VHDX file that is an image of the system drive in a new laptop, created with Diskpart version 10.0.19041.1: create vdisk file="D:\PC_Original.vhdx" type=expandable source="\\.\physicaldrive0" If this is successful it was, I should be able to store and work with...
  6. Hi there! I wan't to ask how to convert a .vhd to a .wim i tried gimagex but it says that...

    in Windows 10 Ask Insider
    Hi there! I wan't to ask how to convert a .vhd to a .wim i tried gimagex but it says that...: [ATTACH] submitted by /u/shuffelplay5 [link] [comments] https://www.reddit.com/r/Windows10/comments/g4sno6/hi_there_i_want_to_ask_how_to_convert_a_vhd_to_a/
  7. How to convert VHD to VHDX using Hyper-V Manager

    in Windows 10 News
    How to convert VHD to VHDX using Hyper-V Manager: [ATTACH]If you have a VHD file and you want to convert it to VHDX format, you can use Hyper-V Manager to get it done. This […] This post How to convert VHD to VHDX using Hyper-V Manager is from TheWindowsClub.com. read more...
  8. How to convert Hyper-V VHDX file to VHD using PowerShell

    in Windows 10 News
    How to convert Hyper-V VHDX file to VHD using PowerShell: [ATTACH] [ATTACH]If you have a VHDX file and you want to make it compatible with some other virtual machine that supports VHD format, then this post shows, how you can convert the Hyper-V VHDX file to VHD using Windows PowerShell so [...] This post How to convert Hyper-V...
  9. VHD

    in Windows 10 Drivers and Hardware
    VHD: just a small question. can i delete a vhd after i hv mounted it permanently? https://answers.microsoft.com/en-us/windows/forum/all/vhd/deab598a-d7fe-4c5c-ace2-91003242d580
  10. Convert Physical Disk to Windows to Go by VHD, Boot Error

    in Windows 10 Virtualization
    Convert Physical Disk to Windows to Go by VHD, Boot Error: Hey guys, I'm stuck in this dilemma and I would appreciate any help that would come. I'm sorry, I though that maybe since my problem is about Virtual Hard Disks then maybe this is the right section... Correct me if I'm wrong *Smile So here's the thing, 1. I have Windows...