星期一, 二月 08, 2010

VHD開機補述

哪些Windows能從VHD開機?如果要將已經開機過的VHD複製到另一部實體機器並從VHD開機?Vista能不能載入VHD裡的作業系統?VHD需要支援VT的處理器嗎?

哪些Windows能從VHD開機?

所有Windows 7和Windows Server 2008 R2版本都支援VHD(建立、連結,將VHD視為一般硬碟),但能從VHD開機的作業系統,僅限Windows 7企業版、旗艦版,及Windows Server 2008 R2(Foundation版除外)。

如果要將已經開機過的VHD複製到另一部實體機器並從VHD開機?

這必須先以sysprep執行過一般化(sysprep /generalize /oobe);TechNet《常見問題集:Windows 7 中的虛擬硬碟》的說明如下:

將 VHD 用於其他電腦的原生開機前,先執行 Sysprep 來將映像一般化。Sysprep 一般化作業可備妥安裝在實體磁碟分割的 Windows 映像,或安裝在即將用於另一台電腦之原生開機 VHD 中的 Windows 映像。執行 Sysprep 之後,您可以將 VHD 複製到多部實體電腦或虛擬機器中以進行原生開機。

Vista能不能載入VHD裡的作業系統?

如果想從Vista SP1載入VHD裡的作業系統不是不行,只是要將Vista裡的開機選單編輯器BCDEdit和開機管理員BootMgr換成Windows 7或Windows Server 2008 R2版本。

Aviraj Ajgekar在其文章說明了作法:先備份Vista的BCDEdit和BootMgr,然後將新版的這兩個檔案複製到Vista,最後再以新版的BCDEdit將VHD加入Vista的開機選單(作法一如《邊做邊學 Windows 7:如何在 Windows 7 建置開機 VHD》所述),重開機後就可從選單選取新加入的項目。

VHD需要支援VT的處理器嗎?

微軟Springboard Series Insider電子報 Volume 2, No. 2有一些關於VHD開機的內容並不正確,以下是原文:

There are a couple of prerequisites for using Boot from VHD:

•  Your hardware needs to have virtual technology (VT) embedded in the processor. (Currently both Intel and AMD have this technology available.)

•  The VT functionality needs to be enabled in BIOS.

•  The host needs to be either Windows 7 or Windows Server 2008 R2.

•  The VHD needs to be either Windows 7 or Windows Server 2008 R2.

•  The VHD needs to be the Hyper-V version, not Virtual Server 2005 or Virtual PC 2007.

錯誤的是前兩點,VHD開機並不需要VT(但原作者的部落格文章卻又沒有前兩點,不知道到底是作者寫錯,還是電子報的編輯出錯)。

8 意見:

NOWHEREMAN 提到...

如果想 vhd-boot windows xp,似乎可以用這個,不過是要付款。
Leap Frog
http://www.portlock.com/products/leap_frog/

賴榮樞 提到...

感謝您的留言,非常實用的資訊。

匿名 提到...

讓作業系統用VHD開機的方法:
※【方法一】
VBoot from VMLite
【官方介紹】
http://www.vmlite.com/index.php/products/vboot
【VBoot支援的作業系統】
Windows 2000, Windows XP, Vista, Windows 7, 2003 Server, 2008 Server and Linux 2.6, 32- and 64-bit
【VBoot支援用vhd啟動的作業系統類型】
VBoot provides native XP VHD boot, Vista VHD boot, Windows 7 VHD boot, Linux VHD boot, 2003 server VHD boot and 2008 server VHD boot.
【VBoot官方介紹原文】
VBoot allows you to boot a physical computer from a single virtual disk file in VHD format. Each file contains a single operating system. It supports Windows 2000, Windows XP, Vista, Windows 7, 2003 Server, 2008 Server and Linux 2.6, 32- and 64-bit. VBoot makes multiple boots extremly simple. You just simply copy a single file to a physical computer, and it can boot to the OS contained inside that file. VBoot provides native XP VHD boot, Vista VHD boot, Windows 7 VHD boot, Linux VHD boot, 2003 server VHD boot and 2008 server VHD boot.

You can use our MyOldPCs software to convert your XP machine to a VHD file, you can either run the VHD file as a virtual machine using VMLite Workstation, or use this same VHD file to boot your new physical PC directly to achieve even better performance.

