Tue, Apr
1 New Articles

TechTip: P2V on a Tight Budget

  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Convert your physical Windows XP workstation to a virtual machine.


Virtualization has recently become ubiquitous and is rapidly gaining ground in complex data centers as well as on personal computers. One concept that you may have encountered in the context of virtualization is physical to virtual (P2V) system migration. P2V boils down to a process that allows you to take a snapshot image of a fully functional physical system, inject the drivers and configuration artifacts required by the target hypervisor, and deploy the image in a virtual machine (VM). Here are some obvious benefits of running your workload in a virtual machine rather than on a physical system:


  • Live partition migration and high availability
  • Ability to take advantage of the latest hardware technologies, such as faster CPUs, faster storage subsystems, and faster network access
  • Ease of cloning for backup and disaster recovery purposes


I strongly recommend that the production environments utilize one of the available commercial P2V solutions, such as Tivoli Provisioning Manager for Images (TPMforI). Individual users and early adopters can, however, perform P2V migrations with open-source tools at no cost. So if your budget is tight, keep on reading.


In this tutorial, I walk you through the steps necessary to convert your physical Windows XP workstation into a fully functional and performance-tuned virtual system that can be run under the control of Kernel-Based Virtual Machine (KVM), a Linux-based open-source hypervisor.

Preparing the Physical Windows XP Workstation for Migration

The virtual machine will appear to the Windows XP image as a different system, with different disk and network devices. It is a well-known issue that Windows does not like to be moved to a different physical system. The same consideration applies when moving to a virtual system. There is, however, a simple remedy that can eliminate a lot of the driver incompatibility issues. Luckily, the virtual hardware exposed by the hypervisor appears to Windows as standard devices. So all you need to do is to make sure that the necessary device drivers are loaded on the physical system and that the Windows registry has been updated with the additional drivers' info.   


Follow the steps described in the Microsoft Knowledge Base document to merge the registry info and copy the drivers for all IDE controllers that are natively supported by Windows XP.

Creating the Physical System Snapshot

A snapshot is a binary image of your bootable hard drive. Several methods can be employed to perform this task. The easiest approach is outlined below:


  1. Download one of the smaller Linux distributions, such as Knoppix, and create a bootable CD.
  2. Attach an external hard drive to your workstation—for example, through a USB port.
  3. Boot the workstation from the CD you created in step 1.
  4. Run the following commands from the Linux prompt:


fdisk -l


This command lists the partition information for all the hard drives attached to the system. Typically, the Windows drive appears as a device named sda and the USB-attached drive as sdb. Run the following command to copy the content of the Windows hard drive to a file on the USB-attached drive:


dd if=/dev/had of=/Images/my-ws.img


The copy process takes about an hour for a 100GB source drive. Your mileage will vary depending on your particular hardware configuration.

Deploying the Image to a KVM Host

Copy the image to the image repository of a KVM host. Then, on the KVM host on which you wish to run the image, execute the following command:


/usr/bin/qemu-system-x86_64 -m 2048 -boot c -drive file=/var/Images/my-ws.img,if=ide,index=0 -net nic,macaddr=52:54:00:47:80:e9,vlan=0 -net tap,vlan0 -vnc


Modify the above command to reflect your actual environment. Note the location of the image file. The example also assumes that the KVM host uses the network bridge. See KVM documentation for the details.


Once the virtual machine is successfully started, you can attach to it using VNC, as shown below:




From now on, you should be able to log into your workstation image and use it as if it were running on your physical workstation.

Setting Up the Virtio Drivers

The paravirtualized virtio drivers available for Windows guests can dramatically improve the network and storage throughput, so I strongly recommend installing them. As of this writing, the block virtio driver available on the official KVM Web site does not work on Windows XP clients, so we need to split the setup into two phases.

Installing the Network Virtio Driver

Download the ISO image containing the network virtio driver to a directory on the KVM host—for example, /Install_Images/virtio. Now restart the virtual machine, attaching the downloaded ISO as a CD drive and adding the model=virtio switch to the –net parameter. This instructs KVM to attach a new virtual network adapter to the virtual machine. An example command is shown below:


/usr/bin/qemu-system-x86_64 -m 2048 -drive file=/var/Images/my-ws.img,if=ide,boot=on -drive file=/Install_Images/virtio/KVMNet.iso,if=ide,media=cdrom -net nic,macaddr=52:54:00:47:80:e9,vlan=0,model=virtio -net tap,vlan=0 -vnc


When the VM is booted, the Windows guest recognizes that a new device has been attached and the Found New Hardware wizard appears. Use the "No, not this time" option to decline the Windows Update search and then select the "Install from a list or a specific location" option. Navigate to the location on the CD drive where the Windows XP driver is and install it.

Installing the Block Device Virtio Driver

We'll use an approach similar to the one for the network driver but with a little twist required by Windows XP. Download the ISO image containing the corrected version of the Windows XP block driver. Now, you need to trick Windows into allowing you to install this new driver. For this to happen, create a dummy disk image using the following command:


qemu-img create –f qcow2 /var/Images/dummy.qcow2 1G


Restart the virtual machine, attaching the downloaded ISO as a virtual CD drive and the dummy drive. Remember to set the if=virtio switch on the -drive parameter. This instructs KVM to attach a new virtual hard drive to the virtual machine. An example command is shown below:


/usr/bin/qemu-system-x86_64 -m 2048 -name vmwxp -drive file=/var/Images/my-ws.img,if=ide,boot=on -drive file=/var/Images/dummy.qcow2,if=virtio -drive file=/Install_Images/virtio/viostor-xp-2010-02-06.iso,if=ide,media=cdrom -net nic,macaddr=52:54:00:47:80:e9,vlan=0,model=virtio -net tap,vlan=0 -vnc


Again, when the VM is booted, the Windows guest recognizes that a new drive has been attached and presents the Found New Hardware wizard. Use the procedure outlined in the previous section to install the block virtio driver. Shut down the VM and restart it, modifying the if switch on the –drive parameter for the bootable drive. This is illustrated below:


/usr/bin/qemu-system-x86_64 -m 2048 -name vmwxp -drive file=/ var/Images /my-ws.img,if=virtio,boot=on -net nic,macaddr=52:54:00:47:80:e9,vlan=0,model=virtio -net tap,vlan=0 -usb -vnc


You can verify that the virtio drivers are functioning properly by inspecting the Device Manager dialog in the running VM. This is shown in Figure 1.



Figure 1: You can see your virtio drivers in your Windows XP virtual machine.


That's it! Now you have a fully functional Windows XP virtual machine utilizing well-performing virtio drivers for networking and storage access.



Jarek Miszczyk

Jarek Miszczyk is a Lead Technical Consultant for System x Virtualization and Cloud Computing at the IBM STG Global ISV Enablement organization. He is located in Rochester, Minnesota. He can be reached by email at This email address is being protected from spambots. You need JavaScript enabled to view it..



Support MC Press Online

$0.00 Raised:

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: