qemu
virtualizationLinux/Unix
The qemu command is one of the most frequently used commands in Linux/Unix-like operating systems. qemu Quick Emulator, a generic machine emulator and virtualizer
Quick Reference
Command Name:
qemu
Category:
virtualization
Platform:
Linux/Unix
Basic Usage:
qemu [options] [arguments]
Common Use Cases
Syntax
qemu-system-[arch] [options] [disk_image]
Options
Option | Description |
---|---|
-hda file |
Use file as the hard disk image |
-cdrom file |
Use file as the CD-ROM image |
-boot [a|c|d|n] |
Boot from floppy (a), hard disk (c), CD-ROM (d), or network (n) |
-m size |
Set the amount of RAM in megabytes |
-smp n |
Set the number of CPU cores |
-enable-kvm |
Enable KVM hardware virtualization |
-vga type |
Select video card type (std, cirrus, vmware, qxl, etc.) |
-netdev type,id=id |
Configure a network backend |
-device driver,netdev=id |
Configure a network device |
-nographic |
Disable graphical output |
-snapshot |
Write to temporary files instead of disk image files |
-monitor dev |
Redirect monitor to a character device |
-cpu model |
Set CPU model |
-usb |
Enable USB driver |
-spice option |
Enable SPICE remote desktop protocol |
Examples
How to Use These Examples
The examples below show common ways to use the qemu
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
qemu-system-x86_64 -hda disk.img -m 2048