QEMU Mini-HOWTO

2011-09-12
by Gernot Walzl

  1. Install QEMU-KVM:
    sbopkg -i qemu-kvm
  2. Add a group kvm to the system:
    groupadd --gid 221 kvm
    Add your user-name to this group by editing
    /etc/group
  3. Virtualization support has to be enabled in BIOS.
    Load kvm module:
    modprobe kvm
    modprobe kvm_intel
  4. Create hard-disk image for qemu:
    qemu-img create -f qcow2 windows.img 10G
    Using qcow2 the image file grows dynamically.
  5. Install any operating system:
    qemu -cdrom /dev/cdrom windows.img
    It is a good idea to restrict network access during installation.
    -net nic -net user,restrict=y
  6. Run the virtual machine:
    qemu windows.img

Sharing data between host and guest OS
QEMU has a SMB server built-in.
-net nic -net user,smb=/home/user/shared
The guest OS can access the given dir with \\10.0.2.4\qemu

Multimedia

Important key combinations

Ctrl-Alt-fswitch to full screen
Ctrl-Alt-uresize window to unscaled screen size
Ctrl-Alt-2show QEMU console
Ctrl-Alt-1back to virtual machine