wemu-system-aarch64

The command line that builds a machine. It is qemu-system-aarch64's, option for option, with the differences listed here.

wemu-system-aarch64 takes the command line of qemu-system-aarch64. The same line works in a shell and in WEMU.launch(), which accepts it as one string or as an argv array.

wemu-system-aarch64 -M virt -m 1G -kernel vmlinuz-virt -initrd initramfs-virt \
  -append "console=ttyAMA0 root=/dev/vda rw" -drive file=rootfs.img,if=virtio -nographic

Syntax

wemu-system-aarch64 [options] [disk_image]
  • Options are QEMU's: -name value, with sub-options as key=value,key=value. A comma inside a value is written ,,. A bare key means key=on, and a leading bare word fills the option's main key, so -drive disk.img is -drive file=disk.img.
  • --option works the same as -option.
  • A lone argument that isn't an option is a disk image, as -drive file=ARG.
  • Sizes take k, M, G and T suffixes, in powers of 1024. A bare number is MiB for -m and bytes elsewhere.
  • Booleans accept on, yes, true, 1 and off, no, false, 0.
  • An option this machine has no use for, but QEMU users often pass (such as -nodefaults, -object or -global), is accepted with a warning: wemu-system-aarch64: warning: <option>: ignored (no effect on this machine).
  • An option it can't honour is refused in QEMU's wording, prefixed wemu-system-aarch64:, and the command exits with status 1.

Standard options

OptionDescription
-h, -helpPrints a summary of the options and exits.
-versionPrints WEMU emulator version 11.1.50 (warm64 0.1.0) and exits.
-M, -machine [type=]virt[,prop=value…]The board. virt is the only one (virt-X.Y versions are accepted). See Machine properties.
-cpu MODEL[,feature=on|off…]The CPU. See CPU models.
-accel tcgThe only accelerator: the emulated CPU.
-m [size=]SIZEGuest RAM. Default 128M. See Cores and memory for the limits.
-smp [cpus=]NNumber of cores, 1 to 8. Default 1. Without cpus, maxcpus is the count; without either, sockets, cores and threads are multiplied together.
-name [guest=]NAMEA name query-name and info name report.
-uuid UUIDA UUID in 8-4-4-4-12 hex form.

Machine properties

Given as -M virt,PROP=VALUE,… (or -machine):

PropertyValuesDefaultDescription
gic-version2, 3, max, host3The interrupt controller. max and host mean 3.
virtualizationon, offonEL2. With it on, Linux boots at EL2 and runs with VHE.
iommunone, smmuv3noneAn SMMUv3 in front of the devices.
acceltcgtcgAs -accel.

Properties that only matter on real firmware or other boards (acpi, its, highmem, secure, ras, usb and others) are accepted and ignored. So is mte: MTE comes with -cpu max, and mte=on only undoes an earlier -cpu …,mte=off. dumpdtb=FILE is refused when the machine starts (the device tree is handed to the guest, not written out); QMP's and the monitor's dumpdtb write it.

CPU models

cortex-a53, cortex-a55, cortex-a57, cortex-a72, cortex-a76 (the default), neoverse-n1 and max are listed by -cpu help, and any cortex-a*, neoverse-* or a64fx name is accepted. -cpu host is refused: The 'host' CPU type can only be used with KVM or HVF.

  • The guest always sees a Cortex-A76 (r4p1). A model name only decides which optional features are advertised.
  • Every model advertises the Armv8 base, Advanced SIMD, the crypto extension, LSE atomics and BTI.
  • max also advertises pointer authentication, MTE and SVE, which every other name hides.
  • pauth=off, bti=off, mte=off and sve=off hide a feature from max. sme=on|off is accepted too; SME is never advertised, and sme=off hides SVE as sve=off does.
  • sve128 and the other vector lengths, pauth-impdef, pauth-qarma3, lpa2, aarch64, pmu, kvm-* and x-* are accepted and ignored. Any other property is refused with Property '.NAME' not found.
  • SME and 32-bit (AArch32) user programs are implemented but never advertised.

Note feature=on can't reveal a feature a model hides. For pointer authentication, MTE or SVE, use -cpu max.

Boot

OptionDescription
-kernel FILEAn arm64 Linux Image. EFI zboot and gzip-compressed kernels are unpacked.
-initrd FILEAn initial ramdisk (gzip is inflated). Used only with -kernel.
-append CMDLINEThe kernel command line. With -bios, it goes to the firmware loader.
-bios FILEFirmware for QEMU's virt board: U-Boot.
-pflash FILEFlash images: the first is the code, the second the variables. Writes to flash are not saved back to the file.
-boot [order=]…[,menu=on|off]Accepted; has no effect. menu must still be a boolean.
-dtb FILERefused: the machine builds its own device tree from the devices on the command line.

