设为首页收藏本站

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1116|回复: 0

Install Windows Server 2008 R2 with Hyper-V and Windows 7 on same partition(VHD)

[复制链接]
发表于 2011-12-1 01:02:03 | 显示全部楼层 |阅读模式
本帖最后由 demo 于 2011-12-1 17:05 编辑

Blogger Colin Smith explains how to install Windows Server 2008 R2 with Hyper-V and Windows 7 on the same disk partition by booting from a VHD that contains the entire WS2K8R2 OS within a single, portable file.

Typically, dual-booting multiple operating systems requires repartitioning a disk, which isn’t always desirable, especially if you already have a multi-boot environment with Windows and Linux. What I am proposing is booting from a VHD - a virtual hard disk that contains the entire Windows Server 2008 R2 OS installation within a single, portable file hosted by your Windows 7 file system.

What’s different about this post from the other boot-from-VHD posts out there? Admittedly, I did learn how to create and install into VHD from some of the TechNet posts, but they focus on creating VHDs from within the WinPE console. Unfortunately, most of us work in Windows, not WinPE. So, what I have attempted here is to show you how to create the VHD from Windows 7 (or Windows Server 2008 R2), so that you can create VHDs for other purposes in addition to just an OS install. Additionally, I’ll try to provide some other scenarios where you might want to consider using VHDs.

Why would you want to boot from a VHD?

There are several reasons:
  • There is no requirement to repartition your hard drive, which in itself tends to waste disk space since most partitions are typically over provisioned.
  • It simplifies image management for both VMs and physical systems as the same VHDs can be repurposed for both use cases.
  • You can move the VHD to a Hyper-V server or port it to another virtualization platform like ESX, Virtual Box, Xen , etc., that supports VHDs.
  • The VHD can be configured to be thin provisioned. This means that you can set the maximum size of the VHD and it will appear to the guest OS as a full partition, but in the host OS, it will only consume as much disk space as required to contain the entire guest OS. The VHD will grow in size up to the maximum as blocks are written to (allocate on write).
  • You can remove the entire OS by simply removing a single file and updating your boot menu.
  • It allows you to boot easily from an external device like an eSATA drive (USB or remote storage are not supported for Windows 7 or Windows Server 2008 R2 - Hyper-V Server is supported on USB/Flash )
  • You can easily back up the entire OS as a single file (like you would a VM).
  • You can have versioned OSs using a differencing disk to create a parent child relationship between VHDs. This can be very disk space friendly if you manage many images.
What you’ll need:
Note: In the examples below, I am doing everything on drive C: and assigning drive letter Q: to the VHD but you can use any drive that Windows 7 has available.

Preparing the VHD

First we’ll need to create a VHD on the Windows 7 system using the DISKPART command:
1.       From the Start->All Programs->Accessories right-click the Command Prompt and select “Run as Administrator” - DISKPART will launch and you will be put into the DISKPART CLI shell.
2.       Let’s have a look at what volumes DISKPART can see. Type:
  1. list vol
复制代码


Take note of what you see.
3.       To create a minimal size VHD that can grow to a maximum size of 15000MB type:
  1. create vdisk file=c:\win2k8r2.vhd maximum=15000 type=expandable
复制代码


4.       To set the focus of DISKPART to the newly created VHD type:
  1. select vdisk file=c:\win2k8r2.vhd
复制代码


5.       To attach the virtual disk to the system type:
  1. attach vdisk↵
复制代码


6.       We will need a primary partition within the virtual disk to make the VHD bootable; type:
  1. create partition primary↵
复制代码


7.       Although the partition can be formatted as part of the Windows Server installation, I prefer to do it now. To format the partition with the NTFS file system, type:
  1. format fs=ntfs quick label=”NewVHD”↵
复制代码


8.       We don’t really need to assign a drive letter to the VHD at this point since during the install of Windows Server, it will get a different drive letter anyway, but it makes it more convenient to investigate the VHD from Windows 7. Assign the drive letter Q: to the new partition by typing:
  1. assign letter=q: ↵
复制代码


9.       Let’s have a look at what volumes DISKPART can see now.  Type:
  1. list vol↵
复制代码


You should see the new volume available with a size of 14GB.
10.   To exit the DISKPART shell type:
  1. exit↵
复制代码


11.   To exit the command  shell type:
  1. exit↵
复制代码


12.   Use Windows Explorer to see what size the file c:\win2k8r2 that contains the VHD is. It should be around 80MB. It will grow from here as we add contents to the volume.
13.   For fun use right click Computer from the Start Menu and you should see drive Q: mounted. You can check the properties of drive Q: by right clicking it.

