Virtual PC技巧和硬件辅助虚拟化

I posted a list of tips on Optimizing Performance on Virtual PC a while back, and I'm a big fan of Invirtus VM OptimizerJeff prefers to do the optimizations himself, but the time saved is worth the $70 for a tool like this. With the new Orcas March CTP available as a VM and weighing in at 9 gigs, I need to save all the time I can. Frankly, anything I can do to squeeze performance out of a VM is a good thing.

不久前,我发布了有关在Virtual PC优化性能的提示列表,并且我是Invirtus VM Optimizer忠实拥护者Jeff宁愿自己进行优化,但这样的工具所节省的时间值得花70美元。 随着新的Orcas March CTP可以作为虚拟机使用,并且权重达到9个演出,我需要尽可能地节省时间。 坦白说,我可以采取任何措施来降低VM的性能都是一件好事。

Be sure to check out Tim Sneath's VM Museum - that's where I snarfed the Windows 3.1 VPC picture.

一定要检查一下Tim Sneath的VM博物馆-在那儿我I了Windows 3.1 VPC图片。

  • I always run my VMs on a different spindle:

    我总是在不同的主轴上运行虚拟机:

    • I swear by the WDC My Book drives, I've got two at work that we run VMs on and one at home.

      我对WDC My Book驱动器发誓,我有两个正在运行VM的工作区,一个在家里运行。

  • At work, because we're in banking, virtually EVERYTHING is encrypted. If it's not chained down, it's either encrypted, or encrypting. I use TrueCrypt at the Partition-level with AES on my 500gig drives - the ones I run my VMs on, and you'd think it'd cramp my style, but it's actually not all that bad.

    在工作中,因为我们在银行业,所以几乎所有东西都经过加密。 如果没有链接,则说明已加密或正在加密。 我在500gig驱动器上使用带有AES的分区级别的TrueCrypt-我在其上运行我的VM的驱动器,您会认为这会束缚我的风格,但实际上并没有那么糟糕。

  • I run VM Optimizer (the automated version) on all my drives.

    我在所有驱动器上运行VM Optimizer(自动版本)。
  • I have 4 gigs of RAM on one machine, and 2 gigs on the other...I tend to dedicate between 512M and 768M to my VMs.

    一台机器上有4 GB的RAM,另一台机器上有2 GB的RAM ...我倾向于为我的VM分配512M和768M之间的内存。
  • I run my VMs without swap files if I have dedicated enough RAM to them. 

    如果我有足够的RAM给我的VM运行,而没有交换文件。
  • I always make sure my VM is running the latest version of the Virtual PC Additions.

    我总是确保我的VM正在运行最新版本的Virtual PC Additions。
  • I turn off features I don't need in the VM. Sound and USB support are often the first to go.

    我关闭了虚拟机中不需要的功能。 声音和USB支持通常是第一个。

I run both Virtual PC and Virtual Server on my work machine. Why, you ask? Here's my reasoning, from a very good paper comparing Virtual PC and Virtual Server.

我在工作计算机上同时运行Virtual PCVirtual Server。 你为什么问? 这是我的理由,来自一篇很好的比较Virtual PC和Virtual Server的论文

  • Host multiprocessor support. Virtual Server scales across multiple processors on the host computer—up to 32. Each running virtual machine can take advantage of up to one CPU. For example, on a 32-processor host computer, you could allocate your CPU capacity so that 31 simultaneously running virtual machines would each use up to one CPU, leaving a CPU free for the host operating system.

    主机多处理器支持。 虚拟服务器可在主机上的多个处理器之间扩展,最多可扩展至32个。每个运行的虚拟机最多可利用一个CPU。 例如,在一台具有32个处理器的主机上,您可以分配CPU容量,这样31个同时运行的虚拟机将每个使用多达一个CPU,从而使CPU可以用于主机操作系统。

  • Multithreading. Virtual Server 2005 is a multithreaded application that runs as a system service, with each virtual machine running in its own thread of execution. In contrast, Virtual PC is a single-threaded application in which all simultaneously running virtual machines run on the same processor.

    多线程。 Virtual Server 2005是作为系统服务运行的多线程应用程序,每个虚拟机都在其自己的执行线程中运行。 相反,Virtual PC是单线程应用程序,其中所有同时运行的虚拟机都在同一处理器上运行。

  • Virtual networking. With Virtual Server, you can create an unlimited number of virtual networks, each with its own virtual Dynamic Host Configuration Protocol (DHCP) server. You can also configure Domain Name System (DNS) and Windows Internet Name Service (WINS) servers, Internet Protocol (IP) addresses, and IP address lease time.

    虚拟网络。 使用虚拟服务器,您可以创建无限数量的虚拟网络,每个虚拟网络都具有自己的虚拟动态主机配置协议(DHCP)服务器。 您还可以配置域名系统(DNS)和Windows Internet名称服务(WINS)服务器,Internet协议(IP)地址和IP地址租用时间。

