惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
GbyAI
GbyAI
B
Blog RSS Feed
S
SegmentFault 最新的问题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
小众软件
小众软件
The Last Watchdog
The Last Watchdog
W
WeLiveSecurity
Webroot Blog
Webroot Blog
S
Security @ Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
Microsoft Security Blog
Microsoft Security Blog
月光博客
月光博客
博客园 - 聂微东
F
Fortinet All Blogs
H
Hacker News: Front Page
A
About on SuperTechFans
Application and Cybersecurity Blog
Application and Cybersecurity Blog
C
Check Point Blog
V
V2EX
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
N
News | PayPal Newsroom
Cisco Talos Blog
Cisco Talos Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Cloudflare Blog
P
Privacy & Cybersecurity Law Blog
N
Netflix TechBlog - Medium
C
CXSECURITY Database RSS Feed - CXSecurity.com
Recorded Future
Recorded Future
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
大猫的无限游戏
大猫的无限游戏
美团技术团队
Security Latest
Security Latest
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
Recent Announcements
Recent Announcements
The GitHub Blog
The GitHub Blog
Google Online Security Blog
Google Online Security Blog
T
The Exploit Database - CXSecurity.com

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
🐧 VMware to KVM migration guide — common pitfalls and how to avoid them
Python-T Poi · 2026-04-29 · via DEV Community

A junior on my team asked me last week, “How do I move a VM from VMware to KVM without losing data or breaking the network?” It’s a solid question — not because the tools are missing, but because the failure points are subtle: disk format quirks, firmware mismatches, and driver assumptions baked into the guest OS.

Yes, you can migrate a VM from VMware to KVM cleanly. But success depends on understanding what happens during disk conversion, how bootloaders resolve root devices across hypervisors, and why paravirtualized drivers matter even when the underlying hardware is abstracted.

This vmware to kvm migration guide covers the mechanics, not just the commands. You’ll see exactly how qemu-img handles VMDK variants, why virtio breaks first boot on unprepared guests, and how to repair initramfs when the kernel panics on boot. One migration once left me stuck for two hours because /dev/sda became /dev/vda — and the fix wasn’t obvious until I checked the initramfs modules.

Let’s walk through it step by step.

vmware to kvm migration guide

💾 Disk Conversion — The Core of Migration

The most critical step in any vmware to kvm migration is converting the disk: transforming VMware’s .vmdk into KVM’s preferred .qcow2.

The underlying mechanism is handled by qemu-img, which uses QEMU’s block layer to parse the source format, read each allocated block, and write it into a new image using a copy-on-write metadata structure. This allows .qcow2 to support snapshots, compression, and sparse allocation — features absent in raw images.

qemu-img convert -f vmdk -O qcow2 /path/to/vm-disk.vmdk /path/to/vm-disk.qcow2

Enter fullscreen mode Exit fullscreen mode

The -f vmdk flag explicitly tells qemu-img to interpret the input as a VMware disk; -O qcow2 sets the output format. Without these, autodetection can fail, especially on stream-optimized or split disks.

Not all .vmdk files are the same. If the disk is split into 2GB segments (e.g., disk-000001.vmdk, disk-000002.vmdk), you must point qemu-img to the descriptor file — typically the first file in the sequence, often named disk.vmdk — not the -flat extents.

# For split disks, use the descriptor
qemu-img convert -f vmdk -O qcow2 disk.vmdk vm-disk.qcow2

Enter fullscreen mode Exit fullscreen mode

Verify the output:

qemu-img info vm-disk.qcow2

Enter fullscreen mode Exit fullscreen mode

Expected output:

image: vm-disk.qcow2
file format: qcow2
virtual size: 40 GiB (42949672960 bytes)
disk size: 8.2 GiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false

Enter fullscreen mode Exit fullscreen mode

If virtual size matches the original and disk size is significantly smaller (indicating sparse efficiency), the conversion succeeded.

“Migration isn’t about copying bits — it’s about preserving context.”

