Migrating a Windows VM from Azure to OCI is straightforward if you follow the official supported path using VHD export, conversion to QCOW2, and importing as a custom image. This guide is based on real-world tested steps (as of November 2025) and focuses on a paravirtualized Windows instance launch (recommended for best performance).
Tested on: Windows Server 2016/2019/2022 VMs with data disks up to 1 TB
Goal: Fully working Windows VM in OCI with all original disks preserved
Step 1: Prepare the Target Environment in OCI
1. Create a New Compartment
Go to Identity & Security > Compartments → Create Compartment
Name it something meaningful (e.g., Azure-Migration)
2. Create a VCN and Public Subnet
Networking → Virtual Cloud Networks → Create VCN
- Add a public subnet (enable "Public" and assign a route table with Internet Gateway)
3. (Optional) Pre-create the final VM shape
You'll launch the real instance later from the imported image. For now, just note your desired shape (e.g., VM.Standard.E4.Flex, 4 OCPU, 64 GB RAM).
4. Create an Object Storage Bucket for Image Import
Storage → Buckets → Create Bucket
Name: image-import-bucket (or any name you prefer)
Step 2: Prepare the Azure Windows VM
1. Download and Install Oracle VirtIO Drivers
Inside the running Azure VM:
- Download: https://docs.oracle.com/en-us/iaas/Content/Compute/References/windowsvirtiodrivers.htm
- Run the installer → Reboot
2. (Optional but Recommended) Run Sysprep
If you want to generalize the image:
C:\Windows\System32\Sysprep\sysprep.exe /oobe /generalize /shutdown
3. Stop the VM in Azure Portal (deallocated state)
4. Create a Full Snapshot of the OS Disk
VM → Disks → OS Disk → Create Snapshot → Choose Full snapshot type
5. Export the Snapshot
Snapshot → Export → Generate URL (valid for 1 hour by default, but you can set longer)
Example URL (do not use this one – generate your own):
text
https://md-...blob.storage.azure.net/.../abcd?sv=...&sig=...
Step 3: Download the VHD from Azure
You can do this from any machine (Windows or Linux) with internet access.
Option A – Windows (using AzCopy)
# Download AzCopy
Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -OutFile azcopy.zip
Expand-Archive azcopy.zip -DestinationPath "C:\azcopy"
cd C:\azcopy\azcopy*
# Copy VHD to local drive (example: H:\Images)
.\azcopy copy "https://your-generated-snapshot-url-here" "H:\Images\VM99.vhd"
Option B – Linux
wget -O azcopy.tar.gz https://aka.ms/downloadazcopy-v10-linux
tar -xf azcopy.tar.gz
sudo cp azcopy_linux_amd64_*/azcopy /usr/local/bin/
azcopy copy "https://your-generated-snapshot-url-here" "/mnt/data/Images/VM99.vhd"
Step 4: Convert VHD to QCOW2
Install QEMU (if not already present).
Windows
# Using QEMU installed in default location
"C:\Program Files\qemu\qemu-img.exe" convert -f vpc -O qcow2 "H:\Images\VM99.vhd" "H:\Images\VM99.qcow2"
Linux
qemu-img convert -f vpc -O qcow2 /mnt/data/Images/VM99.vhd /mnt/data/Converted/VM99.qcow2
Step 5: Upload QCOW2 to OCI Object Storage
Install and configure OCI CLI on your local machine:
https://docs.oracle.com/en-us/iaas/Content/API/Concepts/cliconcepts.htm
# Windows or Linux
oci os object put --bucket-name image-import-bucket --file "H:\Images\VM99.qcow2"
Step 6: Import Custom Image in OCI
-
Go to Compute → Custom Images → Import Image
-
Choose:
- Compartment
- Bucket and Object Name (VM99.qcow2)
- Image Type: QCOW2
- Launch Mode: Paravirtualized (best performance)
- Boot Type: BIOS (recommended for Windows)
Import takes 30–90 minutes depending on size.
Step 7: Fix Boot Mode (UEFI vs BIOS)
By default, OCI may set the image to UEFI. Windows VMs exported from Azure are usually BIOS.
- After import completes → Custom Image → Actions → Edit Image Capabilities
- Change Guest Boot Mode from
UEFI_64toLEGACY_BIOS - Save
Step 8: Launch the Instance
Compute → Instances → Create Instance
- Image: Your newly imported custom image
- Shape: Your desired shape
- VCN & Subnet: The ones created earlier
- Add your SSH key or Windows password
First boot behavior:
You may see a black screen for 5–10 minutes or the instance may appear stuck. This is normal for the first boot of imported Windows images.
If it doesn't come up:
- Reboot the instance once or twice (this often resolves it)
- Use OCI Serial Console or Simple Console Connection: https://blogs.oracle.com/cloud-infrastructure/post/simple-console-connections-for-windows-administrators
Once Windows boots, install the OCI VirtIO drivers again if needed (usually already present).
Final Notes
- Data disks: Repeat the snapshot → export → convert → upload → attach as block volume process (or use Azure Disk Export if available).
- Networking: Assign public IP or set up VNIC as needed.
- Licensing: Bring your own Windows license or use OCI's licensed images if applicable.
You now have a fully migrated Windows VM running natively in Oracle Cloud Infrastructure with optimal paravirtualized performance!
Happy migrating! 🚀