KVM on Debian Sid

To install and run KVM on Debian, follow these steps:

1. Run these commands as root:

The package qemu is only needed for the qemu-img command (see below). The packages kvm-source and module-assistant were needed to create the kernel modules.

Depending on if you are using an AMD or Intel processor, run one of these commands:


2. The installation of kvm created a new system group named kvm in /etc/group. You need to add the user accounts that will run kvm to this group (replace username with the user account name to add):

3. Log out and then login again to acquire the new group added to the account. The following commands can be run with an ordinary user account that is a member of the kvm group.

4. Create a virtual disk image (10 gigabytes in the example, but it is a sparse file and will only take as much space as is actually used, which is 0 at first, as can be seen with the du command: du vdisk.qcow, while ls -l vdisk.qcow shows the sparse file size):

5. Install an operating system. The -m option sets the RAM size for the guest, in megabytes:

6. After installation is complete, run it with:

7. Read the manual page for more information:

In order to set up bridged networking, you could do the following:

8. Run as root:

9. Take down the ethernet interface that you want to use for bridging.

10. Edit /etc/network/interfaces and comment out this interface (${switch}). Make a copy of the configuration, change the name of the interface (to forexample 'br0') and add the lines:

Replace ethx in the above with the value of ${switch}. Make sure it says 'auto br0'.

For example, if your /etc/network/interfaces looked before like:

than afterwards it should look like:

11. Bring up the bridged interface:

At this point, an 'ifconfig -a' should show ${switch} without IP number, and br0 with the IP number that you used to have for ${switch}. Host networking should work again as usual.

12. Boot your guest OS by adding the command line parameters:

If you configure your guest OS with a static IP, use one on the same subnet as the br0 but one that is FREE (ie, for the above example,

Debian (last edited 2007-09-03 11:55:41 by CarloWood)