qemu configs | Cell 0 | Cell 2 | Search

The qemu-system-x86_64 command is used to launch a QEMU virtual machine with various settings and devices, including graphics, network, and storage configurations. By combining different options, such as CPU, memory, and device specifications, the command can be customized to create a virtual machine with specific hardware requirements.

Cell 1

qemu-system-x86_64 -vga std -nographic -vnc :1 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
          -machine pc-q35-2.11 \
          -smp 4,cores=2 \
          -usb -device usb-kbd -device usb-tablet \
          -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
          -drive if=pflash,format=raw,readonly,file=OVMF_CODE.fd \
          -drive if=pflash,format=raw,file=OVMF_VARS-1024x768.fd \
          -smbios type=2 \
          -device ich9-intel-hda -device hda-duplex \
          -device ide-drive,bus=ide.2,drive=Clover \
          -drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'Mojave/Clover.qcow2' \
          -device ide-drive,bus=ide.1,drive=MacHDD \
          -drive id=MacHDD,if=none,file=./mac_hdd.img,format=qcow2 \
          -device ide-drive,bus=ide.0,drive=MacDVD \
          -drive id=MacDVD,if=none,snapshot=on,media=cdrom,file=./'Mojave.iso' \
          -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:AB:F8:B7
          
          

What the code could have been:

#!/bin/bash

QEMU_ARGS=(
  # General Options
  "-vga" "std"
  "-nographic"
  "-vnc" ":1"
  "-enable-kvm"
  "-m" "3072"
  "-cpu" "Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS"

  # Machine Options
  "-machine" "pc-q35-2.11"

  # Multiprocessing Options
  "-smp" "4,cores=2"

  # Display and Input Options
  "-usb"
  "-device" "usb-kbd"
  "-device" "usb-tablet"

  # Apple-Specific Options
  "-device" "isa-applesmc,osk=\"ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc\""

  # Firmware Options
  "-drive" "if=pflash,format=raw,readonly,file=OVMF_CODE.fd"
  "-drive" "if=pflash,format=raw,file=OVMF_VARS-1024x768.fd"

  # SMBIOS Options
  "-smbios" "type=2"

  # Audio Options
  "-device" "ich9-intel-hda"
  "-device" "hda-duplex"

  # IDE Drive Options
  "-device" "ide-drive,bus=ide.2,drive=Clover"
  "-drive" "id=Clover,if=none,snapshot=on,format=qcow2,file='./Mojave/Clover.qcow2'"
  "-device" "ide-drive,bus=ide.1,drive=MacHDD"
  "-drive" "id=MacHDD,if=none,file='./mac_hdd.img',format=qcow2"
  "-device" "ide-drive,bus=ide.0,drive=MacDVD"
  "-drive" "id=MacDVD,if=none,snapshot=on,media=cdrom,file='./Mojave.iso'"

  # Networking Options
  "-netdev" "tap,id=net0,ifname=tap0,script=no,downscript=no"
  "-device" "vmxnet3,netdev=net0,id=net0,mac=52:54:00:AB:F8:B7"
)

for arg in "${QEMU_ARGS[@]}"; do
  echo "$arg"
done

QEMU System x86_64 Command

Overview

This command is used to launch a QEMU virtual machine with various settings and devices.

Breakdown

General Options

Virtual Machine Options

Machine Options

Virtual Hardware Options

Apple-Specific Options

Firmware Options

SMBIOS Options

IDE Options

Network Options