win7下安装server2008r2到vhd文件中组成双系统

昨天晚上把从微软学生中心下的server2008r2装上了,这样我的电脑上就有俩免费的正版操作系统了(一个OEM,一个微软学生免费正版)。

方法是google到的:http://blog.frankovic.net/2009/05/boot-win-2008-r2-rc-from-vhd/

Boot Windows Server 2008 R2 RC from VHD within Windows 7

by Marin Franković on 16 May, 2009

As I wrote in some of my earlier articles, Windows 7 and Windows Server 2008 R2 can be booted from VHD file without need to be installed on "real" physical disk. This is great option for testing or even deploying multi boot computers to users. Possibilities are endless.

Few days ago I decided to exploit this opportunity and to install Windows 2008 R2 RC in VHD and use it as boot option on my laptop. There are basically two ways you can do this.

First I created new virtual machine in Microsoft Hyper-V console and tried to implant it on my existing Windows 7 installation. I successfully modified boot sector to include VHD file but when I tried to boot from it I got BSOD.

Then I tried another possibility, I installed Windows 2008 R2 to VHD directly from its installation procedure. And it works great! :) Here is procedure on how to do it:

win server08r2/win7都可以安装到vhd格式的虚拟磁盘中。

首先,不能直接在Hyper-V/Virtual PC中做系统然后在真实系统中加载,因为会出现蓝屏(恐怕是驱动的问题)。

所以可以直接通过win server08r2的光盘创建vhd文件并安装到所创建的虚拟磁盘中。

Bare in mind that I already have Windows 7 installed.

  • Physical disk that will hold VHD file must be formatted (does not have to be empty, can not be USB)

  • Boot from Windows Server 2008 R2 DVD

首先必须已经安装了win7.

然后让计算机从win server08r2的光盘启动。

  • When first installation dialog box appears pres SHIFT + F10 to open command prompt

  • Launch diskpart

  • At diskpart prompt enter following command create vdisk file=c:\win2k8r2.vhd type=fixed maximum=20000 (this will create VHD file of 20 GB and it will be fixed size, you can even use expandable as type. You can also change name and location of vdisk file)

  • Next, run select vdisk file=c:\win2k8r2.vhd

  • Run attach vdisk

  • Exit from diskpart and command prompt

当“现在安装”出现的时候按下shift+F10.

会出现命令行。键入:diskpart

然后键入:create vdisk file=d:\win2k8r2.vhd type=fixed maximum=20000
type还可以是expandable. maximum单位是MB.

然后键入:select vdisk file=c:\win2k8r2.vhd

然后键入:attach vdisk

然后两次键入:exit

  • When selecting partition on which to install Windows Server 2008 R2, select newly created and attached VHD partition. Ignore any warnings like "… cannot boot from this partition".

When installation finishes, you will have an option to boot from Windows 7 or Windows 2008 R2 RC. If you want to remove Windows 2008 R2 RC, all you need to do is edit boot menu with bcdedit command and delete or move VHD file.

然后选择“全新安装”,安装位置选择刚刚创建的硬盘。底下会警告说“该分区可能无法启动”,无视之。

然后安装。重启后就会出现双系统选择了。

发表评论