重要的是,有提供實體作業系統轉換成VHD的方法(使用MyOldPCs),
但是我也發現另一個由Sysinternals公司的工具P2V(Physical-to-Virtual 實體轉虛擬 )- Disk2vhd。
【實體轉虛擬Physical-to-Virtual-VHD製作工具】
MyOldPCs,Disk2vhd,或是利用Acronis True Image Home 2010將TIB備份轉換成VHD備份
(Tib備份:指用Acronis True Image Home 2010衛系統製作備份,tib為Acronis True Image的專有格式)
【其他關於MyOldPCs的英文介紹】
http://www.vmlite.com/index.php/products/myoldpcs
【其他關於Disk2vhd的中文介紹】
http://www.askasu.idv.tw/index.php/2009/10/11/712/
【Disk2vhd官方位置】
http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx

賴榮樞 提到...

非常感謝您的留言,很有用的資訊,尤其很多人應該很想知道如何啟動VHD裡的WinXP。

次方 提到...

【方法二】
使用EasyBCD
【EasyBSD】
http://neosmart.net/dl.php?id=1
【實作案例】
VHD Boot from Windows XP
http://neosmart.net/dl.php?id=1

賴榮樞 提到...

您的留言真是詳盡、實用,謝謝。

次方 提到...

抱歉上次的內容太過於簡短,更新如下:
【方法二】-【Boot from VHD、ISO 、WinPE......及多重選單管理】
使用EasyBCD
【EasyBSD官方網站】
http://neosmart.net/dl.php?id=1
【實作案例】
(【VHD Boot from Windows XP】)
http://blogs.msdn.com/b/ramnishs/archive/2009/05/26/vhd-boot-from-windows-xp.aspx
【EasyBSD功能】
EasyBCD is NeoSmart Technologies' multiple award-winning answer to taking control of your bootloader. EasyBCD extends and revamps the Windows Vista/Windows 7 BCD bootloader, and with EasyBCD, almost anything is possible. Setting up and configuring a dual-boot between Windows 7, Windows Vista, older versions of Windows such as XP & 2003, Linux, Ubuntu, BSD, and Mac OS X is a breeze. You just point & click and EasyBCD does the rest.

EasyBCD is geared for users of all kinds. Whether you just want to add an entry to your old XP partition or want to create a duplicate for testing purposes; if you're interested in debugging the Windows Kernel or septuple-booting your seven test operating systems, EasyBCD is the key.

* Boot into XP/Vista/7/Ubuntu/OS X and more!
* Boot from USB, Network, ISO images, Virtual Harddisks (VHD), WinPE, and more!
* Repair the Windows bootloader, change your boot drive, create a bootable USB, and more!
* Rename entries, set default boot target, change BCD timeout, hide the boot menu, and more!
* Create your own custom boot sequence, hide drives on boot, backup and restore configurations, and more!

EasyBCD is used and recommended by Microsoft, PC-World, PC-Magazine, Softpedia, PC-Welt, and hundreds more! Don't get left out – download it today, it's free!!
【windows XP 】
在WindowsXP中,EasyBSD可以讓使用者安裝或是替換Vista Bootloader或是XP Bootloader至MBR中
但是若要在WindowsXP下新增開機選單(Add New Entry)建立Boot from USB, Network, ISO images, Virtual Harddisks (VHD), WinPE的Entry的話,得手動加入建立。使用者必須先讓EasyBSD產生出XXX.mbr檔案,通常存放於【C:\Nst\XXX.mbr】中,然後將【C:\Nst\XXX.mbr】自行對應新增至【C:\boot.ini】中,語法為:C:\Nst\XXX.mbr="123測試",『123測試』即成為其在選單中顯示的名稱。
【XP-boot.ini修改範例說明】
(利用EasyBCD所產生的.mbr,手動修改Boot.ini來達成新增Entry(開機選單)的功能)
例如:
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /usepmtimer
c:\NST\Lived-CD.mbr="Ubuntu-10.04-Lived-CD"
c:\NST\Ubuntu10.04-wubi.mbr="Ubuntu*"
c:\NST\WinPE.mbr="WinPE"
c:\NST\GRUB2.mbr="Grub2"
c:\test.mbr
......
至此,即使是windowsXP,也能達成想要的功能選單,包括【VHD Boot】的功能(只要用一樣的方法加入boot.ini選單中即可選擇),但是不確定非windows7作業系統的VHD是否都能夠成功開機。(如vista-VHD,XP-VHD,Ubuntu-VHD......)
【windows Vista / windows 7】
EasyBSD可以自動化修改,不需自行編輯bootloader新增。

賴榮樞 提到...

非常感謝 :-)