VM conversion and migration
When consolidating hardware, preserving legacy systems, or testing upgrades in a virtual environment, you may need to convert a physical disk or migrate an existing system into a virtual machine on Unraid. This process applies to both Linux and Windows systems, enabling you to run your installation as a VM within your Unraid server.
- Your Unraid server should meet the minimum hardware requirements for virtualization (see table below).
- The source disk must be connected to your Unraid server (via SATA, USB, or as an unassigned device).
- Ensure you have enough free space in your array or cache pool to accommodate the new virtual disk image.
- Backup any critical data before starting the conversion or migration process.
Hardware requirements
Component | Minimum requirement | Recommended for best performance |
---|---|---|
CPU | 64-bit with hardware virtualization (Intel VT-X/AMD-V) | Multi-core CPU with VT-d/AMD-Vi for passthrough |
RAM | 8 GB | 16 GB or more |
Storage | SSD or NVMe cache pool with sufficient space | Dedicated NVMe cache pool for VM storage |
Motherboard/BIOS | UEFI with virtualization enabled | UEFI with IOMMU/VT-d/AMD-Vi enabled |
Convert a physical disk to a VM
Migrating an existing Linux or Windows system into a virtual machine on your Unraid server can be a great way to save hardware space, keep legacy systems running, or test new upgrades safely.
To convert a physical disk to a VM:
- Linux
- Windows
Step 1: Prepare the physical disk
- Connect the source disk to your Unraid server (using SATA or USB).
- Log in to the WebGUI (
http://tower
orhttp://tower.local
). - Click on the Main tab.
- Start the array if it isn’t already running.
- Find your disk under Unassigned Devices.
- Take note of the device letter (e.g.,
sdb
,sdc
) and disk size. You’ll need at least this free space on your array or cache pool for the new virtual disk.
Step 2: Create a new virtual machine
Refer to the Creating your own virtual machines guide, with the following exceptions:
- Set the BIOS to OVMF. Make sure to specify the VirtIO Drivers ISO for optimal performance.
- Store VM images on a cache pool instead of an array for the best performance.
Step 3: Convert the physical disk to a virtual disk image
Open a terminal (SSH or local console) and log in as root
.
Use the following command to convert the physical disk into a virtual disk image:
qemu-img convert -p -O raw /dev/sdX /mnt/user/[vdisk_share]/[vmname]/vdisk1.img
- /dev/sdX: Replace with the device letter from step 1 (e.g.,
/dev/sdb
) - [vdisk_share]: The share where you save your VM images
- [vmname]: The name you want for your VM
Command breakdown:
qemu-img convert
: This tool is used for disk image conversion.-p
: Shows progress as a percentage.-O raw
: Sets the output format to raw (Unraid's default)./dev/sdX
: Source is your physical disk./mnt/user/[vdisk_share]/[vmname]/vdisk1.img
: Destination for the virtual disk image.
Wait for the operation to complete. The resulting .img
file will be the primary disk for your VM.
Step 1: Edit the XML for your virtual machine
-
In the VMs tab, click the VM icon and select Edit XML from the context menu.
-
Next, scroll down the XML and find the
<target>
tag for the<disk>
that has a<source>
file set tovdisk1.img
. It should look like this:
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='writeback'/>
<source file='/mnt/cache/vdisk_share/vmname/vdisk1.img'/>
<backingStore/>
<target dev='hda' bus='virtio'/>
<boot order='1'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk> -
To modify it, change the bus attribute in the
<target>
tag fromvirtio
toide
. -
Then, remove the entire
<address>
line for that<disk>
. -
Your updated XML should look like this:
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='writeback'/>
<source file='/mnt/cache/vdisk_share/vmname/vdisk1.img'/>
<backingStore/>
<target dev='hda' bus='ide'/>
<boot order='1'/>
</disk> -
Finally, click Update to save your changes to the virtual machine's XML.
Step 2: Install the VirtIO drivers from inside the VM (Windows guests only)
- Open Windows File Explorer and go to the VirtIO virtual CD-ROM to explore its contents.
- Navigate to the Balloon folder.
- Inside that folder, find the subfolder for your Windows OS version (for example,
w8.1
). - Go to the amd64 subfolder.
- Right-click on the balloon.inf file and select Install from the context menu. (You need to enable file extension visibility to do this.)
- Repeat these steps for each of the following folders:
- NetKVM
- vioserial
- viostor
- After you've installed the drivers, navigate back into the virtual CD-ROM and open the guest-agent folder.
- Double-click on qemu-ga-x64.msi to install the QEMU/KVM guest agent.
Step 3: Convert the disk bus back to VirtIO
- If your VM is running, go ahead and shut it down.
- In the VMs tab, click the VM icon and select Edit XML from the context menu.
- Locate the
<disk>
section forvdisk1.img
and changebus='ide'
back tobus='virtio'
in the<target>
tag. - Click Update to save your changes to the VM.
- Now you can start your converted virtual machine!
Migrating a physical disk to a VM
You can run a Windows installation directly from a physical disk in an Unraid virtual machine (VM). This method helps migrate an existing Windows system without converting it to a virtual disk image. For a visual walkthrough, check out Spaceinvader One’s tutorial:
How to pass through hard drives, convert disks, and test performance in Unraid VMs (YouTube).
There are two common ways to migrate a Windows installation to a VM in Unraid:
Physical disk passthrough: This uses the original disk directly in the VM.
- Pros: Fastest method, no image conversion required.
- Cons: Takes up a SATA port; Unraid cannot use the disk for other purposes when it's attached to the VM.
Disk image conversion: This converts the physical disk to a virtual disk image (.img
) for use in the VM.
- Pros: More flexibility, allows the disk to be used as an Unraid share or for snapshots.
- Cons: Requires time and free space for the conversion process.
Choose passthrough if you want a simple migration or plan to dual-boot the disk. Opt for image conversion for better portability and backup options.
- Back up your Windows installation before starting.
- Have a spare USB flash drive ready for recovery tools.
- Select a hardware preparation tool that enables Windows to boot on virtualized hardware by modifying drivers and the hardware abstraction layer (HAL):
- Microsoft Sysprep (free and built into Windows 8.1 and later)
- Acronis True Image 2025 (commercial solution with advanced migration capabilities)
- Ensure your Unraid server has a free SATA or NVMe port for the physical disk.
Step 1: Prepare the Windows disk for migration
Moving a Windows installation to new hardware, whether physical or virtual, can result in boot failures due to hardware differences. Follow one of the methods below to prepare your Windows system:
Option A: Microsoft sysprep (recommended - free)
Sysprep is built into Windows and eliminates unique system information, preparing Windows for different hardware.
- Temporarily disable any antivirus software.
- Clean up unnecessary user profiles and temporary files.
- Fix or remove any problematic Microsoft Store apps that may block sysprep from running.
-
Run sysprep:
-
Open Command Prompt as an administrator.
-
Navigate to the sysprep directory:
cd C:\Windows\System32\Sysprep
-
Execute sysprep with generalization:
sysprep.exe /generalize /shutdown /oobe
-
The system will generalize the installation and then shut down.
-
-
Install the disk in your Unraid server after the shutdown.
Option B: Acronis True Image 2025 (commercial)
Acronis True Image 2025 features Universal Restore, which assists with hardware migration.
- Download and install Acronis True Image 2025.
- Create bootable recovery media using the included tools:
- Choose the Windows-like interface.
- Select the architecture that matches your Windows (32-bit or 64-bit).
- Boot your Windows system from the Acronis recovery media.
- Follow the on-screen instructions to apply Universal Restore to your Windows disk. This will update drivers and the HAL for better compatibility with virtualized hardware.
- Shut down the system and install the disk in your Unraid server.
Step 2: Identify the physical disk in Unraid
- Log in to the WebGUI (
http://tower
orhttp://tower.local
). - Go to the Main tab.
- Start the array if it’s not already running.
- Locate your disk under Unassigned Devices.
- Note the device letter (for example,
sdb
,sdc
) for use in the VM configuration.
Step 3: Create a new virtual machine
- Go to the VMs tab in the WebGUI. If the tab is missing, ensure that virtualization is enabled and that hardware requirements are met.
- Click Add VM.
- Follow the Creating your own virtual machines guide, using these settings:
- Set BIOS to SeaBIOS (try OVMF if SeaBIOS fails to boot).
- Leave OS Install ISO blank.
- Specify the VirtIO Drivers ISO for optimal performance after boot.
- For the primary virtual disk, select any location and size (this will be replaced in the next step).
- Uncheck Start VM after creation.
Step 4: Edit the XML for your virtual machine
You'll need to modify the VM's XML configuration to connect your physical disk to the virtual machine.
-
From the VMs tab, click the VM icon, then select Edit XML from the context menu.
-
Scroll down in the XML and find the existing
<disk>
entry for your primary virtual disk. This usually points to a.img
file and will look something like this:
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='writeback'/>
<source file='/mnt/cache/vdisk_share/vmname/vdisk1.img'/>
<backingStore/>
<target dev='hda' bus='virtio'/>
<boot order='1'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>Replace this block with the following, where
sdX
is the device letter or, better yet, use/dev/disk/by-id/[your-disk-id]
for a more reliable device assignment (refer to the [Unraid Docs: Using a physical disk in a VM]):
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='writeback'/>
<source dev='/dev/disk/by-id/[your-disk-id]'/>
<target dev='hdd' bus='sata'/>
</disk>If your disk is IDE, change the bus from "SATA" to "IDE".
Using
/dev/disk/by-id/
is preferred over/dev/sdX
to ensure the disk assignment stays consistent after reboots or hardware changes. -
Click Update to save your XML changes.
Step 5: Install drivers
- Start your VM.
- Once in Windows, open Device Manager by right-clicking the Start menu and selecting Device Manager.
- Look for devices marked with a yellow exclamation mark (indicating missing drivers). Right-click on each and select Update driver.
- Choose Browse my computer for drivers.
- Direct it to the drive where the VirtIO Drivers ISO is mounted (usually D: or E:).
- Make sure Include subfolders is checked, then click Next.
- Repeat this process for each device with missing drivers, commonly including: SCSI Controller, Ethernet, Balloon, and Serial devices.
Remember to reinstall those applications after migration if you use software that installs its own drivers (such as antivirus programs).
If you are stuck at SeaBIOS with a "Booting from Hard Disk" message, it’s likely because your Windows OS was installed using UEFI instead of the traditional BIOS. In this case, recreate the VM using OVMF as the BIOS type rather than SeaBIOS. Most modern Windows installations (Windows 8.1, 10, and 11) support UEFI and may need OVMF to boot successfully. The rest of the conversion process will remain the same.
Xen to KVM migration
Unraid supported Xen from early 6.x versions until it was deprecated in 6.2 (September 2016) and later removed entirely. This migration guide is relevant for users upgrading from very old Unraid installations (pre-2017) to modern versions.
A Xen hypervisor is a virtualization platform that allows multiple operating systems to run on the same hardware. In Unraid, Xen was historically used for virtual machines, but KVM is now the standard. Migrating from Xen to KVM is essential for utilizing modern Unraid features, enabling hardware passthrough, and ensuring compatibility with current releases.
The process of migrating a VM from Xen to KVM varies depending on whether your VM is set up as a paravirtualized (PV) or hardware-virtualized (HVM) guest. This guide focuses specifically on converting Windows VMs that utilize Xen’s GPLPV drivers, as they require special handling.
Always create a backup of your Xen virtual disk before starting this process. And test your migration on the backup to prevent data loss.
Windows conversion procedure
To convert a Windows VM from Xen to KVM, follow these steps. Remember to remove any PCI device passthrough from your Xen domain configuration before you begin. These devices can be added back after the migration is complete.
Step 1: Determine if your VM uses Xen's GPLPV drivers - Click to expand/collapse
- Inside your Xen VM, open Windows Device Manager (press Windows key + X, then select Device Manager).
- Expand Network adapters and check the device name.
- If the name contains "Xen," you are using GPLPV drivers.
- If it doesn't, skip to the step about rebooting into KVM mode.
If you are not using GPLPV drivers, you can skip the next several steps and continue from the rebooting into KVM mode section.
Step 2: Prepare Windows for GPLPV driver removal - Click to expand/collapse
- Open a command prompt as Administrator (Start menu → type
cmd
→ right-click Command Prompt → select Run as administrator). - Enter the following command:
bcdedit -set loadoptions nogplpv
- Reboot your VM.
Step 3: Uninstall GPLPV drivers - Click to expand/collapse
After the reboot, purge all Xen GPLPV drivers from your system using the comprehensive manual removal process documented in the Xen Project Wiki.
GPLPV removal requires extensive registry editing and manual file deletion. Follow the Xen Project Wiki instructions exactly as written, as errors can cause system instability or boot failures.
Step 4: Create a new KVM virtual machine - Click to expand/collapse
-
Ensure the VM manager is enabled:
- Go to Settings → VM manager.
- Set Enable VMs to Yes.
- Download the latest VirtIO drivers ISO for Windows by selecting it from the dropdown menu and clicking Download.
-
Navigate to the VMs tab and click Add VM.
-
Select the Windows version that matches your original Xen virtual machine.
-
Configure the basic settings:
- Name: Assign a descriptive name to your VM.
- VirtIO drivers ISO: Choose the version you just downloaded.
-
Under Primary vDisk Location:
- Browse and select your existing Xen virtual disk.
-
Add a temporary secondary vDisk:
- Click the green plus sign.
- Set the size to 1M (this will enforce IDE bus compatibility during the initial boot).
- Choose any temporary directory for the location (this will be removed later).
-
Leave the other settings for graphics and sound at their default values, then click Create.
-
Immediately force-stop the VM:
- Click the VM icon and choose Force stop.
-
Edit the VM configuration:
- Click the VM icon and select Edit.
- Switch to XML view using the toggle in the top-right corner.
-
Modify the primary disk XML:
- Locate the
<disk>
section for your primary virtual disk. - Remove the entire
<address>
line. - Change
bus='virtio'
tobus='ide'
in the<target>
tag. - Click Update.
- Locate the
Step 5: Install VirtIO drivers - Click to expand/collapse
- Start the VM from the VMs tab.
- Connect via VNC by clicking the VM icon and select Start with console (VNC).
- During boot:
- Windows will detect new hardware but might fail to install drivers.
- Choose Reboot later when prompted.
- Open Device Manager (press Win+X and choose Device Manager):
- Install drivers for each device listed under Other devices (like Ethernet Controller, PCI Device, etc.):
- Right-click the device and select Update driver.
- Choose Browse my computer for drivers.
- Point to the VirtIO ISO drive (for example,
D:\
). - Check Include subfolders.
- If prompted, accept Always trust Red Hat.
- Install drivers for each device listed under Other devices (like Ethernet Controller, PCI Device, etc.):
- Install the QEMU guest agent:
- Open File Explorer and navigate to
D:\guest-agent\
. - Double-click
qemu-ga-x64.msi
.
- Open File Explorer and navigate to
- Shut down the VM.
Step 6: Finalize the VM configuration - Click to expand/collapse
- Edit the VM:
- Update the VM:
- Click Update to save your changes.
- Start the VM normally.
- Verify in Device Manager that:
- (Optional) Enable VirtIO for better performance:
- Edit the VM and switch to XML view.
- Change the primary disk's
bus
fromide
tovirtio
. - Click Update and reboot the VM.
If you notice errors on devices after migration:
- Reinstall the VirtIO drivers from the ISO.
- Check for Windows updates, which may provide newer drivers.
- Visit the Red Hat VirtIO Drivers page for the latest versions.