Qemu/KVM Command Line Notes

The executable kvm is an alias for (symbolic link to) qemu-system-x86_64

KVM is the type 1 hypervisor which can be used by QEMU for speed

-accel kvm is the newer way of saying –enable-kvm

CPU host pass-through for speed

-cpu host

Select boot device (c for HDD, d for cd-rom)

-boot d

Attach IDE optical drive (only one allowed, more needs to me mapped with -drive)

-cdrom {iso file or device file}

SPICE (rdp-like protocol to control virtual machine through IP) recommends qxl video driver

-vga qxl

-spice port={default is 3001},password={cannot start with numbers or it’ll be treated as boolean as it’d be interpreted as numeric}

Base HDD/SSD drive: discard=unmap means TRIM for SSD, can add it as a virtio device for speed ONLY AFTER the guest virtio drivers are installed:

-drive file={VHD or drive image file},discard=unmap[,if=virtio]

Speedup by skipping precision clock catchup (HPET)

-no-hpet

Use base=localtime to correct for Linux and Window’s difference in interpreting host RTC’s timezone (Linux assumes that hardware time is UTC+0 while Windows assumed it’s your local time)

-rtc base=localtime,clock=host

Loading