網頁

2012年4月15日 星期日

P2V for Boot VHD

I have already install a Windows 7 x64 version on Notebook and divided some partition into locate OS and Data.
ScreenHunter_01 Apr. 15 15.34
For building a VHD and boot it, let me install any program or software on VHD for testing. If go wrong or testing fail, I don’t worry it will influence my workstation because I can give up this VHD and duplicate it again. It will be very convenient for me to do any business testing.

Microsoft Disk2vhd is good utility for P2V and its operation is very simple and straight. In GUI, select which drive you want to convert to VHD.
For my sample, I just want to convert the system and drive c partition.
ScreenHunter_03 Apr. 15 15.46
After complete P2V conversion, please remember to attach VHD in Disk Manager.
ScreenHunter_04 Apr. 15 15.56
Next to delete all volumes except for the system and drive c partition.
ScreenHunter_05 Apr. 15 15.58
So do that we will keep the right disk, not include the other garbage. That is we will do next action to delete unwanted volume or partition by Vhd Resizer tool.
ScreenHunter_06 Apr. 15 16.08
After complete Resizer job, please attach VHD file again for extend volume “Drive F” from 69.90 GB to 79.90 GB.
ScreenHunter_07 Apr. 15 16.11

ScreenHunter_08 Apr. 15 16.17

After detach VHD, we will add VHD entry in boot menu by BCDEdit tool in command prompt Run As administrator.

Once restart the computer, we will see additional entry in Boot Menu and can boot to “Windows 7 Enterprise x64 (VHD)” environment now.

But it is very strange that VHD occupy Drive E, not Drive C !
When I verify the environment by "set" command, I find out the big problem --- the program execution still use Drive C file (Physical Disk), not use Drive E (VHD).
That is "if you want to install new application, the installation location will put into Drive C (Physical Disk), not Drive E (VHD).

I don't know how to resolve it even though I try to fix it by repair CD or sysprep. I just know it will success if  install the pure Windows 7 into attached VHD by booted CD. Maybe the above step is not compatible with Windows 7 installation process, I think.

During some days, I find out how to resolve this problem and let the VM can be booted normally!

To install Virtualbox on the converted machine, the Virtualbox Manager is opened next to create a new VM but mount the existing VHD file. If it is boot normally, please firstly uninstall anti-virus or spam next to execute Sysprep on VM.
When the above process complete, the VM's OS will be shutdown automatically.
Please close Virtualbox Manager next to add it to Boot Menu and restart OS.
So does that this converted VM will be booted now.

Summary:
Based on my experience, I write down the related procedure as follows:
(1).P2V by Microsoft disk2vhd 1.4 and verify volume type=NTFS by disk manager
(2).Shrink & delete the partition to keep the right volume
(3).Resize VHD file by VHD Resizer 1.0.42 and verify disk type=NTFS by disk manager
(4).VHD disk type = fixed, not use Dynamic
(5).Create new VM but mount the converted VHD on Virtualbox or Hyper-V
(6).In VM of Virtualbox or Hyper-V, uninstall anti-virus/spam next to execute Sysprep
(7).Add VHD to Boot Menu by BCDEdit
Hope it can help you in the future!

Comment:
At first, I try to use disk2vhd for P2V next to resize VHD by vhd Resizer 1.0.42 but the result is "VHD Volume Type = RAW, not NTFS".
This is why I need to write down Tool Version on this article!

沒有留言:

張貼留言

Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.