Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to move a Windows 7 virtual machine (on Windows 8 host) to another host machine in a different network (and to also run it with Virtualbox there). All the descriptions that I've found are referred to file based .vmdks' export and clone, but I have created a .vmdk which points to a RAW partition. How can I transfer this type of VM?

I'm on Virtualbox 4.3.4

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You have to use disk cloning software to clone RAW partition onto the second PC's disk or to a virtual hard disk.

I can recommend Acronis TrueImage, you can get a free trial. Your HDD's manufacturer may provide an unlimited free version of it too, but keep in mind that it will run only on machines with that manufacturer's disks, so you'll need such disks in both machines or You'll have to clone to a virtual HDD. The popular free tool Clonezilla probably won't work in this case, it usually fails when cloning to another HDD.

Whatever tool you'll decide to use, you'll have to create a bootable CD or pendrive (or just ISO, if you want to clone to a virtual disk).

Cloning to second machine's physical hard drive

  1. Copy your VM's folder to the new host.
  2. Create an image of the old raw partition with some disk cloning software.
  3. Move the image to the new host.
  4. Use the same program to restore the image to the hard disk. You may have to create appropriate partition first.
  5. Make sure Windows detects the new partition: press Win, type diskmgmt.msc and press Enter. Partition should be marked as healthy. If a drive letter is assigned to it, remove the drive letter and reboot.
  6. Recreate VMDK file:

    • In the VM's folder delete MyDiskFile.vmdk and MyDiskFile-pt.vmdk
    • Run elevated command prompt: Win, cmd, Ctrl+Shift+Enter, confirm UAC dialog
    • Change directory to the VirtualBox application's directory:

      cd C:\Program Files\Oracle\VirtualBox
      
    • List all available partitions: (adjust drive number)

      VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDrive0
      

    Screenshot of command prompt window with partitions listed

    • Check which partition is the one you have just created and restored image to.
    • Create new VMDK: (adjust path and disk/partition numbers)

      VBoxManage internalcommands createrawvmdk -filename D:\PathToMyVMs\MyVM\MyDiskFile.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 2
      

Cloning to a virtual hard disk

  1. On the old host, open VM's settings in VirtualBox. In the Storage section, attach a new hard disk. Make sure it's big enough to fit all data from your raw partition.

    A screenshot of VirtualBox settings with "Add Hard Disk" button pointed by an arrow.

  2. Load your bootable ISO into the virtual optical drive.

  3. Boot the VM. On the VirtualBox logo screen press F12 and then C to boot from the ISO.

  4. Use your disk cloning tool to clone raw partition to the virtual disk. You may have to create a partition first.

Setting up new host

You can load the VM on your new host by choosing MachineAdd... in the VirtualBox's main window. It will appear on the list of VMs.

VirtualBox may complain about unrecognized disks or incorrect UIDs. If this is the case, use Virtual Media Manager (File menu in the main window) to detach problematic disks. You'll have to attach them again. If you won't be able to do it, you may have to detach disks before copying VM to a new host.

Windows should work on the new hard drive (physical or virtual) without any adjustments. A balloon notification about new hard drive may pop up asking you to reboot. It's not urgent, but may improve performance.

Remember that you have to remove the VM from your old machine to avoid violating Windows license.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.