Files
esx-to-promox-migratie/readme.md
2025-11-12 14:32:16 +01:00

4.3 KiB
Raw Permalink Blame History

Migrating a Windows Server 2025 VM from VMware ESXi to Proxmox VE

This guide describes the most reliable and direct way to migrate a Windows Server 2025 virtual machine from VMware ESXi to Proxmox VE, using virt-v2v.
It also covers driver preparation and alternative manual import steps.


🧭 Overview

Method How it works Pros Cons
virt-v2v (recommended) Converts directly from ESXi to Proxmox Keeps partitions, converts drivers Requires CLI
VMDK import Export disk → qm importdisk Simple Manual driver fix
Veeam restore Restore backup Handy for existing policy Often fails to boot

Prerequisites

  • Both ESXi and Proxmox VE hosts reachable on the same network.
  • Proxmox host has sufficient storage and CPU.
  • Administrative credentials for ESXi (usually root).
  • virtio-win.iso downloaded and stored in /var/lib/vz/template/iso/.

🔧 1. Prepare Windows VM on ESXi

Before migrating, pre-install VirtIO drivers inside the Windows VM to ensure it boots in Proxmox.

Run this PowerShell script inside the VM (as Administrator):

Set-ExecutionPolicy Bypass -Scope Process -Force
irm https://git.voskuil.cloud/marco/scripts/raw/branch/main/Prep-VirtIODrivers.ps1 | iex

This mounts the VirtIO ISO, injects vioscsi, viostor, NetKVM, and Balloon drivers, and makes them available in the Windows driver store.


🧱 2. Install tools on the Proxmox host

apt update
apt install virt-v2v libguestfs-tools -y

🚀 3. Run the conversion

Replace the example values with your own host and VM names.

export LIBGUESTFS_BACKEND=direct

virt-v2v   -ic esx://root@esx01.gpeu.local/?no_verify=1   -o local   -os /var/lib/vz/images/9001   "WIN2025-SRV"
  • esx01.gpeu.local → your ESXi host
  • WIN2025-SRV → your VM name on ESXi
  • 9001 → the VMID you plan to use in Proxmox

This converts the VMs disks and configuration to a Proxmox-compatible format.


🖥️ 4. Create and attach the VM in Proxmox

qm create 9001 --name WIN2025-SRV --memory 8192 --cores 4 --scsihw virtio-scsi-pci
qm importdisk 9001 /var/lib/vz/images/9001/*.qcow2 local-lvm
qm set 9001 --scsi0 local-lvm:vm-9001-disk-0 --boot order=scsi0
qm set 9001 --net0 virtio,bridge=vmbr0
qm set 9001 --ide2 local:iso/virtio-win.iso,media=cdrom

🪄 5. Boot and finalize in Proxmox

  1. Start the VM.

    • If the PowerShell prep script was used → Windows should boot normally.
    • If not → boot once from the Windows ISO, open a repair prompt, and inject the drivers manually:
    dism /image:C:\ /add-driver /driver:D:\viostor\w11\amd64 /forceunsigned
    dism /image:C:\ /add-driver /driver:D:\NetKVM\w11\amd64 /forceunsigned
    
  2. Once booted, run:

    D:\virtio-win-guest-tools.exe
    

    (installs QEMU Guest Agent, Balloon, network, and display drivers)


⚙️ Optional: VMDK import (manual method)

If you prefer manual import:

scp /vmfs/volumes/datastore1/WIN2025-SRV/*.vmdk root@pve01:/var/lib/vz/images/9001/
qm importdisk 9001 /var/lib/vz/images/9001/WS2025.vmdk local-lvm
qm set 9001 --scsi0 local-lvm:vm-9001-disk-0 --boot order=scsi0

Then attach the VirtIO ISO and repeat the driver installation steps inside Windows.


💡 Tips

  • Always set your Proxmox disk controller to VirtIO-SCSI.
  • For best performance use VirtIO (paravirtualized) NIC.
  • Once migrated, snapshot and back up from Proxmox before deleting the ESXi copy.
  • You can repeat the same process for Linux VMs — no VirtIO ISO needed.

Example network bridge config (for VLANs)

If your 10-GbE trunk carries all VLANs and you need VLAN-specific bridges:

auto ens1f0
iface ens1f0 inet manual

auto ens1f0.120
iface ens1f0.120 inet manual
    vlan-raw-device ens1f0

auto vmbr120
iface vmbr120 inet manual
    bridge-ports ens1f0.120
    bridge-stp off
    bridge-fd 0

VMs connected to vmbr120 will automatically be placed in VLAN 120.


🏁 Result

After these steps:

  • Your Windows Server 2025 VM boots on Proxmox without BSOD.
  • Disk and network use VirtIO drivers.
  • QEMU Guest Agent works (clean shutdowns, IP reporting).
  • Migration from ESXi to Proxmox completed with full functionality.