Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Migrate existing Windows installations to VirtualBox

Rumi, June 28, 2011June 28, 2011

Windows installations, unlike Linux, cannot easily be moved from one hardware to another. This is not just due to Microsoft's activation mechanism but the fact that the installed kernel and drivers depend on the actual hardware. 

This document explains the common pitfalls and how to workaround these. We assume that either a physical Windows installation or a VMware image is the source of migration. It is also assumed that a suitable virtual disk image (either VDI or VMDK for VirtualBox >= 1.4) is already present. 

There's a step by step description below. 

HAL

The hardware dependent portion of the Windows kernel is dubbed "Hardware Abstraction Layer" (HAL). While hardware vendor specific HALs have become very rare, there are still a number of HALs shipped by Microsoft. Here are the most common HALs (for more information, refer to this article: http://support.microsoft.com/kb/309283): 

Hal.dll (Standard PC) 

Halacpi.dll (ACPI HAL) 

Halaacpi.dll (ACPI HAL with IO APIC) 

If you perform a Windows installation with default settings in VirtualBox, Halacpi.dll will be chosen as VirtualBox enables ACPI by default but disables the IO APIC by default. A standard installation on a modern physical PC or VMware will usually result in Halaacpi.dll being chosen as most systems nowadays have an IO APIC and VMware chose to virtualize it by default (VirtualBox disables the IO APIC because it is more expensive to virtualize than a standard PIC). So as a first step, you either have to enable IO APIC support in VirtualBox or replace the HAL. Replacing the HAL can be done by booting the VM from the Windows CD and performing a repair installation. 

Hard Disk Support

For reasons we don't understand, Windows memorizes which IDE/ATA controller it was installed on and fails to boot in case the controller changes. This is very annoying because you will run into this problem with basically all migrated images. The solution here is to perform several modifications to the Windows registry. This can be done while the installation is still running on the original system because all it does is relax the IDE checks. Therefore the installation will continue to work on the original system after the modification. The easiest way is to use the excellent MergeIDE utility from the German c't computer magazine. Alternatively, instructions in Microsoft's knowledge base article can be followed: http://support.microsoft.com/kb/314082 

agp440.sys / intelppm.sys

There are a few Windows device drivers that does not play nice on VirtualBox' hardware. Many physical PC systems (and VMware) have a AGP graphics bus which will cause agp440.sys to be installed. VirtualBox' virtual graphics card is on the PCI bus and the driver will cause a system crash. The most correct approach is to boot the recovery console from the Windows installation CD and disable this service. However, it is also possible to just rename/delete agp440.sys the C:\Windows\SYSTEM32\drivers directory. Here is a knowledge base article containing more information: http://support.microsoft.com/kb/324764 

A similar problem may exist with intelppm.sys, which can also cause a hang of the guest OS. 

Step By Step Instructions For Windows XP

This should work for Win2k Vista and Windows 7 as well, but it's untested. 

Run the MergeIDE utility as mentioned above on existing windows machine. 

Shut down windows machine. 

Either pull the drive from the windows machine or copy the data with a low level image tool (like dd) to a USB drive or other removable media. If making an image, DO NOT image just the partition, this will not work! 

Use VBoxMange convertfromfaw to convert the image or to copy from the drive you pulled from the windows machine. 

If you are converting from the image, the syntax is just 

VBoxManage convertfromraw ImageFile.dd OutputFile.vdi

If you are converting from the drive, you need to use 

cat /dev/sdg | VBoxManage convertfromraw stdin OutPutFile.vdi NUMBEROFBYTES

Note, if you use fdisk -l in Linux you can see how many bytes each drive is to supply this parameter. Example: 

# fdisk -l /dev/sda

Disk /dev/sda: 1500.3 GB, 1500301910016 bytes

To determine the same information on a Mac OS X host, you do 

# diskutil list

# diskutil info /dev/disk0

to list available disks and to show the number of bytes under Total Size:. 

Then use the media manager in VirtualBox to add the newly converted drive. 

Make a new virtual machine, using the drive you just added with the media manager. 

Once it is created, go in and turn on “Enable IO APIC”, select the # of processors you want etc. 

Try to boot the new virtual machine. It may “just work”, or you may get a BSOD. If it just works install guest additions and you are done. Depending on your license you might need to re-activate Windows. 

If it did not work, and you got a BSOD. Shutdown the virtual machine and boot up from a windows CD. Go through until you get to the select a partition, select the existing partition, and choose “repair”. It will basically reinstall windows and configure it for your new hardware (virtual hardware). 

Reinstall patches (Service packs) and updates. 

Install guest additions

Virtualbox Virtualization

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP squid SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin XCP-NG zimbra

Topics

Recent Posts

  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025
  • Mount a drive permanently with fstab in Linux April 16, 2025
  • Proxmox 1:1 NAT routing March 30, 2025
  • Installation steps of WSL – Windows Subsystem for Linux March 8, 2025
  • Enabling Nested Virtualization In Proxmox March 8, 2025
  • How to Modify/Change console/SSH login banner for Proxmox Virtual Environment (Proxmox VE / PVE) March 3, 2025
  • Install Proxmox Backup Server on Debian 12 February 12, 2025

Archives

Top Posts & Pages

  • Install Jitsi on Ubuntu 22.04 / 22.10
©2025 Bots! | WordPress Theme by SuperbThemes