qemu-system-i386
Emulate 32-bit x86 hardware
TLDR
Boot from an image emulating the i386 architecture
Boot a QEMU instance from a live ISO image
Boot from a physical device (e.g. from USB to test a bootable medium)
Do not launch a VNC server
Exit non-graphical QEMU
List the supported machine types
SYNOPSIS
qemu-system-i386 [options] [disk_image]
PARAMETERS
-m
Allocates memory_MB megabytes of RAM to the guest system.
-cpu
Specifies the CPU model to emulate, e.g., qemu32 or pentium3.
-smp
Sets the number of virtual CPUs, cores per socket, and threads per core for the guest.
-hda
Attaches file as the primary hard disk image (IDE interface).
-cdrom
Attaches file as a virtual CD-ROM drive.
-boot
Defines the boot device order (e.g., d for CD-ROM, c for hard disk, n for network).
-net nic -net user
Configures a network interface card with user-mode networking (SLIRP), providing NAT-like connectivity.
-display
Selects the display output method (e.g., gtk, sdl, none for no graphical output).
-enable-kvm
Enables Kernel-based Virtual Machine (KVM) acceleration for near-native performance on Linux hosts.
-nographic
Runs QEMU without a graphical output, often used for server VMs with serial console access.
-snapshot
Prevents changes from being written back to the disk image, running from a temporary overlay.
-usb, -usbdevice
Enables USB support for the guest and optionally attaches a specific host USB device.
DESCRIPTION
QEMU, the Quick EMUlator, is a powerful and versatile open-source machine emulator and virtualizer. The qemu-system-i386 command specifically targets the emulation of a 32-bit x86 (i386) computer system. It can run operating systems and programs made for i386 processors on various host architectures, making it invaluable for running legacy software, testing new OS installations, or for cross-development environments where a full 32-bit x86 system is required.
When used on a Linux host with kernel virtualization support (like KVM), qemu-system-i386 can operate in a hardware-accelerated virtualization mode, providing near-native performance. Without KVM, it performs full system emulation, translating CPU instructions on the fly, which is slower but allows running i386 guests on non-x86 hosts. It supports various virtual hardware components including CPUs, memory, disk controllers, network cards, and graphics adapters, offering a comprehensive virtual environment. Its flexibility and open-source nature make it a cornerstone of many virtualization setups.
CAVEATS
While powerful, qemu-system-i386 has some considerations:
1. Performance: Without KVM acceleration, full system emulation can be significantly slower than native execution or hardware-assisted virtualization.
2. Complexity: QEMU offers a vast array of options, which can be daunting for new users. Setting up complex network configurations or device passthrough often requires detailed knowledge.
3. Security: Improper configuration, especially related to networking or device passthrough, can potentially introduce security vulnerabilities to the host system.
4. Resource Usage: Emulating a full system consumes host resources (CPU, RAM, disk I/O), which must be managed carefully, especially when running multiple virtual machines.
NETWORKING MODES
QEMU supports several networking modes, each with different use cases:
User-mode Networking (SLIRP): Simplest to set up using -net user. The guest gets an IP address on a virtual network, and QEMU acts as a NAT gateway. Guests can reach external networks but cannot be easily reached from the outside unless port forwarding is configured.
Bridge Networking: Uses a Linux bridge device (brctl) to connect the guest's virtual network interface directly to the host's physical network. This allows the guest to appear as a separate machine on the LAN, getting its own IP address from the router. Requires more setup but offers full network access.
TAP/TUN Devices: Manual configuration of virtual network interfaces that connect directly to the guest. Used for advanced networking setups, including custom routing and VPNs.
HISTORY
QEMU was originally developed by Fabrice Bellard and first released in 2003. It began as a full-system emulator capable of running ARM binaries on an x86 host, but quickly expanded to support x86 emulation. A significant development was the integration with KVM (Kernel-based Virtual Machine) in 2007, which allowed QEMU to leverage hardware virtualization extensions (Intel VT-x, AMD-V) present in modern CPUs. This transformed QEMU from solely an emulator into a powerful, high-performance hypervisor, widely adopted in both personal and data center environments. The qemu-system-i386 command reflects QEMU's foundational role in emulating 32-bit x86 architectures, which was crucial for its early development and continues to be relevant for legacy systems and specific testing scenarios.
SEE ALSO
qemu-system-x86_64(1): The 64-bit x86 system emulator., qemu-img(1): QEMU disk image utility for creating, converting, and managing disk images., kvm(1): Kernel-based Virtual Machine, the Linux kernel module for virtualization., virsh(1): Command-line interface for managing virtual machines via libvirt., virt-manager(1): Graphical user interface for managing virtual machines.