Ubuntu 12.04 中的 KVM 非常慢

Ubuntu 12.04 中的 KVM 非常慢

我使用 Ubuntu 12.04 64 位和 KVM,我的 CPU 是 Core i5 3.3 GHz,有 8 GB 的 DDR3 RAM。我在 KVM 中运行 Windows 7,速度非常慢。我的同事在相同的 PC 配置上使用 Debian,可以非常快地运行 Windows 7!我的问题可能出在哪里?

sudo cat /etc/libvirt/qemu/windows.xml

<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE 
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit windows
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>windows</name>
  <uuid>5c685175-baea-0ca6-591f-8269d923ffb8</uuid>
  <memory>2097152</memory>
  <currentMemory>2097152</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-1.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/windows.img'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:94:63:91'/>
      <source network='default'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>
    <sound model='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='vga' vram='262144' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

UPD:我在安装 KVM 之前已启用 Intel-VT。我还安装了 VirtIO 驱动程序,因此我的 Windows 7 虚拟机的磁盘如下: KVM 虚拟机管理器的屏幕截图

答案1

根据我的经验,最好使用这些设置(至少对我有用)

type disk = qcow2
cache  = none
i/o mode = native

也许尝试

答案2

在 BIOS 设置中启用 Intel-VT 引擎。

答案3

将 virtio disk1 的“缓存”(将磁盘缓存)更改为 NONE(从默认值)

相关内容