Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
21.11. KVM Networking Performance
Note
e1000) driver is also supported as an emulated driver choice. To use the e1000 driver, replace virtio in the procedure below with e1000. For the best performance it is recommended to use the virtio driver.
Procedure 21.4. Switching to the virtio driver
- Shutdown the guest operating system.
- Edit the guest's configuration file with the
virshcommand (whereGUESTis the guest's name):virsh edit GUEST
# virsh edit GUESTCopy to Clipboard Copied! Toggle word wrap Toggle overflow Thevirsh editcommand uses the$EDITORshell variable to determine which editor to use. - Find the network interface section of the configuration. This section resembles the snippet below:
<interface type='network'> [output truncated] <model type='rtl8139' /> </interface>
<interface type='network'> [output truncated] <model type='rtl8139' /> </interface>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Change the type attribute of the model element from
'rtl8139'to'virtio'. This will change the driver from the rtl8139 driver to the e1000 driver.<interface type='network'> [output truncated] <model type='virtio' /> </interface>
<interface type='network'> [output truncated] <model type='virtio' /> </interface>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the changes and exit the text editor
- Restart the guest operating system.
Alternatively, new guests can be created with a different network driver. This may be required if you are having difficulty installing guests over a network connection. This method requires you to have at least one guest already created (possibly installed from CD or DVD) to use as a template.
- Create an XML template from an existing guest (in this example, named Guest1):
virsh dumpxml Guest1 > /tmp/guest-template.xml
# virsh dumpxml Guest1 > /tmp/guest-template.xmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy and edit the XML file and update the unique fields: virtual machine name, UUID, disk image, MAC address, and any other unique parameters. Note that you can delete the UUID and MAC address lines and virsh will generate a UUID and MAC address.
cp /tmp/guest-template.xml /tmp/new-guest.xml vi /tmp/new-guest.xml
# cp /tmp/guest-template.xml /tmp/new-guest.xml # vi /tmp/new-guest.xmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the model line in the network interface section:<interface type='network'> [output truncated] <model type='virtio' /> </interface>
<interface type='network'> [output truncated] <model type='virtio' /> </interface>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the new virtual machine:
virsh define /tmp/new-guest.xml virsh start new-guest
# virsh define /tmp/new-guest.xml # virsh start new-guestCopy to Clipboard Copied! Toggle word wrap Toggle overflow