Since I've got a Core Duo machine, this made sense to me. I can dedicate (mostly) a VM to one processor, or more importantly, I can run multiple VMs (often done when doing large demos) and get better performance. When running multiple VMs as a group, you can get better performance by using separate external disks for each VM, and ensuring, if they are USB2, that each disk has its own dedicated USB2 "Root Hub." Avoid during concurrent disk access with two drives on the same USB root hub.

由于我拥有Core Duo机器,因此这对我来说很有意义。 我可以(主要)将一个虚拟机专用于一个处理器,或者更重要的是,我可以运行多个虚拟机(通常在进行大型演示时完成)并获得更好的性能。 以组的形式运行多个VM时,可以通过为每个VM使用单独的外部磁盘并确保每个磁盘具有自己的专用USB2“根集线器”(如果它们是USB2)来获得更好的性能。 在同一USB根集线器上使用两个驱动器进行并发磁盘访问时,避免使用。

Another interesting feature in both Virtual Server 2005 R2 and Virtual PC 2007 is Hardware Assisted Virtualization or VT Technology. You'll need to turn it on in both apps (Here's how to turn on Hardware Virtualization in Virtual Server).

Virtual Server 2005 R2Virtual PC 2007中的另一个有趣的功能是硬件辅助虚拟化或VT技术。 您需要在两个应用程序中都将其打开(这是在Virtual Server中打开硬件虚拟化的方法)。

Note the check box. Here's the trick, though. You not only have to have a CPU that supports this - nearly all newer Intels and AMDs - but often you have to turn it on in the BIOs. My IBM T60 and T60p had this turned OFF by default. Another thing to note is that it's often turned off again after BIOs upgrades. I'm not sure why that is, as it seems harmless, but either way, be aware.

请注意复选框。 不过,这是窍门。 您不仅必须拥有支持此功能的CPU(几乎所有较新的Intel和AMD) ,而且经常需要在BIO中将其打开。 我的IBM T60和T60p默认情况下已关闭此功能。 要注意的另一件事是, BIO升级后通常会再次关闭 我不确定为什么这样做,因为它似乎无害,但无论哪种方式,请注意。

If you're running Intel, refer to this table at Intel to see if your chip supports VT. All the Core Duos support VT except the ones that end in "E" like the Intel Core Duo processor T2300E .

如果您使用的是Intel,请参阅Intel的此表以查看您的芯片是否支持VT 除了像Intel Core Duo处理器T2300E这样的以“ E”结尾的,所有Core Duos都支持VT。

Here's some more details about VT from Intel. Since Operating Systems, by their nature and definition, don't expect to have to share physical resources, they tend to get pissy when asked to. Hardware Virtualization moves a bunch of the "platform management" computational tasks off to the hardware, removing a layer of abstraction. Without hardware help, lots of CPU state information is stored in memory, while with virtualization, it's stored in memory that's dedicated. In a data-center or hosted virtual environment that means that you can't take down the whole "Virtual Farm" by taking down the one VM.

这是有关Intel VT更多详细信息。 由于操作系统就其性质和定义而言,不必期望共享物理资源,因此当被要求时,它们往往会惹怒。 硬件虚拟化将一堆“平台管理”计算任务转移到硬件上,从而消除了抽象层。 在没有硬件帮助的情况下,大量的CPU状态信息存储在内存中,而在虚拟化的情况下,它存储在专用内存中。 在数据中心或托管虚拟环境中,这意味着您无法通过关闭一个VM来关闭整个“虚拟场”。