🛠️ Handling Corrupted or Inaccessible Disks

Some .vmdk files, particularly those exported via OVF, use stream-optimized format. These often fail to open:

qemu-img: Could not open 'bad-disk.vmdk': Invalid argument

Enter fullscreen mode Exit fullscreen mode

To fix, re-serialize the disk into a flat format before conversion:

# First, de-serialize it
qemu-img convert -O vmdk stream-optimized.vmdk temp-flat.vmdk
# Then convert to qcow2
qemu-img convert -f vmdk -O qcow2 temp-flat.vmdk final.qcow2

Enter fullscreen mode Exit fullscreen mode

This strips the stream optimization, making it parseable by qemu-img.

🧠 Why qcow2 Over raw?

You could use raw, but .qcow2 is better for production. While raw is a direct byte stream, .qcow2 adds:

  • Snapshots (via internal L1/L2 metadata tables)
  • Compression (optional, zlib-based)
  • Encryption (supported in qcow2 v3)
  • Sparse allocation (only allocates space for written clusters)

For example, a 40G virtual disk with 8G used will consume ~8.2G on disk as .qcow2, but always 40G as raw. The overhead of metadata is negligible; the flexibility is not.

I'd default to .qcow2 unless you're passing the disk directly to LVM or require deterministic I/O latency.


⚙️ VM Configuration — Matching Hardware Layers

A VM is more than a disk. It includes emulated CPU, memory layout, firmware, and device models. VMware and KVM differ here — mismatching them causes boot or driver failures.

VMware typically uses BIOS firmware , IDE/SATA controllers , and e1000/vmxnet3 NICs. KVM defaults to UEFI , virtio-blk , and virtio-net — faster, but not universally supported in older guests.

If the guest OS lacks virtio drivers, it won’t detect the disk or network — leading to boot hangs or kernel panics.

Start with a VM definition that matches the original hardware closely. Use virt-install or define a domain via virsh define. Example XML:

<domain type='kvm'>
  <name>my-migrated-vm</name>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc-q35-6.2'>hvm</type>
    <boot dev='hd'/>
  </os>
  <devices>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/vm-disk.qcow2'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <interface type='network'>
      <source network='default'/>
      <model type='virtio'/>
    </interface>
  </devices>
</domain>

Enter fullscreen mode Exit fullscreen mode

Note `` — this enables paravirtualized networking, which reduces CPU overhead by ~30% compared to emulated NICs.

But if the guest was running on VMware with e1000, it likely doesn't have virtio-net drivers. Boot will fail silently.

🔧 Fallback: Use Emulated NICs for First Boot

To ensure bootability, switch to an emulated NIC model:

<interface type='network'>
  <source network='default'/>
  <model type='e1000'/> <!-- or 'rtl8139' -->
</interface>

Enter fullscreen mode Exit fullscreen mode

e1000 is widely supported in Linux and Windows. After boot, install virtio-net drivers and switch back.

💾 Disk Bus: IDE vs. virtio

Same principle applies to storage. If the OS lacks virtio-blk (common in Windows Server 2008 or minimal CentOS installs), change the bus:

<target dev='hda' bus='ide'/>

Enter fullscreen mode Exit fullscreen mode

Boot the VM, install the virtio drivers (e.g., from the Fedora virtio ISO), then reconfigure for virtio to gain ~40% better disk throughput.


🧩 Boot Issues — Fixing the Unbootable VM

You've converted the disk and defined the VM. It powers on — but hangs or panics.

This is where most migrations fail. The most common cause is initramfs not loading virtio modules , or GRUB referencing the wrong root device.

Attach to the console:

virsh console my-migrated-vm

Enter fullscreen mode Exit fullscreen mode

If you see:

[    0.000000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Enter fullscreen mode Exit fullscreen mode

The kernel can’t find the root partition.

Why? The initramfs was built for VMware’s SCSI driver (sd* devices), but KVM presents the disk as virtio-blk (vd*). The root device path in GRUB still says /dev/sda1, but the actual block device is /dev/vda1.

🛠️ Chroot Rescue with a Live ISO

Mount a rescue ISO:

virsh attach-disk my-migrated-vm /path/to/ubuntu-rescue.iso sdb --type cdrom

Enter fullscreen mode Exit fullscreen mode

Reboot, enter BIOS, and boot from CD.

Mount the root filesystem:

mount /dev/vda1 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt

Enter fullscreen mode Exit fullscreen mode

Rebuild initramfs with virtio support:

# On Debian/Ubuntu
update-initramfs -u

# On RHEL/CentOS
dracut --force

Enter fullscreen mode Exit fullscreen mode

Check /etc/default/grub:

GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8 root=/dev/vda1"

Enter fullscreen mode Exit fullscreen mode

Ensure root= points to the correct virtio device (vda, vdb, etc.).

Update GRUB configuration:

update-grub  # Debian
grub2-mkconfig -o /boot/grub2/grub.cfg  # RHEL

Enter fullscreen mode Exit fullscreen mode

Exit, reboot, and detach the ISO.

🧠 Why This Happens: Device Layer Abstraction

Linux uses major and minor device numbers to map block devices. VMware’s virtual SCSI controller uses major 8 (sda, sdb), while virtio-blk uses major 252 (vda, vdb). If the initramfs doesn’t include virtio_pci and virtio_blk modules, the device isn’t available at boot — so the kernel can’t mount the root filesystem.

This isn’t a KVM bug. It’s a consequence of how Linux abstracts hardware — and how initramfs is built for a specific driver set.


🤝 Final Network Handoff — Ensuring Connectivity

The VM boots, but has no network.

Check interface status:

ip link show

Enter fullscreen mode Exit fullscreen mode

If eth0 exists but has no IP, investigate:

  • Is dhclient running?
  • Is the firewall blocking DHCP?
  • Did the MAC address change?

It did. VMware used one MAC, KVM generated a new one. Some systems (especially RHEL derivatives) bind network configuration to MAC addresses in files like /etc/sysconfig/network-scripts/ifcfg-eth0.

Fix: edit or regenerate the config. Remove or update the HWADDR or MACADDR line.

Better: switch to predictable interface names (e.g., enp1s0) or use netplan with DHCP on Ubuntu 18+.

To avoid issues, pin the MAC in the VM XML:

<interface type='network'>
  <mac address='52:54:00:12:34:56'/>
  <source network='default'/>
  <model type='virtio'/>
</interface>

Enter fullscreen mode Exit fullscreen mode

This ensures consistency across reboots.

And if the original VM used a static IP, make sure it doesn’t conflict with existing leases.


🟩 Final Thoughts

Migrating a VM from VMware to KVM isn't just a format conversion. It's a shift in virtual hardware assumptions — from emulated devices to paravirtualized ones, from BIOS to UEFI, from SCSI semantics to virtio.

Each step — qemu-img convert, update-initramfs, virsh console — exposes dependencies we usually ignore: how initramfs resolves devices, how GRUB passes kernel parameters, how drivers map to block and network interfaces.

When the migration fails, it’s rarely the tooling. It’s the missing context.

But when it works, you’re not just running the same workload on new infrastructure. You’ve validated your understanding of the stack — from disk format internals to kernel boot flow.

This vmware to kvm migration guide isn’t about avoiding failure. It’s about knowing exactly where and why it happens — so you can fix it before the monitoring alert fires.

❓ Frequently Asked Questions

Can I migrate Windows VMs the same way?

Yes, but Windows needs virtio drivers installed beforehand or via rescue mode. Use the Fedora virtio ISO to attach drivers during setup.

Do I lose performance moving from VMware to KVM?

No — KVM is often faster for Linux workloads due to tighter kernel integration. Use virtio for disk and network, and enable KSM and transparent huge pages for memory efficiency.

Is live migration possible?

Not directly from VMware to KVM. You must power down the VMware VM, convert the disk, and boot on KVM. Use this during maintenance windows.