Converting Your Physical PC into a Virtual Machine

Moshe Harel
Moshe Harel
May 19, 2022

The term Physical to Virtual, or in short, P2V, is a process which enables users to transfer their physical PC into a virtual machine. This process has gained great popularity of late amidst home users and organizations due to the increasing demand for virtualization technology.

This article will explore some P2V tools and solutions which can copy the physical PC including disk’s contents and system preferences and definitions and convert it into a virtual disk (pretty much like an image backup). This virtual disk can be later either manually used or automatically launched as a virtual machine. The advantages and functionality of such a process differentiate between home users and organizational networks.

During this article we’ll get familiarized with simple tools which better suit the home user and developers who’re interested in the technology.
1. Online P2V – for the home user and for developers
2. Offline P2V – performing P2V using Live-CD
3. Automatic P2V – performing P2V using SCVMM
Terminology
P2V – a term used to describe the conversion of a physical PC into a virtual disk or straight into a virtual machine and which can be automatic, online or offline.
V2V – a term used to describe the conversion between two virtual systems.
V2P – a term used to describe the process of importing a virtual system into a physical PC.
Volume Shadow Copy – VSC technology is built into Windows XP SP2 and Windows 2003, or later versions. It enables capturing disk partitions even if these are used and locked by other resources.
Online P2V
Online P2V refers to a situation when an operating system is being converted while it is operating. This process usually utilizes the Volume Shadow Copy technology in order to capture the system files and the software programs installed on it without rebooting and without hampering its activity or performance.
P2V for Home Users and for Developers
There are a few free tools available which are designed to be mainly used by home users and by developers. These tools allow for a semiautomatic P2V. Semiautomatic means, in this instance, the conversion of a physical PC into a virtual disk after scanning the PC’s contents. Later, the user can go on to create a virtual machine out of this file.
Principle Uses
We can duplicate the operating system on which we’re working, convert it into a virtual machine and then run tests on a separate system without damaging or hindering the original operating system.
Another use for this process can be at times when we’re interested in upgrading our operating system, let’s say from XP to Windows 7, and we’re worried that some software programs may not run properly after the transition had been made. If this is the case, we can use a P2V tool to capture the system before the transition and then, after having completed the upgrade, load it as a virtual system and easily launch the software programs we need.

It should be noted that the XP Mode provides a similar solution, it also operates in a virtual environment and is designed to support applications designed for XP which cannot be used on Windows 7. However, it requires reinstalling all of the software programs on the system while P2V transfers them as they are (one of XP Mode’s substantial downsides).
Free Online P2V Tool
WinImage

A powerful software program which enables users to load, edit, create, merge, defragment and convert image files including executing online V2P, P2V and V2V.
1. Convert a physical PC into a virtual disk (P2V) in VHD and VMDK formats
2. Restore a physical PC from a virtual disk (V2P)
3. Convert virtual disks between formats

Offline P2V
This method is a more reliable one than online P2V as it creates an exact duplicate of the inoperative physical machine. The PC is rebooted and run in a WinPE environment or on a Linux based system so operating systems can be backed up including: Linux platforms, older versions of Windows and non-NTFS file systems even if they don’t support Volume Shadow Copy technology. Executing offline P2V usually gets done using commercial software programs or tools that support P2V from a Live-CD.
P2V from a Live-CD
Acronis had published a few commercial products for performing P2P, V2P, V2V and P2V such as Acronis True Image Echo which works as a Live-CD and enables conversion from various platforms.
Paragon had also developed a product which provides a solution for performing P2P, V2P, V2V and P2V. The free version ‘Partition Manager for Virtual Machines’ enables conversion for operating systems on the client’s side while the commercial version ‘Corporate Edition’ supports all platforms.

Automatic P2V
This term is used to describe the conversion of a physical PC directly into a virtual machine. Automatic P2V is usually done on corporate networks using tools that transfer outdated servers which are installed on obsolete hardware and convert them into more powerful hardware which operates in a virtual environment. This is also a good way to save physical space and electricity usage and to enjoy servers’ central management.

This process consists of several actions related to both the physical and virtual servers which are automatically carried out. These actions include: converting the partitions’ contents into virtual disks, creating a virtual machine, copying files between servers, updating the virtual machine with various drivers and integration tools and finally, uploading the content of the physical PC as a virtual machine.
Virtual machines can be imported to virtual servers such as: Hyper-V and VMware ESXi.
Users should choose the PCs or servers they would like to convert, set the preferences (number of processors, disk volume and memory size) and launch the process. Eventually the physical PC will automatically be set in the desired virtual environment such as: Hyper-V or VMware.

Going Online or Offline?
As previously mentioned, performing P2V can be done either online or offline. Servers which contain static data (for example – web servers) make for good online P2V candidates. Suitable offline P2V candidates include: servers which get frequently updated, such as Exchange or Active Directory and databases and servers which are installed on operating systems that don’t support VSS such as Windows 2000 or NT4.

VMM Online P2V
This action installs an agent on the physical PC, which is automatically removed when the process is completed. For this process to work, both the operating system and the applications installed on it must support VSS.

VMM Offline P2V
This action installs an agent on the physical PC and modifies the boot menu to launch in a WinPE environment. Unlike Online P2V during conversion we may be asked to supply different drivers such as: network card, Scsi disk, etc, which are not supported by Windows PE.
Tip: should you fear that locating existing drivers will prove to be challenging you can put to good use a driver backup software program, backup existing drivers and burn them onto a CD.
Prior to performing P2V
Assuming that you’ve already installed Hyper-V 2008 R2 and VMM 2008 R2 and checked to see if they work properly.
1. Make sure that the physical PC’s operating system supports P2V. Should you wish to perform P2V on systems which are not supported there are third party tools that will enable you to do so
2. Make sure that the physical server has at least 512MB of memory
3. Backup physical server before performing P2V
4. Backup using an image file to avoid unnecessary complications
5. Check hard drive using Chkdisk. The P2V process may fail should the hard drive contain any damaged sectors
6. Not mandatory but advisable: defragment disk’s partitions in order to accelerate the P2V process
7. Temporarily shut down the firewall installed on the physical server or open relevant ports
8. Make sure no one is currently using the physical server
After P2V Process Is Done
1. After having completed the P2V process, launch the virtual machine created in the process. While you make sure the network card is not connected, run tests, view the Event Viewer and finally shut down the physical server and connect the virtual machine to the Net
2. Blue Screens
To avoid blue screens while launching the virtual machine after the conversion, it is advisable to remove drivers related to different hardware developers.
Tip: after completing the P2V process, try launching the virtual machine in Safe Mode and then remove redundant drivers

Written by Moshe Harel
LinkedIn: http://www.linkedin.com/in/itbananas