So, now the real question is, does Hardware Virtualization actually make things faster?

那么,现在真正的问题是,硬件虚拟化实际上会使事情变得更快吗?

Yes, of course it does. But for Windows VMs, it's not like "night and day" different. It's not twice as fast, which some folks feel it should, mostly based on the words "Hardware Assisted" and fueled by past pain of running within a slow VM.

是的,当然可以。 但是对于Windows VM,这并不是“昼夜”的不同。 它的速度并不比某些人感觉的要快两倍,这主要是基于“硬件辅助”一词,并且过去在慢速VM中运行的痛苦加剧了这种情况

Both Virtual PC Guy and John Howard have done some analysis in this area. Before we get to the nitty gritty, let's just drink in these paragraphs from Virtual PC Guy (emphasis mine):

Virtual PC GuyJohn Howard都在这方面做了一些分析。 在深入了解之前,让我们从Virtual PC Guy(重点是我的)中喝下这些段落:

Now - in order to provide improved performance, our Virtual Machine Additions will (on Windows virtual machines) make appropriate changes to the guest operating system such that we can run the virtual machines kernel mode code directly on the processor too (please note that there are some major simplifications in the above statements).

现在-为了提供更高的性能,我们的虚拟机添加项(在Windows虚拟机上)将对来宾操作系统进行适当的更改,以便我们也可以直接在处理器上运行虚拟机内核模式代码(请注意,上述声明中的一些主要简化)。

Hardware virtualization support allows us to run all of the virtual machine code directly on the processor in virtualized mode (with a few edge case exceptions).  So getting back to the original question - what does this all mean for Virtual Server?

硬件虚拟化支持使我们能够在虚拟化模式下(除了少数情况例外)直接在处理器上运行所有虚拟机代码。 回到最初的问题-这对虚拟服务器意味着什么?

Well the first interesting point to make is that it does not make much difference for people running Windows virtual machines with the Virtual Machine Additions installed.  As I mentioned we had already managed to get these virtual machines running almost entirely virtualized (from a processor perspective). 

首先要说的有趣的一点是,对于运行Windows虚拟机并安装了虚拟机附加功能的人们来说,这并没有太大的区别。 如前所述,我们已经设法使这些虚拟机几乎完全虚拟化运行(从处理器的角度来看)。

Basically, this jibes with what I found. It's faster, but it's not like WOW faster when running a tuned VM that has Virtual PC Additions - which is what you should be doing anyway. (Some folks haven't discovered those Additions...make sure you've installed them.)

基本上,这与我所发现的相吻合。 它运行速度更快,但是运行具有Virtual PC Additions的经过调整的VM时,这与WOW速度不一样-无论如何,这是您应该做的。 (有些人尚未发现这些附件...请确保已安装它们。)

That said, John did an install of Windows Server 2003 on two VMs, on with hardware virtualization and one without:

也就是说, John在两台VM上安装了Windows Server 2003,并进行了硬件虚拟化,而其中一台则没有

StepWith Hardware
Assistance
(Seconds)
Without Hardware
Assistance
(Seconds)
Improvement
(Seconds/%)
1: Text Mode Install23633498s=29%
2: Initial GUI Install167287120s=42%
3: GUI Install Completion733985252=26%
4: Boot with additions10144=29%
 * From John Howard's Blog
配硬件帮助(第二) 没有硬件帮助(第二) 改善(秒/%)
1:文本模式安装 236 334 98s = 29%
2:初始GUI安装 167 287 120秒= 42%
3:GUI安装完成 733 985 252 = 26%
4:启动并添加 10 14 4 = 29%
*摘自John Howard的博客

He's got some nice charts to check out as well.

他也有一些不错的图表可以查看

From my point of view, check a box, get 10-30% performance improvement. Seems good to me.

从我的角度来看,选中一个复选框,可以获得10-30%的性能提升。 对我来说似乎很好。

翻译自: https://www.hanselman.com/blog/virtual-pc-tips-and-hardware-assisted-virtualization

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值