Installing Windows Server

Now we are ready to install Windows Server 2008 R2 onto the newly formatted partition within the VHD. I’ll provide general instructions here, just highlighting the differences from a standard installation.
1.       Boot from the Windows Server 2008 R2 ISO. At the screen that prompts you to select a language press SHIFT+F10 to access the WinPE console.
2.       To launch the DISKPART CLI shell:
  1. diskpart↵
复制代码


3.       Let’s have a look at what volumes DISKPART can see. Type:
  1. list vol↵
复制代码


4.       To set the focus of DISKPART to the previously created VHD, type:
  1. select vdisk file=c:\win2k8r2.vhd↵
复制代码


5.       To attach the virtual disk to the system, type:
  1. attach vdisk↵
复制代码


6.       Let’s have a look at what volumes DISKPART can see. Type:
  1. list vol↵
复制代码


7.       To exit the DISKPART shell, type:
  1. exit↵
复制代码


8.       To exit the WinPE shell, type:
  1. exit↵
复制代码


9.       Return to the Windows Server 2008 R2 setup and select Custom (advanced) as the installation type, not Upgrade.
10.   When prompted for the installation location, select the newly formatted volume that has the label NewVHD.
11.   Perform the remainder of the installation as usual.
12.   When you reboot you will notice that you get a boot menu allowing you to select the OS of your choice. Select Windows Server 2008 R2.
13.   Turn on the Hyper-V role.

Now you have a dual boot Windows 7 and Windows Server 2008 R2 system that can also run the Hyper-V role even though it is not installed in its own partition of a physical disk.

At this point, you could migrate your Windows 7 installation to a VHD so that both of your operating systems are booting from VHDs. If you choose this route, the Disk2vhd tool might prove useful.

You could also use the VHD that you just installed Windows Server into as a Hyper-V (or ESX) virtual machine (you will need to recreate or modify the BCD store first).

By the way, the size of the VHD you created will probably be around 6 GB when viewed from the Windows 7 instance.
Get the PDF version of this tip here.

http://www.techrepublic.com/blog/networking/how-to-install-windows-server-2008-r2-with-hyper-v-and-windows-7-on-the-same-partition/3375


发表于 2012-1-13 04:15:29

HP EliteBook 8440w WZ314UT|share

(reporter zhou xin ) on january 9 this year ,nikon d5000 18-55mm lens, regarding the main teller 80,sony vaio vpcf132fx/b,000 yuan in savings from not far away by a man . yesterday,ibm t420, the beijing police,sony hdr-hc9, jeong had been a suspect was arrested last night ,toshiba m11-s3440, now he has been under criminal detention.

this year at 15 o'clock on january 9 ,hp 4720s, regarding the lord alone in the chaoyang district,sony nw350f/s, 80,asus u45jc-a2b,000 yuan in cash out of a savings bank ,canon vixia hg20, savings bank when he was walking to the opposite side of the road waiting for a taxi ,hp elitebook 8440w wz314ut, a young man suddenly from behind him, snatched the bag containing cash ,toshiba a505, and quickly fled the scene.

victim received the alarm, surrounding the incident to police by a large number of investigations,hp probook 6450b wz305ut, comprehensive use of various means of information technology to detect, lock the incident period of a man had entered the savings jeong . the survey found that chung is one of beijing fengtai district ,apple macbook air fall 2010, 2010 zengyin gambling was detained by the security .

1月10 evening,canon rebel t2i, the task force 's temporary residence in jeong and arrested him. according to jeong account ,asus n73sv-a1, 9 pm see the victim in his savings withdrawals within the spur of the moment after ,asus u30jc-b2b, followed the victim to snatch the purse in their hands . currently, chung has been arrested for the crime of plunder by beijing police in criminal detention.

beijing police said that in order to prevent the people against the bank teller robbery,hp elitebook 2540p xt930ut, snatch cases ,asus k42f-b1, beijing has deployed police and undercover police stepped up patrols around the inspection efforts of banks .

share : welcome to comment to comment
microblogging recommended | today's hot microblogging
related articles:

  
   apple macbook mb467ll/a| name liushun yun
  
   nikon 28-300mm lens|
  
   sony vaio vpcf13yfx/b| he said
  
   hp elitebook 8560p xu063ut| extinguished the fire
  
   asus u53jc-b1|.
支持 反对

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|BC Morning Website ( Best Deal Inc. 001 )  

GMT-8, 2026-2-4 19:02 , Processed in 0.012664 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表