Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert VMs from VMware/Parallels to UTM #4927

Closed
KhaineBOT opened this issue Jan 10, 2023 · 14 comments
Closed

Convert VMs from VMware/Parallels to UTM #4927

KhaineBOT opened this issue Jan 10, 2023 · 14 comments
Labels
enhancement New feature or request

Comments

@KhaineBOT
Copy link

It would be great if there was a tool or process to convert existing VMs from VMware/Parallels format to UTM format. This would help users migrate from these tools to UTM.

@KhaineBOT KhaineBOT added the enhancement New feature or request label Jan 10, 2023
@osy
Copy link
Contributor

osy commented Jan 10, 2023

Duplicate of #3050

@osy osy marked this as a duplicate of #3050 Jan 10, 2023
@osy osy closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2023
@startergo
Copy link
Contributor

startergo commented Jul 10, 2023

To convert Windows 7 hard drive from Parallels to qcow2 format follow these procedures:

  1. Uninstall parallels tools from the machine and shut down the machine.
  2. Extract the .hds file to a working folder. The .hds file is located in:
/Users/<user name>/Parallels/Windows 7.pvm/Windows 7-0.hdd/Windows 7-0.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds
  1. Issue this command to convert the parallels hard drive to raw image. Be careful the raw image size may be 5 times bigger than parallels hdd:
qemu-img convert -f parallels /Users/<user name>/Parallels/Windows 7.pvm/Windows 7-0.hdd/Windows 7-0.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds -O raw image.raw
  1. Convert the raw file to qcow2 image:
qemu-img convert -f raw -O qcow2 image.raw  Windows7.qcow2

  1. Create a new UTM machine and select the .qcow2 drive as a machine drive. Be careful when setting up the machine. Parallels creates a legacy Windows 7 installation so uncheck UEFI boot in the new UTM machine.
  2. After booting install the qemu guest drivers. For Windows 7 I used this drivers version

@macuserguru
Copy link

What does the command look like on a Mac when I want to convert from VMWare Fusion to UTM/QEMU.
Fusion stores everything in a VMBundle container and splits the virtual hard disk.
I want to convert the FreeBSD VM from VMWare Fusion to UTM
UTM and QEMU (via homebrew) are installed on the M1 MacMini.

@startergo
Copy link
Contributor

startergo commented Sep 1, 2023

What does the command look like on a Mac when I want to convert from VMWare Fusion to UTM/QEMU.

That may give you partial answer:
https://annvix.com/blog/converting-a-vmware-fusion-virtual-machine-to-kvm

@fransh47
Copy link

fransh47 commented Oct 11, 2023

Windows 7 will not start. Want the repair option and then halts on "Windows is loading files". Any clue?
Basic question: will W7 32-bit run?

@ozanyarman
Copy link

Migrating Guest OS: Intel (x86-64) Macbook Pro 17" late-2008 running Parallels Desktop Windows XP VM to Macbook Pro 14" M1 Max (ARM architecture) running UTM (QEMU frontend) VM:

On your intel-based Macbook Pro, prepare your original VM (make a backup first just in case):

Uninstall Parallels Tools from under Windows and restart your VM (do not reinstall these tools upon restart when prompted!) ... Also remove any shared folders and network links. You can choose to re-activate Windows if asked at this stage on account of "significant hardware changes" (we will do it again as the last step). Do not forget to SHUT DOWN the VM.

Then go to the Terminal and type:

prl_disk_tool convert --hdd <disk_name> --plain

CREATES RAW IMAGE (Disk name is where your .hdd file resides; it is an OS X package under the Parallels VM folder whose contents can be viewed by selecting "Show Package Content" in Finder). This process can take some time... wait patiently.

Once the HDD file is converted, it has replaced the original file. But it still is an OS X package! Descending into this new package, either via command line "cd" or using the Finder "Show Package Content", your precious data file is finally revealed. It has the file extension HDS. Bear yet in mind that the original file name now has a "copy" suffix to it to indicate that it has changed.

Next, move this HDS file to the Silicon chip bearing (ARM-based) Macbook Pro M1 Max. Put it on your desktop or elsewhere that is accessible.

Then, install MacPorts on your new Macbook Pro as described here:

https://www.macports.org/install.php

For full functionality of MacPorts, optionally download and install the whole Xcode and x11.

Now install QEMU using MacPorts by typing the following command in the Terminal:

sudo port install qemu

After QEMU installation is finished, locate your HDS file (which is a RAW image) and type:

qemu-img convert -f raw -O qcow2 [image].hds WindowsXP.qcow2

Your username folder now contains a newly created qcow2 hardisk image that you will load under UTM, which is a great frontend for QEMU. (Optionally, you can move the qcow2 file anywhere you want.)

Go to https://mac.getutm.app/ and download UTM. Also go to the Gallery section and download the ready-made Windows XP profile. Additionally get SPICE GUEST TOOLS from:

https://github.com/utmapp/qemu/releases/download/v7.0.0-utm/spice-guest-tools-0.164.4.iso

Install and set up UTM. You will be using UTM's emulator feature, not the virtualization feature. The ready-made Windows XP profile is sufficient for this.

Before running it, edit your VM profile and prepare the IDE drives. Delete the default hardisk and select the WindowsXP.qcow2 image file as the main boot drive. Also, load Hiren's Boot CD to your CD ROM drive as an ISO after downloading it from:

https://www.hirensbootcd.org/old-versions/

You WILL require an external USB keyboard. Get one or you will be stuck for what comes next.

After loading Hiren's Boot CD ISO to the CD ROM drive of the edited VM profile, drag this IDE drive to the top so that it has boot priority.

Now start the VM. Immediately press and hold the option key on your external USB keyboard. Do not release it! Or the keyboard capture will be lost! (If you fail, you will be stuck at Hiren's boot menu...)

A second or so later, try to press and hold the down arrow immediately followed by ENTER (do NOT press them at once). You may not succeed at first. Restart the VM if that is the case. Try this a couple of times until you get it right and can select and launch the Mini Windows XP from the boot menu of Hiren's Boot CD.

When Mini Windows XP loads, make sure your external keyboard is hooked in by the VM window's USB capture button.

Now, capture your mouse and install new hardware from the desktop shortcut so that the mini OS can recognize your external keyboard.

From the Hiren menu icon in the system tray, go to Registry -> "Fix hard disk controller (fix_hdc.cmd)".

Press the T key, then enter and type in your Target Root folder. The default would be C:\Windows but might be different on multiboot systems, in which case you would need to check in Windows Explorer what the correct drive letter is.

Hit the M key on your external keyboard to select Update Mass Storage drivers and press enter.

Then Press any key to continue

Shut down Mini Windows XP and edit the VM again so that Hiren's ISO is out of the CD ROM slot. Also drag the hardisk IDE to the top so that it has boot priority. Remove the external keyboard if you wish, for you do not need it anymore.

Run the VM again. The OS will launch. You will not be successful to immediately activate Windows XP just yet due to the internet connection not being fully set up!

When Windows XP has done starting up, capture your mouse and install all the new found hardware one by one.

Finally, load the SPICE GUEST TOOLS iso to the CD ROM slot and install the program.

Restart and activate Windows license.

Done and Solved!

@DougJoseph
Copy link

Migrating Guest OS: Intel (x86-64) Macbook Pro 17" late-2008 running Parallels Desktop Windows XP VM to Macbook Pro 14" M1 Max (ARM architecture) running UTM (QEMU frontend) VM:

On your intel-based Macbook Pro, prepare your original VM (make a backup first just in case):

...

Done and Solved!

Thanks for the helpful post! I no longer need to do this, but someone else may well benefit from your knowledge shared here.

@Johnne25
Copy link

Your instructions were great.
However, I am stuck on the Hiren's Boot CD ISO step.
I tried many time, and keep bring brought to the Shell command.
Is anything I can try to get it to boot correctly from the ISO?

@Johnne25
Copy link

Booting from the HBCD_PE_x64_v108.iso
seemed to work, but from there I don't know where to go.

@ozanyarman
Copy link

You need an EXTERNAL USB keyboard to continue as I said:

You WILL require an external USB keyboard. Get one or you will be stuck for what comes next.

After loading Hiren's Boot CD ISO to the CD ROM drive of the edited VM profile, drag this IDE drive to the top so that it has boot priority.

Now start the VM. Immediately press and hold the option key on your external USB keyboard. Do not release it! Or the keyboard capture will be lost! (If you fail, you will be stuck at Hiren's boot menu...)

A second or so later, try to press and hold the down arrow immediately followed by ENTER (do NOT press them at once). You may not succeed at first. Restart the VM if that is the case. Try this a couple of times until you get it right and can select and launch the Mini Windows XP from the boot menu of Hiren's Boot CD.

When Mini Windows XP loads, make sure your external keyboard is hooked in by the VM window's USB capture button.

Now, capture your mouse and install new hardware from the desktop shortcut so that the mini OS can recognize your external keyboard.

From the Hiren menu icon in the system tray, go to Registry -> "Fix hard disk controller (fix_hdc.cmd)".

Press the T key, then enter and type in your Target Root folder. The default would be C:\Windows but might be different on multiboot systems, in which case you would need to check in Windows Explorer what the correct drive letter is.

Hit the M key on your external keyboard to select Update Mass Storage drivers and press enter.

Then Press any key to continue

Shut down Mini Windows XP and edit the VM again so that Hiren's ISO is out of the CD ROM slot. Also drag the hardisk IDE to the top so that it has boot priority. Remove the external keyboard if you wish, for you do not need it anymore.

@tsingher
Copy link

Your instructions are great, until I get to the "sudo port install qemu" command. It returns the following error message:

"Cannot install qemu for the arch 'arm64' because
its dependency glib2 is only installed for the arch 'x86_64'
and the configured universal_archs 'x86_64 i386' are not sufficient.
Unable to execute port qemu: architecture mismatch"

I've re-install Macports, and that doesn't seem to help.

Suggestions? I already have UTM on my computer, and have a clean copy of Windows XP fully installed, so it seems to work on the architecture...

@ozanyarman
Copy link

Your instructions are great, until I get to the "sudo port install qemu" command. It returns the following error message:

"Cannot install qemu for the arch 'arm64' because its dependency glib2 is only installed for the arch 'x86_64' and the configured universal_archs 'x86_64 i386' are not sufficient. Unable to execute port qemu: architecture mismatch"

I've re-install Macports, and that doesn't seem to help.

Suggestions? I already have UTM on my computer, and have a clean copy of Windows XP fully installed, so it seems to work on the architecture...

I think you have installed the wrong qemu version through macports. You should check the correct version for your specific architecture, unintall the problematic qemu with all its dependencies, reinstall the correct version, and try again.

@tsingher
Copy link

I'm afraid you're now beyond my competency. I'm on an M3 macbook pro. I'm not sure how to find the existing qemu on my computer to check its version. I've downloaded the latest qemu version (8.2.4), but I'm not sure how to get Macports to find it.

As I say, UTM is working (and I believe it relies on qemu...?)

I do appreciate your help...

@ozanyarman
Copy link

https://superuser.com/questions/367434/how-do-you-remove-macports-and-all-the-packages-it-has-installed

Then do a fresh install of macports and type:

sudo port install qemu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants