How to virtualize a physical Windows install on Linux

This guide details my experience trying to run my dualbooted Windows install as a VirtualBox guest under a Linux host. This procedure was tested with Windows 8.1 Pro and VirtualBox 5.1.2.

  1. Download vmdk-raw-parts1 and follow the instructions. You'll end up executing something along the lines of2:
    
    ./vmdk-raw-parts /dev/sda ~/WindowsVM 1 2 3 4
    
    
    if your Windows partition is /dev/sda3, and various recovery partitions are 1, 2, and 4. You now have a directory with a .vmdk file and some other important files that direct VirtualBox to your physical Windows partition.
  2. Start up VirtualBox, set up a new VM and point it to the .vmdk you just created. Important settings are:
    • System → Enable IO/APIC
    • System → Enable EFI if your physical install boots from UEFI
    • Network → Adapter 1 → Advanced → Attached to: NAT, Adapter Type: Paravirtualized, Cable Connected: true
    • Display → Screen → Enable 3D Acceleration: false (this may work for you, but it made the virtual screen a weird size for me and created a massive cursor offset)
  3. Boot your VM and cross your fingers. If you run into any problems I recommend checking out amhill's guide as linked below in the References section.
  4. If you boot up successfully but have no network access, download the stable virtio-win ISO from Fedora3. Pop the ISO in the virtual CD drive, open Device Manager, find the Ethernet Controller under Other Devices, right click Update Drivers, browse locally, and point towards the CD (the checkbox "including subdirectories" should be true). If all goes well, Windows will prompt whether you want to install the "Red Hat VirtIO Ethernet Adapter." Accept and you're on your way!

References

1 I had to use vmdk-raw-parts since VirtualBox's builtin createrawvmdk does not support physical GPT partition schemes at this time. If your drive uses MBR instead of GPT, feel free to use createrawvmdk (as detailed in amhill's guide) instead.

2 If you get permission errors, you may need to chmod the correct device files in /dev as detailed in amhill's guide and add yourself to the disk group.

3 https://fedoraproject.org/wiki/Windows_Virtio_Drivers

Windows


Last modified on 16 Aug 2016 at 06:21:42 PM EDT ET