代码改变世界

[转载] 让VS2010 CTP 运行在Hyper-V 上

2008-11-15 14:58  G yc {Son of VB.NET}  阅读(1493)  评论(1编辑  收藏  举报

不知道有多少人,也在用这个Win2008 自带的虚机的。

在我第一次将VS2010导入的时候,还不能使用, 在我正准备放弃的时候,在国外的Blog上看到了解决方法。 赶紧尝试了一下,也送给需要的朋友。

以下是原文,英文应该不要紧, 有图解的 ^_^。 另外, 提供一个中文语言包的地址http://download.microsoft.com/download/6/2/0/6200e8d9-3942-4ee2-b6f7-8feccb0c6286/6001.18000.080118-1840_x86fre_Server_LP_2-KRMSLP2_DVD.img ,看不习惯 WINDOWS 英文的,可以用这个解决。

 

Converting VS2010 CTP to Hyper-V

It’s been a week since we released (and then re-released) the Visual Studio 2010 and .NET Framework 4.0 CTP to the web and PDC2008 attendees.

The goal of the Community Technology Preview is to obtain feedback from our customers on the new scenarios we have enabled. We have defined step by step walkthroughs to help them discover these new scenarios. You are encouraged to set up the CTP and engage directly in a conversation regarding each walkthrough with the team working on that scenario in a forum thread. You can learn more about the CTP and engage in a conversation with the team from here: http://go.microsoft.com/fwlink/?LinkId=129231

You can download the VPC from here. It’s quite a large download at 7.11GB and I suggest you follow Brian Keller’s post on a more reliable and faster download experience.

The purpose of this post is to show you that it is possible to run the CTP under Hyper-V. This can yield better performance depending on your hardware configuration.

Caveats:

  • This is not an officially tested scenario. Things may or may not work. You’re on your own.
  • Microsoft Excel is immediately crippled to reduced functionality mode. You will need to install your own licensed copy if you want to use it.
  • Microsoft Project remains in countdown mode.

Hardware Recommendations:(推荐配置)

This is my personal setup, and I can say that it runs quite well. Your mileage may vary. Remember that this is a preview release and we’ve not yet gone through a performance optimization phase yet.

  • A host machine running Windows 2008 64-bit with the Hyper-V role installed  (64位的 WINDOWS 2008 + Hyper-V )
  • Host machine with 4Gb RAM, 2Gb dedicated to the virtual machine  (有4G内存)
  • Virtual machine on a second hard-drive. Ideally a high-speed 10K RPM or similar.(独立的高速硬盘)

Summary:

1. Download the CTP and uncompress it

2. Create a new Virtual Machine in Hyper-V Manager

3. Attach the extracted .vhd

4. Boot the virtual machine

5. Uninstall Virtual PC VM Additions by going to Control Panel > Programs and Features

6. Run msconfig.exe and enable ‘Detect HAL’ under Advanced options

7. Reboot

8. Install the Hyper-V Integration Services

9. Reboot

10. Wait for all the new hardware to be detected

11. Reboot

12. Install your own copy of Excel

13. Take a snapshot

14. Enjoy!

Steps:

Once you download the 11 RAR files at 7.11Gb and extract them, you should have two files:

(当你下载完11个RAR文件并解后,你将获得以下个文件)

  1.  
    1.  
      1.  
        1.   VisualStudio2010CTP.vhd (23.0Gb)
        2.   VisualStudio2010CTP.vmc

The first step is to open Hyper-V Manager(Hyper-V 管理器) on Windows 2008 and go to Action(操作) > New(新建) > Virtual Machine(虚拟机)…, you will then be taken through the wizard of setting up a new guest virtual machine.

New HyperV Machine - Location

If you have a second hard-drive, you’ll want to move the .vhd and store the virtual machine on that drive. I recommend something like the WD 10K RPM VelociRaptor.

Although the Virtual PC comes configured for 1Gb of memory, I suggest that you give it at least 2Gb for the best performance. The image contains a 32-bit version of Windows 2008, so giving it more than 3.5Gb is not worthwhile. (2G内存。。。,基本是为了系能。)

New HyperV Machine - Memory

The next screen asks you to configure networking. I strongly suggest that you don’t connect this image to the network. Among other things (Virus protection, etc), if you have two machines on the network with the same machine name (which you cannot change in this CTP), then they will get confused and try and talk to each other.

(网络配置,更具情况自行选择吧)

New HyperV Machine - Networking

Now you need to attach to the existing .vhd that you extracted from the RAR files download.

(附加 你从RAR解压出来的 那个磁盘文件)

New HyperV Machine - Connect VHD

On the summary screen, you’ll want to uncheck ‘Start the virtual machine after it is created’. This is so that we can create an initial snapshot before we’ve done anything to the VHD.

New HyperV Machine - Summary Screen

Once you’ve created a snapshot using Hyper-V Manager and started the VPC, it will look something like this:

VS2010CTP Main Screen

The first step is to open up Control Panel > Programs and Features > Virtual Machine Additions > Uninstall

Control Panel - Remove VM Additions

Before rebooting, we’ll enable the ‘Detect HAL’ option in the boot configuration.This option is necessary, otherwise none of the Hyper-V services will start once they are installed later on. See MSDN: The VMBus device does not load on a virtual machine that is running on a Windows Server 2008-based computer that has Hyper-V installed, for more information.

(这个非常重要,我上次就卡在这里了)

Go to Start > Run > msconfig.exe > Advanced Options… > Detect HAL. Shutdown the virtual machine.

(Optional) Once the virtual machine has shut down, open the Hyper-V session Settings, click ‘Processor’ and change the “Number of logical processors” from 1 to X (where X is the number of cores on your box)

MSConfig - Detect HAL settings

Once you reboot, you will need to install the Hyper-V Integration Services.  To do this, select Action(操作) > Insert Integration Services Setup Disk(插入集成服务安装盘) from the Hyper-V console.

Hyper-V Insert Integration Services Setup Disk

You will be prompted that a previous installation has been detected, press OK.

Hyper-V Integration Services Setup

The installation should proceed. Reboot when the installation is complete.

Hyper-V Integration Services Setup

Once the machine reboots and you logon to it, you should see Windows installing new hardware drivers. Once all these complete, restart the machine.

Windows Device Driver Installation

Once the machine reboots, start Visual Studio and confirm that everything is working and that Team Explorer connects to TFS correctly.

VS2010 Team Explorer

You’ll now need to install your own copy of Excel if you want to use the TFS/office integration components.

If everything seems to be working, create a snapshot of your freshly converted Hyper-V VM. This will allow you to revert back to this snapshot at any time.

Hyper-V Snapshot

If you have any problems with these steps, please leave a comment and/or start a thread on the VS2010 CTP discussion forums.

========================================================

最后说一下。

WIN 2008 X64 默认自带的 Hyper-V 版本比较低, 也没有中文语言。 所以,建议去下载最新的补丁和中文语言包。 (或者,直接用 WINDOWS Update)

Hyper-V

http://download.microsoft.com/download/d/0/f/d0ffe812-9cb5-4fb1-89e2-471642b75a4b/Windows6.0-KB950050-x86.msu

http://download.microsoft.com/download/8/b/f/8bfabc2a-4fa5-4325-8ea7-21d474602293/Windows6.0-KB950050-x64.msu

语言包

http://download.microsoft.com/download/8/c/c/8cc7b354-9c14-4acc-921a-3273ad667f67/Windows6.0-KB951636-x86.msu
http://download.microsoft.com/download/2/7/4/2748315b-4faf-454f-8b12-263acee37c79/Windows6.0-KB951636-x64.msu

 

其他补丁

http://download.microsoft.com/download/b/e/1/be126f0c-742d-4f5c-8dff-a8c70fd706f8/Windows6.0-KB956589-x64.msu
(解决使用系统中心虚拟机管理器 (SCVMM) 管理 Hyper-V 时的潜在问题。)
http://download.microsoft.com/download/8/3/f/83f60fbd-4714-4ee1-88d6-9cb68c67898d/Windows6.0-KB956697-x64.msu 
(解决 Hyper-V 卷影复制服务 (VSS) 无法正确备份虚拟计算机的问题)

http://download.microsoft.com/download/a/5/c/a5c8e6fc-0b9f-436d-9d42-ca903dbde21a/Windows6.0-KB956710-v2-x64.msu
(安装本更新程序可以将 Hyper-V 角色对处理器和虚拟机的支持增强到现在对多达 24 种逻辑处理器和 192 种虚拟机的支持。)

注意,上面这个补丁,将会更新 集成服务 所以,请先安装后, 否则,需要在系统里面在次更新一下。