How to Use QEMU to Run Linux VMs in Minutes

How to Use QEMU to Run Linux VMs in Minutes If you read my last post, you’ll remember we explored QEMU from a high-level perspective. Today, let’s roll up our sleeves and dive into how you can quickly get a Linux VM up and running using QEMU. We'll cover both graphical and console-based virtual machines, using Kali Linux and Fedora Server as examples. Once QEMU is installed, you can have a fully functional Linux VM within minutes. ✅ Install QEMU if you haven't already. Table of Contents Running Kali Linux with GUI in QEMU QEMU Command Breakdown (Kali) Running Fedora Server in Console Mode QEMU Command Breakdown (Fedora) Why Use QCOW2 Images? Final Thoughts Running Kali Linux with GUI in QEMU Kali Linux is one of the most well-known distributions in the cybersecurity world—loved by blue teamers, pen-testers, and hackers alike. While you might be familiar with the live ISO, there's also a maintained QEMU-ready version of Kali that makes spinning up a VM super easy. Once you've downloaded the QEMU .qcow2 image of Kali, you can launch it with a few simple options. Here's a typical configuration I use for GUI-based Kali setups: 4 GB RAM 2 virtual CPUs Virtual hard drive (QCOW2) NAT networking Virtio networking for better performance Graphical window with visible cursor Custom name: “Kali VM” This setup is ideal for local penetration testing labs or blue team sandboxing. QEMU Command Breakdown (Kali) Run Kali Linux GUI: qemu-system-x86_64 \ -m 4096 \ -smp 2 \ -hda kali-linux-2025.1a-qemu-amd64.qcow2 \ -cpu max \ -display default,show-cursor=on \ -device virtio-net,netdev=net0 -netdev user,id=net0 \ -name "Kali VM" Explanation of Options: qemu-system-x86_64: Launch QEMU for 64-bit x86 systems. -m 4096: Assigns 4 GB of RAM. -smp 2: Enables 2 virtual CPU cores. -hda: Mounts the Kali .qcow2 disk image as the primary drive. -cpu max: Uses all available host CPU features for better guest performance. -display default,show-cursor=on: Opens a graphical window with visible mouse cursor. -device virtio-net,netdev=net0: Adds a fast virtual NIC using virtio. -netdev user,id=net0: Enables NAT (user-mode networking). -name: Gives the VM a name for identification.

Apr 1, 2025 - 19:30
 0
How to Use QEMU to Run Linux VMs in Minutes

How to Use QEMU to Run Linux VMs in Minutes

If you read my last post, you’ll remember we explored QEMU from a high-level perspective. Today, let’s roll up our sleeves and dive into how you can quickly get a Linux VM up and running using QEMU. We'll cover both graphical and console-based virtual machines, using Kali Linux and Fedora Server as examples. Once QEMU is installed, you can have a fully functional Linux VM within minutes.

Install QEMU if you haven't already.

Table of Contents

  1. Running Kali Linux with GUI in QEMU
  2. QEMU Command Breakdown (Kali)
  3. Running Fedora Server in Console Mode
  4. QEMU Command Breakdown (Fedora)
  5. Why Use QCOW2 Images?
  6. Final Thoughts

Running Kali Linux with GUI in QEMU

Kali Linux is one of the most well-known distributions in the cybersecurity world—loved by blue teamers, pen-testers, and hackers alike. While you might be familiar with the live ISO, there's also a maintained QEMU-ready version of Kali that makes spinning up a VM super easy.

Once you've downloaded the QEMU .qcow2 image of Kali, you can launch it with a few simple options. Here's a typical configuration I use for GUI-based Kali setups:

  • 4 GB RAM
  • 2 virtual CPUs
  • Virtual hard drive (QCOW2)
  • NAT networking
  • Virtio networking for better performance
  • Graphical window with visible cursor
  • Custom name: “Kali VM”

This setup is ideal for local penetration testing labs or blue team sandboxing.

QEMU Command Breakdown (Kali)

Run Kali Linux GUI:

qemu-system-x86_64 \
  -m 4096 \
  -smp 2 \
  -hda kali-linux-2025.1a-qemu-amd64.qcow2 \
  -cpu max \
  -display default,show-cursor=on \
  -device virtio-net,netdev=net0 -netdev user,id=net0 \
  -name "Kali VM"

Explanation of Options:

  • qemu-system-x86_64: Launch QEMU for 64-bit x86 systems.
  • -m 4096: Assigns 4 GB of RAM.
  • -smp 2: Enables 2 virtual CPU cores.
  • -hda: Mounts the Kali .qcow2 disk image as the primary drive.
  • -cpu max: Uses all available host CPU features for better guest performance.
  • -display default,show-cursor=on: Opens a graphical window with visible mouse cursor.
  • -device virtio-net,netdev=net0: Adds a fast virtual NIC using virtio.
  • -netdev user,id=net0: Enables NAT (user-mode networking).
  • -name: Gives the VM a name for identification.