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: Remove the secondary vDisk from your VM (Windows guests only)
- If your VM is running, go ahead and shut it down.
- In the VMs tab, click the VM icon and select Edit from the context menu.
- To remove
vdisk2.img
, click the red minus symbol next to it. - 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).