QEMU/Installing QEMU

From Wikibooks, open books for an open world
Jump to: navigation, search

Installing QEMU[edit]

Most GNU/Linux distributions have simple installation processes based on package repositories. It is often best to use the repository approach for installing QEMU, as you can be confident that it will just install and run. Here are some examples:

Distribution Install command
Fedora [1] yum install qemu
Debian [2] apt-get install qemu
SUSE yast -i qemu
Gentoo emerge -av app-emulation/qemu
Mac (Homebrew) brew install qemu

If you can't install QEMU from a package repository, go to the QEMU website and download the latest source code and follow the instructions given.

For Microsoft Windows, you can install a GUI front-end to QEMU called QEMU Manager, or get a vanilla QEMU installer.

QEMU from source[edit]

You might need or prefer to install QEMU by compiling the source code, which is available on the QEMU website. The QEMU Emulator User Documentation has basic instructions on how to compile the source code on Linux and Microsoft Windows.

Installing QEMU-KVM[edit]

QEMU by itself isn't very fast, as it does a lot of emulation even when running on the hardware compatible with the guest operating system. To make it perform better, QEMU has a kernel module called KVM that allows much of the guest OS's code to run directly on the host processor when running on x86 or x86-64 processors with virtualisation extensions under Linux. For example, if the host is x86 Linux and the guest is Windows XP, then KVM can run most of the Windows XP code directly on the processor without emulation.

QEMU-KVM requires a Linux or BSD Unix host, and a CPU with virtualisation extensions -- either Intel VT or AMD-V. To determine whether your CPU has this support on Linux, run the following command from a shell:

egrep '(vmx|svm)' /proc/cpuinfo

If you get nothing back, your CPU does not support the required virtualisation extensions.

Many modern Linux distros have simple installation processes based on package repositories. It is often best to use the repository approach for installing QEMU-KVM, as you can be confident that QEMU-KVM will just install and run. Here are some common Linux distros and their QEMU-KVM install commands:

Distribution Install command
Fedora [1] yum install @virtualization or yum install qemu-kvm
Debian [2] apt-get install kvm
SUSE yast -i kvm

More details are available on the KVM website. If you can't install QEMU-KVM from a package repository, go to the QEMU-KVM website and download the latest source code and follow the instructions given.

Notes[edit]

  1. a b Also valid for other RPM-based distributions (e.g. RedHat, CentOS).
  2. a b Also valid for other dpkg-based distributions (e.g. Ubuntu, Mepis, Mint).