One of -kernel, -bios or -pflash is required, in that order of precedence. With none of them the command fails with nothing to boot: this machine has no ROM of its own (-kernel, -bios or -pflash).

Block devices

-drive

-drive file=IMAGE[,if=virtio|none|pflash][,format=raw][,readonly=on][,snapshot=on][,discard=unmap][,media=cdrom][,id=ID]
Sub-optionDefaultDescription
fileThe image. Required: an empty drive can't be made (create a sparse one with wemu-img create -f raw).
ifvirtiovirtio attaches a virtio disk. none makes a drive for a -device to bind. pflash is flash, as -pflash.
format (or driver)rawThe image format. The Node host opens raw images only; convert others with wemu-img convert -O raw.
readonlyoffRead-only.
snapshotoffKeep the guest's writes in memory and discard them at exit.
discardignoreunmap passes the guest's discards to the host.
mediadiskcdrom makes the drive read-only.
id, index, unitAs in QEMU.

QEMU's tuning keys are accepted and ignored, each with a warning: cache, aio, detect-zeroes, werror, rerror, copy-on-read, bps, iops, throttling.bps-total, serial, cyls, heads, secs, trans, addr, bus, boot, node-name, auto-read-only, force-share and locking. read-only is the same as readonly. Any other key is refused with Invalid parameter 'KEY'.

if=ide, if=scsi, if=sd, if=floppy and if=mtd are refused with machine type does not support if=X,bus=0,unit=0; any other if with unsupported bus type 'X'. discard takes ignore or off, and unmap or on.

-hda, -hdb, -hdc and -hdd are virtio drives 0 to 3, and -cdrom FILE a read-only virtio drive. -snapshot makes every drive snapshot=on. -sd, -fda, -fdb and -mtdblock are refused: the board has no SD, floppy or MTD bus.

The Node command line opens images in place: the guest's writes reach the file as they happen. See Disks and images.

-blockdev

A file node and a format node over it, bound by a -device:

-blockdev driver=file,node-name=f0,filename=disk.img \
-blockdev driver=raw,node-name=d0,file=f0 \
-device virtio-blk-pci,drive=d0
driverNodeTakes
file, host_deviceA filefilename (required), read-only
rawThe format over a file nodefile=NODE, or file.filename=IMAGE for both nodes in one
qcow2, vmdk, vdi, vpc, vhdx, qedAccepted here, then refused when the image is opened: only raw images are opened. Convert with wemu-img convert -O raw.as raw

Every node needs a node-name. Only read-only and discard carry over to the drive. Any other driver is refused with Unknown driver 'X'.

Devices

-device DRIVER[,prop=value…] accepts these drivers. -device help lists them.

KindDriversProperties
Diskvirtio-blk-pci, virtio-blk-device, virtio-blkdrive (required)
Networkvirtio-net-pci, virtio-net-device, virtio-netnetdev (required), mac
Displayvirtio-gpu-pci, virtio-gpu-device, virtio-gpu, virtio-vgaxres, yres (default 1280×800)
3D displayvirtio-gpu-gl-pci, virtio-gpu-gl-device, virtio-gpu-gl, virtio-vga-glas above
Framebufferramfb1024×768; used when there's no GPU
Inputvirtio-keyboard-*, virtio-tablet-*, virtio-mouse-*Any one adds both a keyboard and a tablet.
USB controllerwemu-xhci (also qemu-xhci, nec-usb-xhci), or -usb
USB devicesusb-kbd, usb-tablet, usb-mouse (as a tablet), usb-storageusb-storage needs drive; its writes aren't saved.
Soundvirtio-sound-pci, virtio-sound-device, virtio-snd-pci, intel-hda (with hda-duplex, hda-output or hda-micro)audiodev. intel-hda becomes a virtio sound card.
Shared foldervirtio-9p-pci, virtio-9p-devicefsdev, mount_tag
Shared foldervhost-user-fs-pci, vhost-user-fs-devicetag; no chardev is needed
IOMMUvirtio-iommu-pci, virtio-iommu-deviceBecomes an SMMUv3.

Accepted with no effect: virtio-rng-*, virtio-balloon-*, virtio-serial-*, virtconsole, virtserialport, pcie-root-port, ioh3420, pcie-pci-bridge, pci-bridge, usb-hub, usb-ehci, pci-ohci.

