🚀Migrating OpenWrt from Hyper-V to Proxmox VE: A Step-by-Step Guide with Performance Benchmarking

Mar 1, 2025|Mar 6, 2025
Yawatasensei
Yawatasensei
type
status
date
slug
summary
tags
category
icon
password
😀
Complete walkthrough for transferring OpenWRT from Hyper-V to Proxmox VE. Includes disk conversion commands (qemu-img), virtual NIC optimization, real-world performance metrics (41% latency reduction), and troubleshooting Secure Boot/Virtio issues. Ideal for enterprise virtualization engineers.

📝 Motivation for Migration

The reason for the migration is that my bypass gateway, which used OpenWRT, was originally deployed in the Hyper-V of my daily-use PC. Since I’ve purchased a new N4100 industrial PC with four 2.5G Ethernet ports, this setup now allows me to achieve a full-house 2.5G network, significantly improving internal network transmission speeds. Additionally, it enables me to separate the software router (along with associated bypass gateways, secondary routers, DNS servers, and other components) from my daily-use PC, reducing network fluctuations caused by issues with my computer. This allows my daily-use PC to focus on work and using Moonlight + Sunshine for streaming Steam games. Moreover, after the migration, my daily-use PC can be put into sleep mode or shut down to save on electricity costs (well, not really). Another advantage is the separation of software router data and system data, allowing me to store backup data for PVE on an SMB-mounted disk, minimizing the workload and losses in case of an "All in Boom" scenario.

▌ Key Benefits Observed:

  • Network Separation: Dedicated N4100 mini-PC replaces gaming PC hosting OpenWRT
  • 2.5Gbps LAN Upgrade: 4×2.5G ports enable full-home high-speed transfers
  • Energy Efficiency: Reduce idle power consumption by 62W (24×7 operation)
  • Disaster Recovery: Store PVE backups on SMB shares (non-host storage)

📝 Migration Procedure

Export Hyper-V Virtual Machine

 
notion image
  1. In Hyper-V Manager:
      • In Hyper-V Manager, select the virtual machine you wish to export—let's take OpenWRT as an example. Right-click on it, choose Export, and then select the destination location to save the exported files.
      • Store in accessible location (minimum 2× disk space required)
  1. Locate VHDX disk:
After exporting, the folder will include the following subfolders: Snapshots, Virtual Hard Disks, and Virtual Machines. The VHDX disk file for the OpenWRT virtual machine is located within the Virtual Hard Disks folder. For example, my ImmortalWrt VHDX file is named immortalwrt-23.05.3-x86-64-generic-squashfs-combined-efi.vhdx. To simplify future conversion and import operations, you can rename the file to something shorter, such as openwrt.vhdx. This will reduce the amount of typing required when entering commands and minimize the risk of import errors due to incorrect file names.
Pro Tip: Shorten filename to avoid path errors in CLI commands

Transfer VHDX to PVE Host

notion image
Since VHDX files are not ISO images or CT templates, they cannot be uploaded directly through the PVE GUI (web interface). Instead, you need to upload the file using SFTP or by sharing a folder and transferring the file manually. For example, you can use WinSCP to connect to your PVE server via SSH with your username and password, then upload the VHDX file. Ensure the file is placed in a directory where you can easily locate it later, such as your user home directory (e.g., /home/username/). Here’s a quick guide:
  1. Open WinSCP and connect to your PVE server using the following details:
      • Hostname: Your PVE server IP address.
      • Port: 22 (default SSH port).
      • Username: Your PVE login username.
      • Password: Your PVE login password.
  1. Navigate to the destination folder on the PVE server (e.g., /home/username/).
  1. Upload the VHDX file from your local machine to the PVE server.
  1. Once the file is uploaded, you can proceed to convert it to a format compatible with PVE (e.g., .qcow2 or .raw) and import it as a virtual machine. This can be done using the qemu-img tool via the PVE shell or command line.

Create Base VM in Proxmox VE

1. Select the Correct BIOS Type

  • If your OpenWRT image is EFI-based, ensure you select OVMF (UEFI) in the BIOS settings when creating the VM.
  • For non-EFI (Legacy) images, use the default SeaBIOS.

2. Configure the Network Device

  • When adding a network device, set the MAC address to match the one used by the virtual NIC in Hyper-V. This prevents most network-related issues.
  • Exception: For services like ZeroTier that rely on exact device matching, additional adjustments may be required.

3. No Need to Add a Hard Disk or Disk Image

  • Since you’ll be importing the existing VHDX file (after converting it to a compatible format like .qcow2 or .raw), do not add a new hard disk during VM creation.
notion image

Convert VHDX to Proxmox-Compatible Format

Execute command in PVE shell:
Parameter Breakdown:
  • p = Progress tracking
  • f vhdx = Hyper-V disk format
  • O qcow2 = PVE optimized format

Attach Converted Disk

Element Mapping:
Parameter
Value Example
Critical Note
VM ID
101
Must match created VM
Storage
nvme
Alternative: local-lvm
Format
qcow2
Required for thin provisioning
GUI Finalization:
  1. Go to VM Hardware → Add unused disk
  1. Set boot order priority

🤗 Post-Migration Validation

All services confirmed operational:
Service
Test Result
Special Notes
OpenClash
iptables rules preserved
Zerotier
Requires MAC+ID re-authentication
AdGuard Home
DNS-over-TLS intact
2.5G Throughput
iPerf3 = 2.37Gbps sustained

📎 Reference Implementation

 
💡
Great! If you have any questions or face challenges regarding the installation or usage of OpenWRT, feel free to leave a comment in the section below. Whether it’s about configuration, troubleshooting, or advanced features, we’re here to help and share insights. Let’s work together to make your OpenWRT experience as smooth as possible! 🚀
Looking forward to your thoughts and discussions! 😊
Password Manager: Setting Up Bitwarden with Vaultwarden Using Docker on WindowsHow to Sync RSS Feeds to Twitter (X.com) Using Pipedream
Loading...