Gernot Walzl

QEMU

QEMU (quick emulator) is a virtualization software to emulate hardware of a computer.

In this tutorial, QEMU 3.1 was used on Debian 10.

Contents

Installation

apt install qemu-system

Image creation

qemu-img create -f qcow2 debian10.qcow2 60G

CLI options

The configuration is specified using command line interface (CLI) options.
There is no configuration file.

Example

qemu-system-x86_64 \ -machine accel=kvm \ -m 2048 \ -cdrom debian-10.0.0-amd64-DVD-1.iso \ -display gtk,gl=on \ -vga virtio \ -soundhw hda \ -nic user,model=e1000 \ debian10.qcow2

KVM

The kernel-based virtual machine (KVM) significantly accelerates the virtualization.
On the host, virtualization support needs to be enabled in BIOS settings.

-machine accel=kvm

RAM size for guest

-m megs

Image to install guest OS

-cdrom file

Video output on host

-display type

typeDescription
gtkDisplay video output in a GTK window
sdlDisplay video output via SDL
vncStart a VNC server
cursesDisplay video output via curses
egl-headlessOffload all OpenGL operations to a local DRI device
noneDo not display video output

Video card for guest

-vga type

typeDescriptionComment
stdStandard VGA card with Bochs VBE extensionsDefault; Works well for Windows XP and Windows 7
cirrusCirrus Logic GD5446 Video card
vmwareVMWare SVGA-II compatible adapter
qxlQXL paravirtual graphic card
virtioVirtio VGA cardNeeded for GL acceleration; Works well for Linux
noneDisable VGA card
GL acceleration

Sound card for guest

-soundhw card

cardDescriptionComment
hdaIntel HD Audio
es1370ENSONIQ AudioPCI ES1370Works well for Windows XP
ac97Intel 82801AA AC97 Audio
cs4231aCS4231A
gusGravis Ultrasound GF1
adlibYamaha YM3812 (OPL2)
sb16Creative Sound Blaster 16
pcspkPC speaker

User-mode network

-nic user

DescriptionIPv4
Guest10.0.2.15
Gateway / DHCP server10.0.2.2
DNS server10.0.2.3
SMB server (optional)10.0.2.4
Restrict network access

-nic user,restrict=on

Share directory via SMB

-nic user,smb=dir

Host port forwarding to guest

-nic user,hostfwd=tcp::hostport-:guestport

Network card for guest

-nic user,model=modelname

modelnameDescriptionComment
e1000Intel Gigabit EthernetDefault
e1000-82544gc
e1000-82545em
e1000e
i82550Intel 8255x 10/100 Mbps Ethernet
i82551
i82557a
i82557b
i82557c
i82558a
i82558b
i82559a
i82559b
i82559c
i82559er
i82562Intel Fast Ethernet Controller
i82801
ne2k_pciNE2000Works well for Windows XP
pcnetAMD Ethernet Card
rocker
rtl8139Realtek Fast EthernetWorks well for Windows 7
virtio-net-pci
vmxnet3

Use image read-only

-snapshot

Key combinations

Ctrl-Alt-gRelease mouse pointer
Ctrl-Alt-fToggle full screen
Ctrl-Alt-uRestore the screen's unscaled size
Ctrl-Alt-2Switch to QEMU console
Ctrl-Alt-1Switch to guest display
CONTENT.html source 2020-06-26 8.7 KB