Note PCI or MMIO is chosen for the whole machine. If any device name ends in -pci (or starts with virtio-vga), every virtio disk, network card and shared folder sits behind the PCIe host bridge; otherwise they're virtio-mmio.

Non-virtio network cards (e1000, rtl8139…), IDE, SCSI and NVMe disks, VGA adapters and passthrough devices are refused.

Display

OptionDescription
-display noneNo display.
-display TYPE[,gl=on|off]gtk, sdl, cocoa, default and the other QEMU types all mean the host's display (WEMUHost.display). gl=off keeps 3D rendering in software.
-vga virtioAdds virtio-gpu-pci. -vga none adds nothing.
-nographicNo display. Serial 0 goes to the terminal, shared with the monitor.
-vnc, -spiceRefused: there's no VNC or SPICE server.
-usbAdds the xHCI USB controller.

Note The command line in Node has no window, so -display there only matters to screendump. In a web page, the display is the canvas your host passes in.

Network

OptionDescription
-netdev user,id=ID[,net=][,host=][,dns=][,dhcpstart=]The built-in NAT. The guest is 10.0.2.15, the gateway 10.0.2.2, DNS 10.0.2.3. hostfwd and guestfwd are refused: the guest reaches out, nothing reaches in.
-netdev socket,id=ID,connect=ADDRESSAn Ethernet hub over a WebSocket (ws://…, wss://…, or :PORT for ws://localhost:PORT), such as examples/net/relay-hub.mjs in the repository. It is not QEMU's socket protocol.
-nic [user|socket…][,id=][,model=][,mac=]A netdev and its network card in one option (default virtio-net-pci). id names the netdev (default nicN); the other keys go to the netdev.
-net nic …, -net user …The legacy form.
-nic none, -net noneAccepted. There's no network card unless one is asked for, so they change nothing.

-netdev user also accepts QEMU's restrict, hostname, domainname, ipv4, ipv6, tftp, bootfile, smb and dnssearch, and ignores them with a warning. -netdev socket with listen, mcast, udp or fd is refused: only socket,connect= exists here.

Other backends (tap, bridge, …) are refused: network backend 'X' is not compiled into this binary. See Networking.

Shared folders and sound

OptionDescription
-virtfs local,mount_tag=TAG[,path=…]A 9p shared folder.
-fsdev local,id=ID[,path=…]A 9p share for -device virtio-9p-*,fsdev=ID.
-audiodev DRIVER,id=IDnone drops the sound, wav[,path=FILE] writes it to a WAV file when the machine ends (default wemu.wav), any other driver plays through WEMUHost.audio.
-audio DRIVER[,model=virtio|hda][,path=FILE]A sound card and its backend in one option. path is the WAV file for wav. Without model, only the backend is made.

Warning A share's path= directory isn't mirrored into the guest. The share starts empty and is filled from JavaScript with vm.shares.get(tag).put(). See Shared folders.

Character devices, serial and monitor

OptionDescription
-serial stdio|mon:stdio|file:PATH|chardev:ID|vc|null|noneA serial port; twice at most (ttyAMA0, ttyAMA1). Without -nographic the default is vc, the console your code reads with vm.serial[0]. file: appends. pty, tcp:, unix:, udp:, pipe:, /dev/…, COM…, msmouse and braille are refused: could not connect serial device to character backend 'X'.
-chardev ringbuf,id=ID[,size=]A console kept in memory, read and written with QMP's ringbuf-read and ringbuf-write.
-chardev stdio|file|socket|null,id=IDAccepted, but not connected to anything.
-chardev memory,id=ID[,size=]The same as ringbuf. -chardev pty is refused: a pty cannot be made here.
-monitor stdio|none|chardev:IDThe human monitor on the terminal. chardev:ID is accepted, as with -mon, but not served.
-mon chardev=ID[,mode=readline|control]A monitor on a chardev. Accepted, but only stdio monitors are served.
-qmp unix:PATH,server[,nowait]A QMP server on a Unix socket.
-qmp tcp:[HOST]:PORT,server[,nowait]A QMP server on TCP (default host 127.0.0.1).
-qmp stdioQMP on standard input and output.
-qmp chardev:IDAccepted, then refused when the machine starts in Node: only unix:, tcp: and stdio QMP endpoints exist here.
-qmp-pretty ENDPOINTAs -qmp; replies are not pretty-printed.

With a -qmp server that waits (wait=on, the default without nowait; wait=off is nowait), the machine stays paused until the first client connects.

The terminal

With -nographic or -serial stdio, the terminal is in raw mode and Ctrl+C goes to the guest. Press Ctrl+A, then:

KeyAction
xQuit.
cSwitch between the console and the monitor ((wemu) prompt).
bSend a serial break (magic SysRq).
hList these keys.
Ctrl+ASend a literal Ctrl+A.

Run control

OptionDescription
-SStart paused; cont runs the machine.
-no-rebootA guest reboot shuts the machine down instead.
-no-shutdownA guest power-off pauses the machine instead of exiting.
-action shutdown=poweroff|pauseWhat a guest power-off does. Default poweroff.
-action reboot=reset|shutdownWhat a guest reboot does. Default reset.
-action panic=pause|shutdown|exit-failure|noneWhat a guest panic does. Default pause. exit-failure is the same as shutdown.
-action watchdog=…Accepted and ignored: there's no watchdog.
-rtc base=utc|localtime|DATEThe real-time clock's start. DATE is YYYY-MM-DDThh:mm:ss, in UTC. clock=host|vm|rt is checked and has no effect; driftfix is ignored.
-loadvm TAGStart from a snapshot. See Snapshots.
-incoming file:PATHStart from a state saved with QMP's migrate.
-incoming deferWait for QMP's migrate-incoming.

Options accepted and ignored

These QEMU options are accepted so that existing command lines run, and have no effect here. Each prints wemu-system-aarch64: warning: <option>: ignored (no effect on this machine).

KindOptions
Configuration and objects-object, -global, -set, -readconfig, -writeconfig, -compat, -plugin, -nodefaults, -no-user-config, -nodefconfig, -old-param
Memory and NUMA-numa, -mem-path, -mem-prealloc, -overcommit
Firmware tables-smbios, -acpitable, -fw_cfg, -option-rom, -prom-env, -no-acpi, -no-hpet, -no-fd-bootchk
Logging, tracing and debugging-d, -D, -trace, -dfilter, -icount, -perfmap, -jitdump, -enable-sync-profile, -dump-vmstate, -qtest, -qtest-log, -debugcon, -semihosting, -semihosting-config, -only-migratable
Process and host-pidfile, -runas, -sandbox, -seed, -msg, -L, -k, -add-fd, -run-with, -preconfig, -no-start, -realtime, -tb-size
Display windows-sdl, -curses, -full-screen, -alt-grab, -ctrl-grab, -no-frame, -no-quit, -portrait, -rotate, -show-cursor, -g
Devices QEMU no longer has, or this board doesn't-usbdevice, -parallel, -soundhw, -watchdog, -watchdog-action, -tpmdev, -balloon, -bt, -echr
Clock-startdate, -localtime, -clock, -rtc-td-hack, -win2k-hack
KVM and Xen tuning-no-kvm-pit, -no-kvm-irqchip, -kernel-kqemu, -xen-attach, -xen-domid-restrict

-m maxmem= and -m slots=, -accel properties other than the accelerator's name, and machine properties such as acpi and highmem are ignored the same way.

Options refused

OptionsMessage
-enable-kvm, -no-kvmKVM is not available here (the CPU is emulated, as with -accel tcg)
-gdb, -gdbstub, -s, -singlestepthe gdb stub is not available here
-vnc, -spiceno VNC or SPICE server here; the display is the platform's (-display default: WEMUHost.display) or screendump
-daemonizethis machine is a library object, not a process to daemonize
-shim, -xen-domidXen is not available here
-iscsiiSCSI is not available here (disks are raw images the host opens)
-dtbthis machine builds its own device tree from the devices attached; a -dtb of your own cannot describe them
-sd, -fda, -fdb, -mtdblockmachine type does not support that bus
-chroot, and any option QEMU doesn't haveinvalid option

Exit status

StatusWhen
0quit, Ctrl+A x, the guest powered off, -help, -version.
1The command line was refused, the machine couldn't start, or the guest panicked with -action panic=shutdown.

-M help, -cpu help, -device help and the other help listings print to standard error and exit with status 1.

Differences from QEMU

WEMUQEMU
Default CPUcortex-a76cortex-a15
Default GICversion 3version 2 (up to 8 CPUs)
virtualizationonoff
-action panicpauseshutdown
Most CPUs8512
Disk formatsrawraw, qcow2 and more
AcceleratorsTCG onlyTCG, KVM, HVF…

Also not available: KVM, the gdb stub, VNC and SPICE, hot-plug, block jobs and backing files, migration other than to a file, -dtb, -daemonize, pseudo-terminals, and Xen. QEMU's user-mode emulator (qemu-aarch64) has no WEMU counterpart.

Names differ in one way: where QEMU says qemu, WEMU says wemu (wemu-system-aarch64, wemu-img, the (wemu) prompt, -device wemu-xhci). The qemu spellings are still accepted.

See also