Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Make your Live system into a VHD


10 Oct 2009   #1

 
Make your Live system into a VHD

Mark and Bryce have done it again. A lot of us have been clamoring about having a way to convert our *existing* installs into a VHD. Not only have they made such a tool, it can be done *live* - i.e. from the very same OS that you are booted into. You can even use the same HD to make the VHD (provided you have the required space of course).

Quote   Quote: Originally Posted by http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx
Disk2vhd v1.0

By Mark Russinovich and Bryce Cogswell

Published: October 7, 2009
Introduction

Disk2vhd is a utility that creates VHD (Virtual Hard Disk - Microsoft’s Virtual Machine disk format) versions of physical disks for use in Microsoft Virtual PC or Microsoft Hyper-V virtual machines (VMs). The difference between Disk2vhd and other physical-to-virtual tools is that you can run Disk2vhd on a system that’s online. Disk2vhd uses Windows’ Volume Snapshot capability, introduced in Windows XP, to create consistent point-in-time snapshots of the volumes you want to include in a conversion. You can even have Disk2vhd create the VHDs on local volumes, even ones being converted (though performance is better when the VHD is on a disk different than ones being converted).

Updated to 1.3

Quote:
This update to Disk2vhd makes more Windows XP and Windows Server 2003 VHDs bootable by updating their MBR and boot sectors to be compatible with Hyper-V and Virtual PC and by installing the Intelide driver if it it’s not already installed. It also optimizes image creation by not copying paging and hibernation files.






See Disk2vhd for more info.


My System SpecsSystem Spec
.

10 Oct 2009   #2

windows 7
 
 

this is nice, but I'd guess that most of the time the converted VHD won't boot inside a virtual machine. After cloning the files to the virtual disk, it's quite often that registry and system files need to be tweaked in order to boot.

For example, dual core XP, will not boot inside a vm with a single virtual cpu.

We will soon release MyOldPCs converter, which converts live system to vmdk/vhd/vdi, and can boot via vmware/vpc/vbox/hyper-V, etc. More info can be found here:

http://www.vmlite.com/index.php/products/myoldpcs/
(website still work in progress)
My System SpecsSystem Spec
10 Oct 2009   #3

 

Care to expand upon your analysis?
My System SpecsSystem Spec
.


10 Oct 2009   #4

windows 7
 
 

The hardware needs to be changed from physical machine to virtual machine.

for example, you will have to enable IntelIde, PCI, and disable Intelppm, etc. for the hard disk controllers.

Windows XP uses different kernel images and HAL for single cpu and multiple cpus. In modern times, physical computers are usually dual core, while virtual machine usually only has one cpu. So if you move windows xp vhd without any changes, it won't boot.

There are many more stuff, mouse/keyboard, may freeze without changes, etc.

This change is the challenging part, cloning a disk is now a mudane task on XP and later systems that supports Volume Shadow Copy. On other systems, it's very tough.

We have implemented our own disk snapshot drivers on Windows 2000/xp/2003/vista/7/2008 (note MS does not have snapshot driver on 2k).

We have also implemented a disks snapshot driver on Linux 2.6, so can perform hot clone on Linux too
My System SpecsSystem Spec
10 Oct 2009   #5

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro with Media Center
 
 

With Paragon Virtualization Manager you can make an OS bootable on different HW. You can also transfer a partition or HD from both current system or image to a virtual disk.

Interface is excellent, runs smoothly together with Partition Manager.

Kari
My System SpecsSystem Spec
10 Oct 2009   #6

W7 X-64 W8.1 X-64 Opensuse 13.1 W2003 Server
 
 

Hi there

if you use this method (or similar such as vm converter from vmware ) you need to make sure your real "OS" disk has PLENTY of space as part of the conversion process is to clone the existing disk via the LVM (logical Volume manager) on to the SAME partition as the existing OS -- so for example if your OS is 22 GB you'll need at least 22 GB FREE on the same partition. This is only used as temporary storage during the vhd creation process as the final target vhd can go to any drive / partition you select.

Since people often want to separate their OS partitions from the rest of their system this method will come unstuck when there isn't enough space on the OS disk to create the LVM image.

Cheers
jimbo
My System SpecsSystem Spec
10 Oct 2009   #7

Windows 7 x64
 
 

My knowledge of VM/VHD interaction is essentially non-existant, but huisinro's comments seem to be at odds with Russinovich's description of Disk2vhd operation.

Disk2vhd

where e.g. at the end of the page he shows a screen shot with the following caption:

"Here’s a screenshot of a copy of a Windows Server 2008 R2 Hyper-V system running in a virtual machine on top of the system it was made from:"

But I also see (or misunderstand) a slight contradiction to that when he says

"Note: do not attach to VHDs on the same system on which you created them if you plan on booting from them. ..."

as the disk signature assigned to the vhd will not match that in the captured image.

So, what is the real story? Has the vhd being used in the screenshot had something tweaked, or a lot tweaked as huisinro suggests, or am I totally misunderstanding Russinovich's words, or ...?

I would really like to understand.

Roger
My System SpecsSystem Spec
10 Oct 2009   #8

Windows 8.1 Pro (x64)
 
 

As it so says...
Quote:
On first boot, a VM booting a captured copy of Windows will detect the VM’s hardware and automatically install drivers...
However, Windows XP is sadly not image aware therefore capturing it and then moving to a VM is a real chore. Windows Vista and Seven are imaging aware and can be moved around different machines. Just read a bit up on the WAIK documentation, it covers a lot of this kind of stuff.
My System SpecsSystem Spec
10 Oct 2009   #9

Windows 7 x64
 
 

Ah, thanks logicearth, I didn't know about WAIK. I'd seen a reference to AIK in a recent post, and finding out exactly what it referred to was just another of those tuits that I hadn't yet gotten around to!

I've d/l the documentation and I'll look at it this afternoon.

Roger
My System SpecsSystem Spec
11 Oct 2009   #10

windows 7
 
 

The image shows Windows 2008 R2 running inside hyper-V virtual machine. I am not sure about these two combinations. It all depends on the original physical machine, the guest operating system and the virtual machine software. For instance, you don't need to do anything to clone Linux and run as VM. On the other hand, For Windows XP, you have to tweak it a lot.

Our MyOldPCs converter handles all complicated cases in order to make the cloned virtual disk to boot.

Give you another example, for ThinkPad laptops, you will have to modify the virtual disk's number of BIOS disk heads, otherwise p2v XP won't boot.
My System SpecsSystem Spec
Reply

 Make your Live system into a VHD




Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 05:27 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33