DE | EN

Introduction

This guide will show you a method you can use to migrate a computer to a virtual machine.

In most cases you need a storage to save your disk data to.

This can be an external USB disk, or an SMB share on an external NAS box.

Method: Clonezilla

This method uses the software Clonezilla to save your disk to an external storage.

Information table

Free Needs account Windows Linux License GUI
Yes No Yes Yes GPL No / CUI

Prepare USB with Rufus

First you download the software Rufus, which you can use to put ISO files on your USB sticks.

Download: https://rufus.ie/en/

Flash on USB stick

Open Rufus, select your USB disk and the Clonezilla ISO file.

Change the Partition scheme to GPT for recent and newer generation computers, or MBR for older computers.

You can determine the correct partition type by observing the BIOS, if it has EFI, or UEFI in it, you will have to change the type to GPT.

Hit start, confirm additional prompts and wait for it to finish.

Rufus

Qemu Guest Agent & VirtIO

Here's a wiki entry by Proxmox: https://pve.proxmox.com/wiki/Qemu-guest-agent

That page links to https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers

And that page finally links to: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/?C=M;O=D, which is where you can obtain the ISO file.

Here's some handy links from that page:

Once you have the ISO-file, move it to your computer and open it.

Then we run/install following as Administrator:

  • virtio-win-gt-x64.msi
  • virtio-win-guest-tools.exe
Install Guest Agent

After you've installed the drivers and agent, shutdown your computer.

Boot from USB stick

Make sure you either have an SMB share ready with credentials, or an external USB disk.

Also make sure you have enough disk space left to store the computer.

Info: The following shows you the steps to store it on an external disk.

Attach the USB stick to the computer that you want to virtualize, power it off, and boot from the USB stick.

The key you have to press is different for each device manufacturer, however you should find this information in the mainboard manual or online.

Once you have booted successfully, you'll be prompted with a screen like in the next step.

Saving a computer in Clonezilla

Press enter to boot:

Clonezilla

Choose your language, for this run we will keep en_US.UTF-8:

Clonezilla

Change the keyboard language if you have a different layout. This is important when you enter the password for SMB.

Clonezilla

Press enter:

Clonezilla

Choose device-image:

Clonezilla

Here you choose how you want to save the computer:

local_dev if you want to store it to an external disk, samba_server if you want to store it to an SMB share.

Clonezilla

If you haven't connected the external USB drive, do it now and wait 5 seconds before pressing enter:

Clonezilla

If you see your disk, in this case it's the 4001GB WD Elements, then press CTRL+C:

Clonezilla

Select your external disk as the Clonezilla /home/partimag repository.

Clonezilla

Choose no-fsck:

Clonezilla

If you have created a directory earlier, you can pick that one, for this run we will just pick the drives root, once selected hit Done:

Clonezilla

If everything looks good, press enter again:

Clonezilla

Select Beginner:

Clonezilla

Select savedisk:

Clonezilla

Name it something you will recognize:

Clonezilla

Choose the disks you want to save:

Clonezilla

Keep the default option and press enter:

Clonezilla

Press enter again:

Clonezilla

Select No, however if you have the time you can perform a check.

Clonezilla

We don't need to encrypt, you can encrypt it if you need to:

Clonezilla

We choose poweroff, as we're basically done once it's saved:

Clonezilla

Press enter to continue:

Clonezilla

Press y to continue:

Clonezilla

This can take some time, so sit back or grab a coffee ☕:

Clonezilla

Once it's done, you have to press enter and the PC will be turned off. You can remove the USB stick and attach the USB disk to your Proxmox Servers USB port.

Restoring to a Proxmox VE VM

Upload the Clonezilla ISO to your Proxmox VE storage.

On the top right click Create VM.

Choose a fitting name, in this case SRV2022, then click Next.

Clonezilla VM

Select the Clonezilla ISO and select the correct Guest OS:

Clonezilla VM

Change the BIOS to SeaBIOS, as there's a bug that prevents Clonezilla to boot on OVMF.

Check Qemu Agent, select the TPM storage, and continue:

Clonezilla VM

Recreate the disk, keep it as IDE.

Clonezilla VM

Also add a new drive with the size of 1 GB, and change the type to SCSI.

This is because Windows can't boot from a device it hasn't seen before. We'll adjust this later.

Click Next.

Clonezilla VM

Choose the resources for the VM:

Click Next.

Clonezilla VM

Here as well:

Click Next.

Clonezilla VM

You can set the Model to VirtIO:

Clonezilla VM

Check the configuration, and click Finish.

Within Hardware of the VM, click Add and click USB Device.

Clonezilla VM

Choose the external disk and click Add.

Clonezilla VM

Start the VM and navigate the same as before until you're at this screen:

Clonezilla VM

When you see your folder containing the backup, use tab to navigate to Done and press enter.

Press enter again:

Clonezilla VM

Press Beginner.

Clonezilla VM

Then press on restoredisk.

Clonezilla VM

Choose the image file:

Clonezilla VM

Then select the correct disk by size:

Clonezilla VM

Choose -k0 and hit OK.

Clonezilla VM

Skip the check:

Clonezilla VM

Choose poweroff:

Clonezilla VM

Press enter again:

Clonezilla VM

Press enter again:

Clonezilla VM

Press y twice to begin the restore:

Clonezilla VM

This will take a while, you might be prompted for an enter when it's done, then it will shutdown.

Wait for this to finish.

Clonezilla VM

Head back to the VM Options and make sure the boot order looks like this.

Enable ide0 and move it to the top:

Clonezilla VM

Also remove the USB Device from your VMs Hardware.

Within your VMs Hardware also change the BIOS to OVMF, and add an EFI disk. Change the Machine to i440fx as well.

Then power on your VM, when you're at your desktop, shutdown your VM again.

Clonezilla VM Desktop

Within your VMs Hardware, detach, then remove the 1 GB sized hard disk.

Clonezilla VM
Clonezilla VM

Also detach your disk-0 and, and attach it again as SCSI.

Clonezilla VM

Once configured click Add.

Clonezilla VM

Head back to Options and change the boot order back:

Clonezilla VM

Start your VM, configure the IP address and observe if everything works.

🎉 Congratulations, you have migrated a physical computer to a Proxmox VE VM.