How to recover a system image of a physical PC to a VM

Discussion in 'sandboxing & virtualization' started by Bellzemos, Nov 15, 2024.

  1. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    Hi! I use Macrium Reflect to backup system images and VMWare Workstation Player to play around. I tried to recover my system image to a VM but was never able to pull it off.

    I tried by booting into a Reflect PE ISO in VM and recovering a system image, but after a reboot, the revovered OS (Windows 10) wasn't found by VM. Then I read I should add another virtual hard disk for my USB and had the image on the USB, but that didn't work either. How can this be done?
     
  2. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    Is it even possible to do this? Am I doing it wrong? Anyone? :)
     
  3. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    Yes, it is possible. You have two options.

    1- Use Macrium viboot and convert an existing backup image to .vmdk file, and then create a new VM using Vmware Workstation with that .vmdk selected as the hard disk.

    2- Restore a Macrium image inside VM, but you will need to use Macrium Redeploy, as the new hardware is different. Only then you will be able to boot into that image through Vmware.
     
  4. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    Thank you for the reply.

    I'd like to go the 2nd route. I've tried this and added another virtual hard disk as usb where my image is, while booting VM from Reflect PE ISO. It succeeded, but the it was as if the destination disk in VM was gone and it didn't boot into anything. Windows 10 can should handle dissimilar hardware I think, but the image was created off the same computer anyway, I'm running VM on the same computer. I was able to restore GPT Win10 to a 14 years old laptop, converting to MBR and all, and Windows ran fine on it - did it with a free version of Reflect, using only this:
    https://knowledgebase.macrium.com/display/KNOW/Fixing Windows boot problems#FixingWindowsbootproblems-FixbootproblemsonMBR/BIOSsystems

    But there must be something I'm doing wrong in the VM so that I my restored Windows "disappears"...
     
  5. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    I just did a quick test of the 2nd option using Macrium PE. I was able to restore my Windows 11 image inside a Vmware Workstation VM also running Windows 11.

    During the restore process, I only selected the Windows C: partition from the source and copied it to the Windows C: partition of the VM. In the "Advanced options" on Macrium's restore window, I selected "do not replace" the "Master boot record". After the restore was completed, I used Macrium's "Fix Windows boot problems" option. It was able to find a Windows installation and create a boot path. On reboot Windows 11 detected new hardware and installed drivers. After another reboot I was able to successfully boot into the image.

    So the 2nd option works fine without Macrium Redeploy.
     
  6. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    I see, interesting. So I should install Windows 10 anew in VM, then do what you wrote, replacing the old C drive with my C drive from the system image and it should work... I will try that. Thank you!

    EDIT: Do you maybe know if I can select in the VM, before initially installing Windows 10 anew, if I want the virtual HDD formatted as MBR or GPT? Does VM support UEFI/GPT and Legacy/MBR booting?
     
    Last edited: Nov 17, 2024
  7. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    You do not need to install Windows 10 or any other OS. I already had a Windows 11 VM so I used it for testing. The target OS will get overwritten by the restored image in any case.

    My Windows 11 VM is UEFI/GPT based and so was the imaged system. You just need to make sure that you setup your VM to match the setup of your existing system whose image you are restoring, this will avoid needless hassles. Or you can also follow this article from Macrium in case you are restoring a MBR image to a GPT disk.
     
  8. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    If I understand correctly, I can set if the virtual disk in VM will be MBR or GPR during the installation of Windows (or rather before, by Shift+F10 and then entering diskpart and setting the disk the way I want it to, then installing OS).

    And I think I have to install Windows 10 in order to be able to then only restore the C partition from the image over the C partiton created druing the new Windows installation (leaveing other new partitions as they are). Did I get it wrong?

    Thank you for helping me.
     
  9. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    When you setup your VM in Workstation choose "custom(advanced)" option and then during the steps choose "firmware type" as "BIOS". The VM when created will be MBR based. If a VM is already created but without an OS, you can still change the firmware from UEFI to BIOS from "edit virtual machine settings" then "options" and then "advanced". Windows installation will not change the disk type, and Windows will install on this MBR based disk.

    You do not need to install Windows inside the VM. When your VM without an OS is created, just boot into Macrium PE, make sure that the image you want to restore is accessible and then restore the image to the new drive of the VM and then use Macrium's fix boot option settings to make it bootable. The steps that I mentioned earlier only need to be performed if you already have a functioning VM and want to restore your image over it.
     
  10. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    I already tried what you wrote in the 2nd paragraph but failed. Windows wouldn't boot after image recovery, it was as if there was nothing on the VM disk, as if it wasn't found.

    Noted what you wrote in the 1st paragraph. I should try it all again when I have some more time. Thank you.
     
  11. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    Made it. Problem was, I still had VMWare Player 15.5 - I uninstalled it and installed Workstation Pro (free for personal use) 17.6.1 and now I have all the options and it worked without a problem. Thank you.
     
  12. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    I am glad it worked for you :thumb:
     
  13. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    Hi, I'm back... Last time I tried with some small image and it worked. Now I'm trying to restore my own PC's system image in VM on that same PC (on the same disk drive).

    This is how I went about it: I created a VM for Windows 10 x64, assinged a little more than just enough space (350 GB virtual drive for the system image containing 320 GB) - because I'm running out of space on my single physical internal drive, but it should be enough anyway?
    Then I selected Macrium Reflect PE ISO as "optical disc" in VMware, to install/boot the VM from and connected an external physical disk with the full system image of my computer (main image + differential image), then set it so that the external drive connects to the guest OS in VM, so I have access to it in PE.
    Then I started the restore of the differential system image file from the physical external disk - restoring it to the virtual disk (located on my internal physical disk) - but I got this error:
    upload_2024-12-10_20-46-45.png

    Why is the restore failing - and how to fix it?
     
  14. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    PS: I've tried to solve this and it seems as if the external drive is somehow getting disconnected when the image restore is about to start. Windows plays the "removed USB" sound and if I try to see drives and folders in PE, the external drive is not found anymore. But if was found before I initiated system restore and picked the image file! VM still shows as if it was connected to guest (after I clicked on the refresh button in Macrium PE, it's completely gone though). Why is this happening and how can I find a way around it? Is there another way to reach the image files for restore? I don't have enough free space on my internal drive to copy them there.

    PPS: The external drive got somehow disconnected so that it wasn't visible in guest, not in host OS. Had to do a reboot to see it again.

    PPPS: I've added another (virtual) disk with access to my physical external disk and now restore is running, I'm at 6%, maybe this is it...? I'll write later if I succeeded as I'll have to go out and about right after this finishes - if it will finish.
     
    Last edited: Dec 10, 2024
  15. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    It seems to me that you have resolved the issue. I have always created a second virtual disk and copied my image to it before restoring it to the first virtual disk inside my VM.

    Adding a physical disk to a VM is always an option, just make sure you are following all the steps in this article to prepare the disk before attaching it to a Vmware Workstation VM.
     
  16. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    Hi Raza0007, yes, it worked and now I have my system image restored inside a VM. By the way, can this cause any issues, the same Windows system running inside the same Windows system? I selected NAT for networking and it seems fine.

    I was only able to make the restore work by adding physical disk to VM. I haven't seen that article before and I hope I didn't corrupt my data. But the data are the image files on that drive and the restore worked. I think my image files should be OK?

    I wish there was a better, read-only way to do this, but I tried with shared folders and with connecting USB drive to guest, both without success. I guess I'll have to buy another internal NVMe drive. Not sure if I should upgrade from 1TB to 2TB or just add another 1TB...

    Thank you for all the help, much appreciated!
     
  17. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    I do not believe there will be any issues with restoring your system image inside a VM. A VM is isolated from the Host system, and acts as a different physical PC. You can have anything running inside your VM, the Host system will not care or even be aware of it.

    Data corruption will only occur if both the Host and Guest OS try to access the disk at the same time. Since your disk only had images, so you are most likely safe, as the only time the Host OS will access them is when Macrium is writing to or updating the images.

    If you want to expand your disk space and have room for a second drive, I will recommend buying a second drive instead of just upgrading the capacity of the original. It is always better and safer to have multiple drives, instead of one drive with multiple partitions.
     
  18. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    Is there an other, safer way, that I don't know, to make it safe when restoring big system image file(s) to a VM? Or is the best/only way to buy another NVMe drive and create a virtual disk on it, copy the big system image files on it and then use that virtual disk to restore from to VM?

    I don't use Macrium to write to the images in OS, I only use PE for imaging and restoring, so I think my image files should be fine, this time.

    I have two M.2 ports for NVMe drives on my ASUS Prime Z270-A motherboard, so I guess I'll buy another 1TB one. It won't be any safer since I will only have OS on one drive and use the second drive for VMs etc., but I do backups anyway. And 1TB drive is cheaper than 2TB.

    Again, thank you.
     
  19. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    If you just need to restore an image inside a VM, then the best option will be to connect a USB based Portable External Hard Drive to the VM. You can also buy a USB based Portable SSD, it will give you very fast restore speed. You should buy a new internal NVMe SSD only if you want to expand your overall system storage.
     
    Last edited: Dec 11, 2024
  20. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    A couple of posts above I wrote that when I tried connecting my external USB NVMe drive to my PC and then connecting it to guest in order to recover system image from it, it was disconnecting and I was unable to do it.

    And you wrote, a couple of posts above: "I have always created a second virtual disk and copied my image to it before restoring it to the first virtual disk inside my VM." - So this is how I'm thinking of doing it. I'll copy the image file(s) to a virtual disk on my internal NVMe drive and use the virtual disk to restore the VM. That should work, right?

    I don't want to corrupt my files with the way I did it this time and I do need more internal space for VMs anyway. Because I'm alwas imaging my whole drive and I'll get a new drive for VMs, so I don't image the VMs... Am I thinking right? And thank you.
     
  21. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,847
    Location:
    USA
    I am sorry I must have missed the fact that you were trying to restore using a external USB drive. In that case please check if "VMware USB Arbitration Service" is set to automatic start and is running before you start Workstation. If issues persist, then in Vmware Workstation "Preferences -> USB" choose the option "connect the device to foreground virtual machine". This way whenever you attach a USB device to Vmware, it will only be connected to the VM, and the Host machine will not be aware of it. So there is no danger of any data corruption.

    I personally have always used a second virtual disk inside a VM, but my OS image is only about 32 GB in size. So this is the fastest method for me and I don't have to worry about connecting USB drives. If your images are significantly larger, then an external USB is the best option. But of course the decision is yours, and both ways should work without issues.
     
  22. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    Yes, the service is set to auto and is running. I will try the USB setting you mentioned, to make it connect only to the guest OS (VM). Not sure if it will fix the disconnecting problem, but it's worth a try. Thank you for all your help!
     
  23. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    Hello again,

    I tried restoring again, from external drive to VM, and did the "Preferences -> USB" & "connect the device to foreground virtual machine", but that didn't help - the USB connected external NVMe drive still got disconnected.

    So I used the "physical disk as virtual disk" option again and it worked. Is this really problematic as in that I can corrupt my files (Reflect images)? The drive is visible in host Windows OS, but I'm not doint anything on it at that time. At the same time it's used as a "physical virtual disk" for my guest (VM) while I'm doing a restore from the Reflect image on it to the VM.

    This is the only way it works. Connecting the external drive via USB to guest always fails when I start the restore, I don't know why. So am I doing it wrong and can possibly corrupt my external drive's data (the images)? Or am I safe?

    Thank you.
     
  24. Raza0007

    Raza0007 Registered Member

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

    After reading this article again, I believe it will be OK. The risk of data corruption is present if the drive is mounted by the Host and being used simultaneously as a virtual drive. "Mounted" in this case most likely means locked and in use. Windows only locks system drives like C:\ or drives where Windows files are installed. So as long as the drive is a data only drive, and does not contain Windows files, it should be OK.

    Please keep in mind that I have personally never done this. I have always either used a second virtual drive inside the VM, or an external usb drive. The article does mention in point 3 to backup your data before connecting an internal physical drive as a virtual drive to a VM.
     
    Last edited: Dec 30, 2024
  25. Bellzemos

    Bellzemos Registered Member

    Joined:
    Jan 25, 2009
    Posts:
    246
    I too think I should be fine. Thank you for the reply and for all your help, very much appreciated. I wish you all the best in 2025!
     
  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.