LinuxCommandLibrary

qemu-system-x86_64

Emulate x86_64 systems with QEMU

TLDR

Boot ISO image
$ qemu-system-x86_64 -cdrom [image.iso] -boot d
copy
Boot disk image
$ qemu-system-x86_64 -hda [disk.qcow2]
copy
Boot with memory and CPU
$ qemu-system-x86_64 -m [2G] -smp [2] -hda [disk.qcow2]
copy
Boot with KVM acceleration
$ qemu-system-x86_64 -enable-kvm -m [4G] -hda [disk.qcow2]
copy
Boot with network
$ qemu-system-x86_64 -hda [disk.qcow2] -nic user,hostfwd=tcp::2222-:22
copy

SYNOPSIS

qemu-system-x86_64 [options] [diskimage_]

DESCRIPTION

qemu-system-x86_64 is a full-system emulator for the x86_64 architecture. It can run complete operating systems including Linux, Windows, and BSD. With KVM hardware acceleration on Linux, it achieves near-native performance.
QEMU emulates CPU, memory, storage, network, and display devices. It supports multiple disk image formats (qcow2, raw, vmdk), various network configurations, and both graphical and serial console output. It is the backend for higher-level virtualization tools like libvirt, virt-manager, and Proxmox.

PARAMETERS

-m size

RAM size (e.g., 2G, 4096M).
-smp cpus
Number of CPUs.
-hda file
Primary hard disk image.
-cdrom file
CD-ROM image.
-boot order
Boot order (c=disk, d=cdrom).
-enable-kvm
Enable KVM acceleration.
-nic options
Network configuration.
-nographic
Disable graphical output.
-vnc display
Enable VNC server.
-cpu model
CPU model to emulate.
-drive options
Define a drive (file, format, if, media).
-serial device
Redirect serial port.

CAVEATS

KVM requires hardware virtualization support (Intel VT-x/AMD-V) and the kvm kernel module. Without KVM, emulation is significantly slower. High memory and CPU allocation may impact the host system.

HISTORY

QEMU was created by Fabrice Bellard and first released in 2003. KVM hardware acceleration was merged into the Linux kernel in 2007, making QEMU the standard userspace component of Linux virtualization.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard