0% found this document useful (0 votes)
91 views5 pages

Discussion:: English

KVM is a full virtualization solution for Linux that allows running virtual machines. It consists of kernel modules and tools for managing VMs. The document discusses installing KVM on Debian, setting up networking, managing VMs from the command line or with a GUI, migrating VMs from other platforms to Debian, and troubleshooting. Installation involves packages like qemu-kvm and libvirt-bin. Networking and storage can use bridges and shared folders. Virtual machines are controlled using tools like virsh and virt-manager.

Uploaded by

Carpe Diem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views5 pages

Discussion:: English

KVM is a full virtualization solution for Linux that allows running virtual machines. It consists of kernel modules and tools for managing VMs. The document discusses installing KVM on Debian, setting up networking, managing VMs from the command line or with a GUI, migrating VMs from other platforms to Debian, and troubleshooting. Installation involves packages like qemu-kvm and libvirt-bin. Networking and storage can use bridges and shared folders. Virtual machines are controlled using tools like virsh and virt-manager.

Uploaded by

Carpe Diem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

KVM - Debian Wiki https://wiki.debian.

org/KVM

Translation(s): English - Espaol - Norsk - Discussion

Contents
1. Introduction

2. Installation

3. Setting up bridge networking

4. Managing VMs from the command-line

5. Managing VMs with a GUI

6. Migrating guests to a Debian host

1. Migrating guests from RHEL/CentOS 5.x

7. Troubleshooting

8. See also

9. External links

Introduction
KVM is a full virtualization solution for Linux on x86 (64-bit
included) hardware containing virtualization extensions (Intel
VT or AMD-V). It consists of a loadable kernel module,
kvm.ko, that provides the core virtualization infrastructure
and a processor specic module, kvm-intel.ko or
kvm-amd.ko.

In Debian, Xen and VirtualBox are alternatives to KVM.

Installation
Install the DebianPkg: qemu-kvm package with
DebianPkg: apt-get or DebianPkg: aptitude, e.g. using this
command:

1 of 5 20/04/14 07:33
KVM - Debian Wiki https://wiki.debian.org/KVM

aptitude install qemu-kvm libvirt-bin

The daemon DebianPkg: libvirt-bin daemon will start


automatically at boot time and load the appropriate kvm
modules, kvm-amd or kvm-intel, which are shipped with the
Linux kernel Debian package. If you intend create VMs from
the command-line, install DebianPkg: virtinst.

In order to be able to manage virtual machines as regular


user you should put this user into the libvirt group:

adduser <youruser> libvirt

Setting up bridge networking


It can be useful to set up a bridge for the KVM VMs as
described here at QEMU page.

Managing VMs from the


command-line
You can then use the DebianMan: virsh(1) command to start
and stop virtual machines. VMs can be generated using
DebianPkg: virtinst. For more details see the libvirt page.
Virtual machines can also be controlled using the kvm
command in a similar fashion to QEMU.

Managing VMs with a GUI


On the other hand, if you want to use a graphical UI to
manage the VMs, you can use the Virtual Machine Manager
DebianPkg: virt-manager.

2 of 5 20/04/14 07:33
KVM - Debian Wiki https://wiki.debian.org/KVM

Migrating guests to a Debian


host
Migrating guests from RHEL/CentOS 5.x

There are a few minor things in guest XML conguration les


(/etc/libvirt/qemu/*.xml you need to modify:

Machine variable in <os> section should say pc, not


rhel5.4.0 or similar
Emulator entry should point to /usr/bin/kvm, not
/usr/libexec/qemu-kvm

In other words, the relevant sections should look something


like this:

<os>

<type arch='x86_64' machine='pc'>hvm</type>

--- snip ---

<devices>

<emulator>/usr/bin/kvm</emulator>

If you had congured a bridge network on the CentOS host,


please refer to this wiki article on how to make it work on
Debian.

Troubleshooting
No network bridge available

virt-manager uses a virtual network for its guests, by default


this is routed to 192.168.122.0/24 and you should see this by

3 of 5 20/04/14 07:33
KVM - Debian Wiki https://wiki.debian.org/KVM

typing ip route as root.

If this route is not present in the kernel routing table then the
guests will fail to connect and you will not be able to
complete a guest creation.

Fixing this is simple, open up virt-manager and go to "Edit"


-> "Host details" -> "Virtual networks" tab. From there you
may create a virtual network of your own or attempt to x
the default one. Usually the problem exists where the default
network is not started.

cannot create bridge 'virbr0': File exists:

To solve this probelm you may remove the virbr0 by running:

brctl delbr virbr0

Open virt-manager and go to "Edit" -> "Host details" ->


"Virtual networks" start the default network.

You can check the netstatus

virsh net-list --all

Optionally, you can use bridge network


BridgeNetworkConnections

See also
libvirt
QEMU

4 of 5 20/04/14 07:33
KVM - Debian Wiki https://wiki.debian.org/KVM

External links
http://www.linux-kvm.org/ - Kernel Based Virtual
Machine homepage;
http://www.linux-kvm.org/page/HOWTO - Howto's
#kvm - IRC channel
http://web.archive.org/web/20080103004709/http:
//kvm.qumranet.com/kvmwiki/Debian - KVM on Debian Sid
(old KVM wiki)

CategorySystemAdministration

5 of 5 20/04/14 07:33

You might also like