Linux下VMware Win10虚拟机V2P迁移至物理磁盘分区方法
Alright, let's walk through how to get your Windows 10 VM's filesystem content onto a physical partition—since you mentioned it's not a byte-for-byte image, we'll focus on filesystem-level cloning/adaptation instead of raw disk copying. You've got Linux Mint Sylvia live media, which is perfect for this because it gives us a clean, bootable environment to work with without messing up your host OS.
Step 1: Prepare Your Environment & Mount the VMware Virtual Disk
- First, boot into your Linux Mint Sylvia live session. Make sure you have at least 4GB of RAM (to handle disk image operations) and that both your VMware virtual disk file (usually
.vmdk) and target physical partition are accessible (e.g., connect a USB drive with the VMDK, or mount the host partition where it's stored). - Install tools to mount VMware disks: Open a terminal and run:
sudo apt update && sudo apt install qemu-utils ntfs-3gqemu-utilslets us attach the VMDK as a block device, andntfs-3gensures we can read/write NTFS partitions (Windows' default filesystem). - Load the necessary kernel module:
Thesudo modprobe nbd max_part=8max_part=8flag lets us access individual partitions inside the VMDK. - Attach the VMDK to a network block device:
Replacesudo qemu-nbd --connect=/dev/nbd0 /path/to/your/virtual-disk.vmdk/path/to/your/virtual-disk.vmdkwith the actual file path (usecdto navigate to the directory first if needed). - List the partitions inside the VMDK to identify the main Windows system partition:
You’ll usually see a small EFI partition (sudo fdisk -l /dev/nbd0/dev/nbd0p1) and a larger main Windows partition (/dev/nbd0p2). - Mount the main Windows partition to a temporary directory:
sudo mkdir /mnt/vm-win sudo mount /dev/nbd0p2 /mnt/vm-win
Step 2: Prepare the Target Physical Partition
- Identify your target physical disk and partition using
sudo lsblkorsudo fdisk -l. Double-check this—formatting the wrong partition will erase all data on it! Let’s assume your target is/dev/sda3for this example. - Format the target partition as NTFS (to match Windows' filesystem):
sudo mkfs.ntfs /dev/sda3 - Mount the target partition to another temporary directory:
sudo mkdir /mnt/phys-win sudo mount /dev/sda3 /mnt/phys-win
Step 3: Copy Filesystem Content (With Smart Exclusions)
- We’ll use
rsyncbecause it efficiently copies files while preserving permissions, timestamps, and symbolic links. Run this command:sudo rsync -avh --progress --exclude='/pagefile.sys' --exclude='/hiberfil.sys' --exclude='/swapfile.sys' /mnt/vm-win/ /mnt/phys-win/--excludeskips system files that Windows will automatically recreate (pagefile, hibernation file, swap file) to save time and space.-avhenables archive mode (preserves metadata), verbose output, and human-readable file sizes.--progresslets you track transfer status.
- Wait for the copy to finish—this could take anywhere from minutes to hours depending on how much data is on the VM disk.
Step 4: Fix the Windows Bootloader
Since we copied only the filesystem (not the entire bootable disk), the bootloader won’t work out of the box. Here’s how to repair it:
- First, clean up your Linux Mint session:
sudo umount /mnt/vm-win sudo umount /mnt/phys-win sudo qemu-nbd --disconnect /dev/nbd0 - Boot from a Windows 10 installation media (USB or DVD). If you don’t have one, create it from your Linux Mint live session using
woeusb(install withsudo apt install woeusb). - Once in the Windows setup, select Repair your computer > Troubleshoot > Advanced options > Command Prompt.
- Run these commands in order:
diskpart list disk # Identify your physical disk (note the number, e.g., Disk 0) select disk 0 list partition # Find your Windows system partition (e.g., Partition 3) select partition 3 active # Marks the partition as bootable exit bootrec /fixmbr bootrec /fixboot bootrec /scanos # Scans for Windows installations bootrec /rebuildbcd # Adds the Windows installation to the boot menu (follow prompts) - Exit Command Prompt and restart your computer—Windows should now boot from the physical partition.
Step 5: Post-Boot Adjustments
- When Windows first boots from the physical disk, it will detect new hardware and install drivers automatically. Make sure you have an internet connection to download these.
- You may need to reactivate Windows if your physical hardware differs significantly from the VM’s virtual hardware—this is normal, as Windows ties activation to hardware signatures.
内容的提问来源于stack exchange,提问作者Christos Hayward
相关产品推荐
相关产品推荐

