# Quickemu
**Quickly create and run optimised Windows, macOS and Linux virtual machines:**
**Made with 💝 for Fri, 10 Nov 2023 14:49:08 +0000
================================================
FILE: debian/control
================================================
Source: quickemu
Section: utils
Priority: optional
Maintainer: Martin Wimpress
Build-Depends:
debhelper-compat (= 12),
Standards-Version: 4.5.1
Homepage: https://github.com/quickemu-project/quickemu
Vcs-Browser: https://github.com/quickemu-project/quickemu
Vcs-Git: https://github.com/quickemu-project/quickemu.git
Rules-Requires-Root: no
Package: quickemu
Architecture: all
Depends:
coreutils,
curl,
genisoimage,
jq,
mesa-utils,
pciutils,
procps,
python3-minimal,
qemu-system (>= 6.0),
base-files (<< 13~) | qemu-system-modules-spice,
socat,
spice-client-gtk,
swtpm,
usbutils,
util-linux,
uuid-runtime,
x11-xserver-utils,
xdg-user-dirs,
zsync,
${misc:Depends},
${shlibs:Depends},
Suggests:
virt-viewer,
Description: Quickemu creates and runs optimised virtual machines.
Simple script to "manage" Qemu virtual machines. Each virtual machine
configuration is a few lines long requiring minimal setup. The main objective
of the project is to enable quick testing of desktop Linux distributions where
the virtual machines configuration and disk images can be stored anywhere,
such as external USB storage or your home directory. Windows and macOS guests
are also supported.
.
================================================
FILE: debian/copyright
================================================
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: quickemu
Upstream-Contact: Martin Wimpress
Source: https://github.com/quickemu-project/quickemu
Files: *
Copyright: 2020-2024 Martin Wimpress
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2021 - 2024 Martin Wimpress
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
================================================
FILE: debian/install
================================================
chunkcheck usr/bin
quickemu usr/bin
quickget usr/bin
quickreport usr/bin
================================================
FILE: debian/rules
================================================
#!/usr/bin/make -f
%:
dh $@
override_dh_builddeb:
dh_builddeb -- -Zgzip
================================================
FILE: debian/source/format
================================================
3.0 (native)
================================================
FILE: devshell.nix
================================================
{
lib,
mkShell,
pkgs,
stdenv,
OVMF ? null,
OVMFFull ? null,
}:
mkShell {
packages =
with pkgs;
(
[
cdrtools
curl
gawk
gnugrep
gnused
jq
pciutils
procps
python3
qemu_full
samba
socat
spice-gtk
swtpm
unzip
util-linux
xorg.xrandr
zsync
]
++ lib.optionals stdenv.hostPlatform.isLinux [
mesa-demos
usbutils
xdg-user-dirs
]
++ lib.optionals (OVMF != null && OVMFFull != null) [
OVMF
OVMFFull
]
);
inputsFrom = with pkgs; [
git
];
shellHook = ''
echo "**********************************************************************"
echo "* 'direnv reload' to update '.direnv/bin/quickemu' for testing *"
echo "**********************************************************************"
sed \
${
lib.optionalString (OVMF != null && OVMFFull != null) ''
-e '/OVMF_CODE_4M.secboot.fd/s|ovmfs=(|ovmfs=("${OVMFFull.firmware}","${OVMFFull.variablesMs}" |' \
-e '/OVMF_CODE_4M.fd/s|ovmfs=(|ovmfs=("${OVMF.firmware}","${OVMF.variables}" |' \
''
}${lib.optionalString stdenv.hostPlatform.isDarwin ''
-e 's|ovmfs=("[$][{]SHARE_PATH}/OVMF/OVMF_CODE_4M.secboot.fd"|ovmfs=("${pkgs.qemu_full}/share/qemu/edk2-x86_64-secure-code.fd","${pkgs.qemu_full}/share/qemu/edk2-i386-vars.fd" "''${SHARE_PATH}/OVMF/OVMF_CODE_4M.secboot.fd"|' \
-e 's|ovmfs=("[$][{]SHARE_PATH}/OVMF/OVMF_CODE_4M.fd"|ovmfs=("${pkgs.qemu_full}/share/qemu/edk2-x86_64-code.fd","${pkgs.qemu_full}/share/qemu/edk2-i386-vars.fd" "''${SHARE_PATH}/OVMF/OVMF_CODE_4M.fd"|' \
-e 's|ovmfs=("/usr/share/AAVMF/AAVMF_CODE.fd"|ovmfs=("${pkgs.qemu_full}/share/qemu/edk2-aarch64-code.fd","${pkgs.qemu_full}/share/qemu/edk2-arm-vars.fd" "/usr/share/AAVMF/AAVMF_CODE.fd"|' \
''} \
-e '/cp "''${VARS_IN}" "''${VARS_OUT}"/a chmod +w "''${VARS_OUT}"' \
-e 's,\$(command -v smbd),${pkgs.samba}/bin/smbd,' \
quickemu > $PWD/.direnv/bin/quickemu
chmod +x $PWD/.direnv/bin/quickemu
'';
}
================================================
FILE: docs/Makefile
================================================
include pandoc-man.mk
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
datarootdir := $(PREFIX)/share
datadir := $(datarootdir)
mandir := $(datarootdir)/man
bindir := $(PREFIX)/bin
all: quickget.1 quickemu.1 quickemu_conf.5
clean:
rm *.1 *.5
install_docs: all
install -d $(DESTDIR)$(mandir)/man1
install -d $(DESTDIR)$(mandir)/man5
install -m 644 quickget.1 $(DESTDIR)$(mandir)/man1
install -m 644 quickemu.1 $(DESTDIR)$(mandir)/man1
install -m 644 quickemu_conf.5 $(DESTDIR)$(mandir)/man5
rm -f $(DESTDIR)$(mandir)/man1/quickemu_conf.1
# install -m 644 quickgui.1 $(DESTDIR)$(mandir)/man1
install_bins:
install -d $(DESTDIR)$(bindir)
install -m 755 ../quickget $(DESTDIR)$(bindir)
install -m 755 ../quickemu $(DESTDIR)$(bindir)
install -m 755 ../quickreport $(DESTDIR)$(bindir)
install -m 755 ../chunkcheck $(DESTDIR)$(bindir)
install: install_bins install_docs
uninstall::
rm -f $(DESTDIR)$(mandir)/man1/quickget.1
rm -f $(DESTDIR)$(mandir)/man1/quickemu.1
rm -f $(DESTDIR)$(mandir)/man5/quickemu_conf.5
rm -f $(DESTDIR)$(bindir)/quickget
rm -f $(DESTDIR)$(bindir)/quickemu
rm -f $(DESTDIR)$(bindir)/quickreport
rm -f $(DESTDIR)$(bindir)/macrecovery
rm -f $(DESTDIR)$(bindir)/chunkcheck
.PHONY: all
================================================
FILE: docs/pandoc-man.mk
================================================
PANDOC ?= pandoc
PANDOC_OPTIONS = -f gfm+definition_lists
.SUFFIXES: .1.md .1 .5.md .5
.1.md.1 .5.md.5:
$(PANDOC) --standalone $(PANDOC_OPTIONS) --to man -o $@ $<
================================================
FILE: docs/quickemu.1
================================================
.\" Automatically generated by Pandoc 3.8.3
.\"
.TH "QUICKEMU" "1" "February 2, 2026" "quickemu" "Quickemu User Manual"
.SH NAME
quickemu \- A quick VM builder and manager
.SH SYNOPSIS
\f[B]quickemu\f[R] [\f[I]OPTION\f[R]]...
.SH DESCRIPTION
\f[B]quickemu\f[R] will create and run highly optimised desktop virtual
machines for Linux, macOS and Windows
.SH OPTIONS
.TP
\f[B]\-\-vm\f[R]
vm configuration file
.PP
You can also pass optional parameters
.TP
\f[B]\-\-access\f[R]
Enable remote spice access support.
\(aqlocal\(aq (default), \(aqremote\(aq, \(aqclientipaddress\(aq
.TP
\f[B]\-\-braille\f[R]
Enable braille support.
Requires SDL.
.TP
\f[B]\-\-delete\-disk\f[R]
Delete the disk image and EFI variables
.TP
\f[B]\-\-delete\-vm\f[R]
Delete the entire VM and its configuration
.TP
\f[B]\-\-display\f[R]
Select display backend.
\(aqgtk\(aq (default), \(aqsdl\(aq, \(aqcocoa\(aq, \(aqnone\(aq,
\(aqspice\(aq or \(aqspice\-app\(aq
.TP
\f[B]\-\-fullscreen\f[R]
Starts VM in full screen mode (Ctl+Alt+f to exit)
.TP
\f[B]\-\-ignore\-msrs\-always\f[R]
Configure KVM to always ignore unhandled machine\-specific registers
.TP
\f[B]\-\-kill\f[R]
Kill the VM process if it is running
.TP
\f[B]\-\-offline\f[R]
Override all network settings and start the VM offline
.TP
\f[B]\-\-shortcut\f[R]
Create a desktop shortcut
.TP
\f[B]\-\-snapshot apply \f[R]
Apply/restore a snapshot.
.TP
\f[B]\-\-snapshot create \f[R]
Create a snapshot.
.TP
\f[B]\-\-snapshot delete \f[R]
Delete a snapshot.
.TP
\f[B]\-\-snapshot info\f[R]
Show disk/snapshot info.
.TP
\f[B]\-\-status\-quo\f[R]
Do not commit any changes to disk/snapshot.
.TP
\f[B]\-\-viewer \f[R]
Choose an alternative viewer.
\(atOptions: \(aqspicy\(aq (default), \(aqremote\-viewer\(aq,
\(aqnone\(aq
.TP
\f[B]\-\-width \f[R]
Set VM screen width; requires \(aq\-\-height\(aq
.TP
\f[B]\-\-height \f[R]
Set VM screen height; requires \(aq\-\-width\(aq
.TP
\f[B]\-\-ssh\-port \f[R]
Set SSH port manually
.TP
\f[B]\-\-spice\-port \f[R]
Set SPICE port manually
.TP
\f[B]\-\-public\-dir \f[R]
Expose share directory.
\(atOptions: \(aq\(aq (default: xdg\-user\-dir PUBLICSHARE), \(aq\(aq,
\(aqnone\(aq
.TP
\f[B]\-\-monitor \f[R]
Set monitor connection type.
\(atOptions: \(aqsocket\(aq (default), \(aqtelnet\(aq, \(aqnone\(aq
.TP
\f[B]\-\-monitor\-telnet\-host \f[R]
Set telnet host for monitor.
(default: \(aqlocalhost\(aq)
.TP
\f[B]\-\-monitor\-telnet\-port \f[R]
Set telnet port for monitor.
(default: \(aq4440\(aq)
.TP
\f[B]\-\-monitor\-cmd \f[R]
Send command to monitor if available.
(Example: system_powerdown)
.TP
\f[B]\-\-serial \f[R]
Set serial connection type.
\(atOptions: \(aqsocket\(aq (default), \(aqtelnet\(aq, \(aqnone\(aq
.TP
\f[B]\-\-serial\-telnet\-host \f[R]
Set telnet host for serial.
(default: \(aqlocalhost\(aq)
.TP
\f[B]\-\-serial\-telnet\-port \f[R]
Set telnet port for serial.
(default: \(aq6660\(aq)
.TP
\f[B]\-\-keyboard \f[R]
Set keyboard.
\(atOptions: \(aqusb\(aq (default), \(aqps2\(aq, \(aqvirtio\(aq
.TP
\f[B]\-\-keyboard_layout \f[R]
Set keyboard layout: \(aqen\-us\(aq (default)
.TP
\f[B]\-\-mouse \f[R]
Set mouse.
\(atOptions: \(aqtablet\(aq (default), \(aqps2\(aq, \(aqusb\(aq,
\(aqvirtio\(aq
.TP
\f[B]\-\-usb\-controller \f[R]
Set usb\-controller.
\(atOptions: \(aqehci\(aq (default), \(aqxhci\(aq, \(aqnone\(aq
.TP
\f[B]\-\-sound\-card \f[R]
Set sound card.
\(atOptions: \(aqintel\-hda\(aq (default), \(aqac97\(aq, \(aqes1370\(aq,
\(aqsb16\(aq, \(aqnone\(aq
.TP
\f[B]\-\-extra_args \f[R]
Pass additional arguments to qemu
.TP
\f[B]\-\-version\f[R]
Print version
.SH EXAMPLES
.TP
\f[B]quickemu \-\-vm ubuntu\-mate\-22.04.conf\f[R]
Launches the VM specified in the file \f[I]ubuntu\-mate\-22.04.conf\f[R]
.SH Introduction
\f[B]Quickemu\f[R] is a wrapper for the excellent \c
.UR https://www.qemu.org/
QEMU
.UE \c
\ that automatically \f[I]\(dqdoes the right thing\(dq\f[R] when
creating virtual machines.
No requirement for exhaustive configuration options.
You decide what operating system you want to run and Quickemu takes care
of the rest 🤖
.IP \(bu 2
\f[CR]quickget\f[R] \f[B]automatically downloads the upstream OS\f[R]
and creates the configuration 📀
.IP \(bu 2
\f[CR]quickemu\f[R] enumerates your hardware and launches the virtual
machine with the \f[B]optimum configuration best suited to your
computer\f[R] ⚡️
.PP
The original objective of the project was to \c
.UR https://github.com/quickemu-project/quickemu/wiki/02-Create-Linux-virtual-machines
enable quick testing of Linux distributions
.UE \c
\ where the virtual machines and their configuration can be stored
anywhere (such as external USB storage or your home directory) and no
elevated permissions are required to run the virtual machines.
.PP
\f[B]Today, Quickemu includes comprehensive support for \c
.UR https://github.com/quickemu-project/quickemu/wiki/03-Create-macOS-virtual-machines
macOS
.UE \c
, \c
.UR https://github.com/quickemu-project/quickemu/wiki/04-Create-Windows-virtual-machines
Windows
.UE \c
\f[R], most of the BSDs, novel non\-Linux operating systems such as
FreeDOS, Haiku, KolibriOS, OpenIndiana, ReactOS, and more.
.SH Features
.IP \(bu 2
Host support for \f[B]Linux and macOS\f[R]
.IP \(bu 2
\f[B]macOS\f[R] Sequoia, Sonoma, Ventura, Monterey, Big Sur, Catalina &
Mojave
.IP \(bu 2
\f[B]Windows\f[R] 10 and 11 including TPM 2.0
.IP \(bu 2
\f[B]Windows Server\f[R] 2022 2019 2016
.IP \(bu 2
\f[B]ARM64 guest support\f[R] for running aarch64 VMs (native on ARM
hosts, emulated on x86_64)
.IP \(bu 2
\c
.UR https://ubuntu.com/desktop
Ubuntu
.UE \c
\ and all the \f[B]\c
.UR https://ubuntu.com/download/flavours
official Ubuntu flavours
.UE \c
\f[R]
.IP \(bu 2
\f[B]Nearly 1000 operating system editions are supported!\f[R]
.IP \(bu 2
Full SPICE support including host/guest clipboard sharing
.IP \(bu 2
VirtIO\-webdavd file sharing for Linux and Windows guests
.IP \(bu 2
VirtIO\-9p file sharing for Linux and macOS guests
.IP \(bu 2
\c
.UR https://wiki.qemu.org/Features/GuestAgent
QEMU Guest Agent support
.UE \c
; provides access to a system\-level agent via standard QMP commands
.IP \(bu 2
Samba file sharing for Linux, macOS and Windows guests (\f[I]if
\f[CI]smbd\f[I] is installed on the host\f[R])
.IP \(bu 2
VirGL acceleration
.IP \(bu 2
USB device pass\-through
.IP \(bu 2
Smartcard pass\-through
.IP \(bu 2
Automatic SSH port forwarding to guests
.IP \(bu 2
Network port forwarding
.IP \(bu 2
Full duplex audio
.IP \(bu 2
Braille support
.IP \(bu 2
EFI (with or without SecureBoot) and Legacy BIOS boot
.SS As featured on \c
.UR https://linuxmatters.sh
Linux Matters
.UE \c
\ podcast!
The presenters of Linux Matters 🐧🎙️ are the creators of each of the
principal Quickemu projects.
We discussed Quickemu\(aqs 2024 reboot in \c
.UR https://linuxmatters.sh/30
Episode 30 \- Quickemu Rising From the Bashes
.UE \c
\&.
.PP
\ Linux Matters Podcast
.PP
When installing from source, you will need to install the following
requirements manually:
.IP \(bu 2
\c
.UR https://www.qemu.org/
QEMU
.UE \c
\ (\f[I]6.0.0 or newer\f[R]) \f[B]with GTK, SDL, SPICE & VirtFS
support\f[R]
.IP \(bu 2
\c
.UR https://www.gnu.org/software/bash/
bash
.UE \c
\ (\f[I]4.0 or newer\f[R])
.IP \(bu 2
\c
.UR https://www.gnu.org/software/coreutils/
Coreutils
.UE \c
.IP \(bu 2
\c
.UR https://curl.se/
curl
.UE \c
.IP \(bu 2
\c
.UR https://github.com/tianocore/edk2
EDK II
.UE \c
.IP \(bu 2
\c
.UR https://www.gnu.org/software/gawk/
gawk
.UE \c
.IP \(bu 2
\c
.UR https://www.gnu.org/software/grep/
grep
.UE \c
.IP \(bu 2
\c
.UR https://gitlab.freedesktop.org/mesa/demos
glxinfo
.UE \c
.IP \(bu 2
\c
.UR https://stedolan.github.io/jq/
jq
.UE \c
.IP \(bu 2
\c
.UR https://wiki.linuxfoundation.org/lsb/start
LSB
.UE \c
.IP \(bu 2
\c
.UR https://github.com/pciutils/pciutils
pciutils
.UE \c
.IP \(bu 2
\c
.UR https://gitlab.com/procps-ng/procps
procps
.UE \c
.IP \(bu 2
\c
.UR https://www.python.org/
python3
.UE \c
.IP \(bu 2
\c
.UR http://cdrtools.sourceforge.net/private/cdrecord.html
mkisofs
.UE \c
.IP \(bu 2
\c
.UR https://github.com/gregkh/usbutils
usbutils
.UE \c
.IP \(bu 2
\c
.UR https://github.com/karelzak/util-linux
util\-linux
.UE \c
; including \f[CR]uuidgen\f[R]
.IP \(bu 2
\c
.UR https://www.gnu.org/software/sed/
sed
.UE \c
.IP \(bu 2
\c
.UR http://www.dest-unreach.org/socat/
socat
.UE \c
.IP \(bu 2
\c
.UR https://gitlab.freedesktop.org/spice/spice-gtk
spicy
.UE \c
.IP \(bu 2
\c
.UR https://github.com/stefanberger/swtpm
swtpm
.UE \c
.IP \(bu 2
\c
.UR https://www.freedesktop.org/wiki/Software/xdg-user-dirs/
xdg\-user\-dirs
.UE \c
.IP \(bu 2
\c
.UR https://gitlab.freedesktop.org/xorg/app/xrandr
xrandr
.UE \c
.IP \(bu 2
\c
.UR http://zsync.moria.org.uk/
zsync
.UE \c
.IP \(bu 2
\c
.UR http://www.info-zip.org/UnZip.html
unzip
.UE \c
.PP
For Ubuntu, Debian, Fedora, Arch and NixOS hosts the native packaging or
\c
.UR https://launchpad.net/~flexiondotorg/+archive/ubuntu/quickemu
ppa
.UE \c
, \c
.UR https://aur.archlinux.org/packages/quickemu
AUR
.UE \c
\ or \c
.UR https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/quickemu
nix
.UE \c
\ packaging will take care of the dependencies.
For other host distributions or operating systems it will be necessary
to install the above requirements or their equivalents.
.PP
These examples may save a little typing:
.SS Install requirements on Debian hosts
These should be handled by dependencies in Trixie and later.
For earlier versions (and their derivatives):
.IP
.EX
sudo apt\-get install bash coreutils curl genisoimage grep jq mesa\-utils ovmf pciutils procps python3 qemu sed socat spice\-client\-gtk swtpm\-tools unzip usbutils util\-linux xdg\-user\-dirs xrandr zsync
.EE
.SS Install requirements on Fedora hosts
These are handled natively for Fedora 41 on.
For earlier versions:
.IP
.EX
sudo dnf install bash coreutils curl edk2\-tools genisoimage grep jq mesa\-demos pciutils procps python3 qemu sed socat spice\-gtk\-tools swtpm unzip usbutils util\-linux uuidgen\-runtime xdg\-user\-dirs xrandr zsync
.EE
.SS Install requirements on Gentoo
Please note that you may have to use \f[CR]sys\-firmware/edk2\-ovmf\f[R]
instead of \f[CR]sys\-firmware/edk2\-ovmf\-bin\f[R] \- depending on how
your system is configured.
.IP
.EX
sudo emerge \-\-ask \-\-noreplace app\-emulation/qemu \(rs
app\-shells/bash \(rs
sys\-apps/coreutils \(rs
net\-misc/curl \(rs
sys\-firmware/edk2\-ovmf\-bin \(rs
sys\-apps/gawk \(rs
sys\-apps/grep \(rs
x11\-apps/mesa\-progs \(rs
app\-misc/jq \(rs
sys\-apps/pciutils \(rs
sys\-process/procps \(rs
app\-cdr/cdrtools \(rs
sys\-apps/usbutils \(rs
sys\-apps/util\-linux \(rs
sys\-apps/sed \(rs
net\-misc/socat \(rs
app\-emulation/spice \(rs
app\-crypt/swtpm \(rs
x11\-misc/xdg\-user\-dirs \(rs
x11\-apps/xrandr \(rs
net\-misc/zsync \(rs
app\-arch/unzip
.EE
.SS Install requirements on macOS hosts
Install the Quickemu requirements using brew:
.IP
.EX
brew install bash cdrtools coreutils jq python3 qemu usbutils samba socat swtpm zsync
.EE
.PP
Now clone the project:
.IP
.EX
git clone https://github.com/quickemu\-project/quickemu
cd quickemu
.EE
.SS \c
.UR https://github.com/quickemu-project/quickemu/wiki/07-Alternative-frontends
Alternative Frontends
.UE \c
.SS Quickgui
While \f[CR]quickemu\f[R] and \f[CR]quickget\f[R] are designed for the
terminal, a graphical user interface is also available:
.IP \(bu 2
\f[B]\c
.UR https://github.com/quickemu-project/quickgui
Quickgui
.UE \c
\f[R] by \c
.UR https://github.com/marxjohnson
Mark Johnson
.UE \c
\ and \c
.UR https://github.com/ymauray
Yannick Mauray
.UE \c
\&.
.PP
To install Quickgui on Ubuntu:
.IP
.EX
sudo add\-apt\-repository ppa:yannick\-mauray/quickgui
sudo apt update
sudo apt install quickgui
.EE
.PP
Many thanks to \c
.UR https://github.com/Lukewh
Luke Wesley\-Holley
.UE \c
\ and \c
.UR https://github.com/daPhipz
Philipp Kiemle
.UE \c
\ for creating the \f[B]\c
.UR https://github.com/Lukewh/quickemu-icons
Quickemu icons
.UE \c
\f[R] 🎨
.SS Creating Linux guests 🐧
.SS Ubuntu
\f[CR]quickget\f[R] will automatically download an Ubuntu release and
create the virtual machine configuration.
.IP
.EX
quickget ubuntu 22.04
quickemu \-\-vm ubuntu\-22.04.conf
.EE
.IP \(bu 2
Complete the installation as normal.
.IP \(bu 2
Post\-install:
.RS 2
.IP \(bu 2
Install the SPICE agent (\f[CR]spice\-vdagent\f[R]) in the guest to
enable copy/paste and USB redirection
.RS 2
.IP \(bu 2
\f[CR]sudo apt install spice\-vdagent\f[R]
.RE
.IP \(bu 2
Install the SPICE WebDAV agent (\f[CR]spice\-webdavd\f[R]) in the guest
to enable file sharing.
.RS 2
.IP \(bu 2
\f[CR]sudo apt install spice\-webdavd\f[R]
.RE
.RE
.SS Ubuntu daily\-live images
\f[CR]quickget\f[R] can also download/refresh daily\-live images via
\f[CR]zsync\f[R] for Ubuntu developers and testers.
.IP
.EX
quickget ubuntu daily\-live
quickemu \-\-vm ubuntu\-daily\-live.conf
.EE
.PP
You can run \f[CR]quickget ubuntu daily\-live\f[R] to refresh your daily
development image as often as you like, it will even automatically
switch to a new series.
.SS Ubuntu Flavours
All the official Ubuntu flavours are supported, just replace
\f[CR]ubuntu\f[R] with your preferred flavour.
.PP
The project \c
.UR https://github.com/quickemu-project/quickemu/wiki/02-Create-Linux-virtual-machines
wiki
.UE \c
\ may have further information.
.IP \(bu 2
\f[CR]edubuntu\f[R] (Edubuntu)
.IP \(bu 2
\f[CR]kubuntu\f[R] (Kubuntu)
.IP \(bu 2
\f[CR]lubuntu\f[R] (Lubuntu)
.IP \(bu 2
\f[CR]ubuntu\-budgie\f[R] (Ubuntu Budgie)
.IP \(bu 2
\f[CR]ubuntucinnamon\f[R] (Ubuntu Cinnamon)
.IP \(bu 2
\f[CR]ubuntukylin\f[R] (Ubuntu Kylin)
.IP \(bu 2
\f[CR]ubuntu\-mate\f[R] (Ubuntu MATE)
.IP \(bu 2
\f[CR]ubuntu\-server\f[R] (Ubuntu Server)
.IP \(bu 2
\f[CR]ubuntustudio\f[R] (Ubuntu Studio)
.IP \(bu 2
\f[CR]ubuntu\f[R] (Ubuntu)
.IP \(bu 2
\f[CR]ubuntu\-unity\f[R] (Ubuntu Unity)
.IP \(bu 2
\f[CR]xubuntu\f[R] (Xubuntu)
.PP
You can also use \f[CR]quickget\f[R] with advanced options :
.IP
.EX
\-\-arch : Set architecture (arm64, aarch64, amd64, x86_64)
\-\-download [edition] : Download image; no VM configuration
\-\-create\-config [path/url] [flags] : Create VM config for an OS image
\-\-open\-homepage : Open homepage for the OS
\-\-show [os] : Show OS information
\-\-version : Show version
\-\-help : Show this help message
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- Flags \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
\-\-create\-config:
\-\-disable\-unattended : Force quickget not to set up an unattended installation
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- For testing & development \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
\-\-url [os] [release] [edition] : Show image URL(s)
\-\-check [os] [release] [edition] : Check image URL(s)
\-\-check\-all\-arch [os] [release] [edition] : Check downloads for all architectures (amd64 and arm64)
\-\-list : List all supported systems
\-\-list\-csv : List everything in csv format
\-\-list\-json : List everything in json format
.EE
.PP
Here are some typical uses
.IP
.EX
# show an OS ISO download URL for {os} {release} [edition]
quickget \-\-url fedora 38 Silverblue
# test if an OS ISO is available for {os} {release} [edition]
quickget \-\-check nixos unstable plasma5
# open an OS distribution homepage in a browser
quickget \-\-open\-homepage ubuntu\-mate
# Only download image file into current directory, without creating VM
quickget \-\-download elementary 7.1
.EE
.PP
The \f[CR]\-\-url\f[R], \f[CR]\-\-check\f[R], and
\f[CR]\-\-download\f[R] options are fully functional for all operating
systems, including Windows and macOS.
.PP
Further information is available from the project \c
.UR https://github.com/quickemu-project/quickemu/wiki/06-Advanced-quickget-features
wiki
.UE \c
.SS Other Operating Systems
\f[CR]quickget\f[R] also supports:
.IP \(bu 2
\f[CR]alma\f[R] (AlmaLinux)
.IP \(bu 2
\f[CR]alpine\f[R] (Alpine Linux)
.IP \(bu 2
\f[CR]android\f[R] (Android x86)
.IP \(bu 2
\f[CR]antix\f[R] (Antix)
.IP \(bu 2
\f[CR]archcraft\f[R] (Archcraft)
.IP \(bu 2
\f[CR]archlinux\f[R] (Arch Linux)
.IP \(bu 2
\f[CR]artixlinux\f[R] (Artix Linux)
.IP \(bu 2
\f[CR]azurelinux\f[R] (Azure Linux)
.IP \(bu 2
\f[CR]batocera\f[R] (Batocera)
.IP \(bu 2
\f[CR]bazzite\f[R] (Bazzite)
.IP \(bu 2
\f[CR]biglinux\f[R] (BigLinux)
.IP \(bu 2
\f[CR]blendos\f[R] (BlendOS)
.IP \(bu 2
\f[CR]bodhi\f[R] (Bodhi)
.IP \(bu 2
\f[CR]bunsenlabs\f[R] (BunsenLabs)
.IP \(bu 2
\f[CR]cachyos\f[R] (CachyOS)
.IP \(bu 2
\f[CR]centos\-stream\f[R] (CentOS Stream)
.IP \(bu 2
\f[CR]chimeralinux\f[R] (Chimera Linux)
.IP \(bu 2
\f[CR]crunchbang++\f[R] (Crunchbangplusplus)
.IP \(bu 2
\f[CR]debian\f[R] (Debian)
.IP \(bu 2
\f[CR]deepin\f[R] (Deepin)
.IP \(bu 2
\f[CR]devuan\f[R] (Devuan)
.IP \(bu 2
\f[CR]dragonflybsd\f[R] (DragonFlyBSD)
.IP \(bu 2
\f[CR]easyos\f[R] (EasyOS)
.IP \(bu 2
\f[CR]elementary\f[R] (elementary OS)
.IP \(bu 2
\f[CR]endeavouros\f[R] (EndeavourOS)
.IP \(bu 2
\f[CR]endless\f[R] (Endless OS)
.IP \(bu 2
\f[CR]fedora\f[R] (Fedora)
.IP \(bu 2
\f[CR]freebsd\f[R] (FreeBSD)
.IP \(bu 2
\f[CR]freedos\f[R] (FreeDOS)
.IP \(bu 2
\f[CR]garuda\f[R] (Garuda Linux)
.IP \(bu 2
\f[CR]gentoo\f[R] (Gentoo)
.IP \(bu 2
\f[CR]ghostbsd\f[R] (GhostBSD)
.IP \(bu 2
\f[CR]gnomeos\f[R] (GNOME OS)
.IP \(bu 2
\f[CR]guix\f[R] (Guix)
.IP \(bu 2
\f[CR]haiku\f[R] (Haiku)
.IP \(bu 2
\f[CR]kali\f[R] (Kali)
.IP \(bu 2
\f[CR]kdeneon\f[R] (KDE Neon)
.IP \(bu 2
\f[CR]kolibrios\f[R] (KolibriOS)
.IP \(bu 2
\f[CR]linuxlite\f[R] (Linux Lite)
.IP \(bu 2
\f[CR]linuxmint\f[R] (Linux Mint)
.IP \(bu 2
\f[CR]lmde\f[R] (Linux Mint Debian Edition)
.IP \(bu 2
\f[CR]maboxlinux\f[R] (Mabox Linux)
.IP \(bu 2
\f[CR]mageia\f[R] (Mageia)
.IP \(bu 2
\f[CR]manjaro\f[R] (Manjaro)
.IP \(bu 2
\f[CR]mxlinux\f[R] (MX Linux)
.IP \(bu 2
\f[CR]netboot\f[R] (netboot.xyz)
.IP \(bu 2
\f[CR]netbsd\f[R] (NetBSD)
.IP \(bu 2
\f[CR]nitrux\f[R] (Nitrux)
.IP \(bu 2
\f[CR]nixos\f[R] (NixOS)
.IP \(bu 2
\f[CR]nwg\-shell\f[R] (nwg\-shell)
.IP \(bu 2
\f[CR]openbsd\f[R] (OpenBSD)
.IP \(bu 2
\f[CR]openindiana\f[R] (OpenIndiana)
.IP \(bu 2
\f[CR]opensuse\f[R] (openSUSE)
.IP \(bu 2
\f[CR]oraclelinux\f[R] (Oracle Linux)
.IP \(bu 2
\f[CR]parrotsec\f[R] (Parrot Security)
.IP \(bu 2
\f[CR]pclinuxos\f[R] (PCLinuxOS)
.IP \(bu 2
\f[CR]peppermint\f[R] (PeppermintOS)
.IP \(bu 2
\f[CR]popos\f[R] (Pop!_OS)
.IP \(bu 2
\f[CR]porteus\f[R] (Porteus)
.IP \(bu 2
\f[CR]primtux\f[R] (PrimTux)
.IP \(bu 2
\f[CR]proxmox\-ve\f[R] (Proxmox VE)
.IP \(bu 2
\f[CR]pureos\f[R] (PureOS)
.IP \(bu 2
\f[CR]reactos\f[R] (ReactOS)
.IP \(bu 2
\f[CR]rebornos\f[R] (RebornOS)
.IP \(bu 2
\f[CR]rockylinux\f[R] (Rocky Linux)
.IP \(bu 2
\f[CR]siduction\f[R] (Siduction)
.IP \(bu 2
\f[CR]slackware\f[R] (Slackware)
.IP \(bu 2
\f[CR]slax\f[R] (Slax)
.IP \(bu 2
\f[CR]slint\f[R] (Slint)
.IP \(bu 2
\f[CR]slitaz\f[R] (SliTaz)
.IP \(bu 2
\f[CR]solus\f[R] (Solus)
.IP \(bu 2
\f[CR]sparkylinux\f[R] (SparkyLinux)
.IP \(bu 2
\f[CR]spirallinux\f[R] (SpiralLinux)
.IP \(bu 2
\f[CR]tails\f[R] (Tails)
.IP \(bu 2
\f[CR]tinycore\f[R] (Tiny Core Linux)
.IP \(bu 2
\f[CR]trisquel\f[R] (Trisquel)
.IP \(bu 2
\f[CR]tuxedo\-os\f[R] (Tuxedo OS)
.IP \(bu 2
\f[CR]vanillaos\f[R] (Vanilla OS)
.IP \(bu 2
\f[CR]void\f[R] (Void Linux)
.IP \(bu 2
\f[CR]zorin\f[R] (Zorin OS)
.SS \c
.UR https://github.com/quickemu-project/quickemu/wiki/02-Create-Linux-virtual-machines#manually-create-linux-guests
Custom Linux guests
.UE \c
Or you can download a Linux image and manually create a VM
configuration.
.IP \(bu 2
Download a .iso image of a Linux distribution
.IP \(bu 2
Create a VM configuration file; for example
\f[CR]debian\-bullseye.conf\f[R]
.IP
.EX
guest_os=\(dqlinux\(dq
disk_img=\(dqdebian\-bullseye/disk.qcow2\(dq
iso=\(dqdebian\-bullseye/firmware\-11.0.0\-amd64\-DVD\-1.iso\(dq
.EE
.IP \(bu 2
Use \f[CR]quickemu\f[R] to start the virtual machine:
.IP
.EX
quickemu \-\-vm debian\-bullseye.conf
.EE
.IP \(bu 2
Complete the installation as normal.
.IP \(bu 2
Post\-install:
.RS 2
.IP \(bu 2
Install the SPICE agent (\f[CR]spice\-vdagent\f[R]) in the guest to
enable copy/paste and USB redirection.
.IP \(bu 2
Install the SPICE WebDAV agent (\f[CR]spice\-webdavd\f[R]) in the guest
to enable file sharing.
.RE
.SS Supporting old Linux distros
If you want to run an old Linux , from 2016 or earlier, change the
\f[CR]guest_os\f[R] to \f[CR]linux_old\f[R].
This will enable the \f[CR]vmware\-svga\f[R] graphics driver which is
better supported on older distros.
.SS \c
.UR https://github.com/quickemu-project/quickemu/wiki/03-Create-macOS-virtual-machines#automatically-create-macos-guests
Creating macOS Guests
.UE \c
\ 🍏
\f[B]Installing macOS in a VM can be a bit finicky, if you encounter
problems, \c
.UR https://github.com/quickemu-project/quickemu/discussions
check the Discussions
.UE \c
\ for solutions or ask for help there\f[R] 🛟
.PP
\f[CR]quickget\f[R] automatically downloads a macOS recovery image and
creates a virtual machine configuration.
.PP
Note: Some VPN users may need to \c
.UR https://github.com/quickemu-project/quickemu/issues/1391#issuecomment-3506845235
turn off their VPN
.UE \c
\ in order to download a recovery image.
Some other users may find \c
.UR https://github.com/quickemu-project/quickemu/issues/1391#issuecomment-2429146013
using a VPN
.UE \c
\ necessary in order to download a recovery image.
.IP
.EX
quickget macos big\-sur
quickemu \-\-vm macos\-big\-sur.conf
.EE
.PP
macOS \f[CR]mojave\f[R], \f[CR]catalina\f[R], \f[CR]big\-sur\f[R],
\f[CR]monterey\f[R], \f[CR]ventura\f[R] and \f[CR]sonoma\f[R] are
supported.
.IP \(bu 2
Use cursor keys and enter key to select the \f[B]macOS Base System\f[R]
.IP \(bu 2
From \f[B]macOS Utilities\f[R]
.RS 2
.IP \(bu 2
Click \f[B]Disk Utility\f[R] and \f[B]Continue\f[R]
.RS 2
.IP \(bu 2
Select \f[CR]QEMU HARDDISK Media\f[R] (\(ti103.08GB) from the list (on
Big Sur and above use \f[CR]Apple Inc. VirtIO Block Device\f[R]) and
click \f[B]Erase\f[R].
.IP \(bu 2
Enter a \f[CR]Name:\f[R] for the disk
.IP \(bu 2
If you are installing macOS Mojave or later (Catalina, Big Sur,
Monterey, Ventura and Sonoma), choose any of the APFS options as the
filesystem.
MacOS Extended may not work.
.RE
.IP \(bu 2
Click \f[B]Erase\f[R].
.IP \(bu 2
Click \f[B]Done\f[R].
.IP \(bu 2
Close Disk Utility
.RE
.IP \(bu 2
From \f[B]macOS Utilities\f[R]
.RS 2
.IP \(bu 2
Click \f[B]Reinstall macOS\f[R] and \f[B]Continue\f[R]
.RE
.IP \(bu 2
Complete the installation as you normally would.
.RS 2
.IP \(bu 2
On the first reboot use cursor keys and enter key to select \f[B]macOS
Installer\f[R]
.IP \(bu 2
On the subsequent reboots use cursor keys and enter key to select the
disk you named
.RE
.IP \(bu 2
Once you have finished installing macOS you will be presented with an
the out\-of\-the\-box first\-start wizard to configure various options
and set up your username and password
.IP \(bu 2
OPTIONAL: After you have concluded the out\-of\-the\-box wizard, you may
want to enable the TRIM feature that the computer industry created for
SSD disks.
This feature in our macOS installation will allow QuickEmu to compact
(shrink) your macOS disk image whenever you delete files inside the
Virtual Machine.
Without this step your macOS disk image will only ever get larger and
will not shrink even when you delete lots of data inside macOS.
.RS 2
.IP \(bu 2
To enable TRIM, open the Terminal application and type the following
command followed by pressing enter to tell macos to use the TRIM command
on the hard disk when files are deleted:
.RE
.IP
.EX
sudo trimforce enable
.EE
.PP
You will be prompted to enter your account\(aqs password to gain the
privilege needed.
Once you\(aqve entered your password and pressed enter the command will
request confirmation in the form of two questions that require you to
type y (for a \(dqyes\(dq response) followed by enter to confirm.
.PP
If you press enter without first typing y the system will consider that
a negative response as though you said \(dqno\(dq:
.IP
.EX
IMPORTANT NOTICE: This tool force\-enables TRIM for all relevant attached devices, even though such devices may not have been validated for data integrity while using TRIM. Use of this tool to enable TRIM may result in unintended data loss or data corruption. It should not be used in a commercial operating environment or with important data. Before using this tool, you should back up all of your data and regularly back up data while TRIM is enabled. This tool is provided on an \(dqas is\(dq basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON\-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THIS TOOL OR ITS USE ALONE OR IN COMBINATION WITH YOUR DEVICES, SYSTEMS, OR SERVICES. BY USING THIS TOOL TO ENABLE TRIM, YOU AGREE THAT, TO THE EXTENT PERMITTED BY APPLICABLE LAW, USE OF THE TOOL IS AT YOUR SOLE RISK AND THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND EFFORT IS WITH YOU.
Are you sure you with to proceed (y/N)?
.EE
.PP
And a second confirmation once you\(aqve confirmed the previous one:
.IP
.EX
Your system will immediately reboot when this is complete.
Is this OK (y/N)?
.EE
.PP
As the last message states, your system will automatically reboot as
soon as the command completes.
.PP
The default macOS configuration looks like this:
.IP
.EX
guest_os=\(dqmacos\(dq
img=\(dqmacos\-big\-sur/RecoveryImage.img\(dq
disk_img=\(dqmacos\-big\-sur/disk.qcow2\(dq
macos_release=\(dqbig\-sur\(dq
.EE
.IP \(bu 2
\f[CR]guest_os=\(dqmacos\(dq\f[R] instructs Quickemu to optimise for
macOS.
.IP \(bu 2
\f[CR]macos_release=\(dqbig\-sur\(dq\f[R] instructs Quickemu to optimise
for a particular macOS release.
.RS 2
.IP \(bu 2
For example VirtIO Network and Memory Ballooning are available in Big
Sur and newer, but not previous releases.
.IP \(bu 2
And VirtIO Block Media (disks) are supported/stable in Catalina and
newer.
.RE
.SH macOS compatibility
There are some considerations when running macOS via Quickemu.
.IP \(bu 2
Supported macOS releases:
.RS 2
.IP \(bu 2
Mojave
.IP \(bu 2
Catalina
.IP \(bu 2
Big Sur
.IP \(bu 2
Monterey
.IP \(bu 2
Ventura
.IP \(bu 2
Sonoma
.RE
.IP \(bu 2
\f[CR]quickemu\f[R] will automatically download the required \c
.UR https://github.com/acidanthera/OpenCorePkg
OpenCore
.UE \c
\ bootloader and OVMF firmware from \c
.UR https://github.com/kholia/OSX-KVM
OSX\-KVM
.UE \c
\&.
.IP \(bu 2
Optimised by default, but no GPU acceleration is available.
.RS 2
.IP \(bu 2
Host CPU vendor is detected and guest CPU is optimised accordingly.
.IP \(bu 2
\c
.UR https://www.kraxel.org/blog/2019/06/macos-qemu-guest/
VirtIO Block Media
.UE \c
\ is used for the system disk where supported.
.IP \(bu 2
\c
.UR http://philjordan.eu/osx-virt/
VirtIO \f[CR]usb\-tablet\f[R]
.UE \c
\ is used for the mouse.
.IP \(bu 2
VirtIO Network (\f[CR]virtio\-net\f[R]) is supported and enabled on
macOS Big Sur and newer, but earlier releases use \f[CR]vmxnet3\f[R].
.IP \(bu 2
VirtIO Memory Ballooning is supported and enabled on macOS Big Sur and
newer but disabled for other support macOS releases.
.RE
.IP \(bu 2
USB host and SPICE pass\-through is:
.RS 2
.IP \(bu 2
UHCI (USB 2.0) on macOS Catalina and earlier.
.IP \(bu 2
XHCI (USB 3.0) on macOS Big Sur and newer.
.RE
.IP \(bu 2
Display resolution can be changed via \f[CR]quickemu\f[R] using
\f[CR]\-\-width\f[R] and \f[CR]\-\-height\f[R] command line arguments.
.IP \(bu 2
\f[B]Full Duplex audio requires \c
.UR https://github.com/chris1111/VoodooHDA-OC
VoodooHDA OC
.UE \c
\ or pass\-through a USB audio\-device to the macOS guest VM\f[R].
.RS 2
.IP \(bu 2
NOTE!
\c
.UR https://disable-gatekeeper.github.io/
Gatekeeper
.UE \c
\ and \c
.UR https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection
System Integrity Protection (SIP)
.UE \c
\ need to be disabled to install VoodooHDA OC
.RE
.IP \(bu 2
File sharing between guest and host is available via \c
.UR https://wiki.qemu.org/Documentation/9psetup
virtio\-9p
.UE \c
\ and \c
.UR https://gitlab.gnome.org/GNOME/phodav/-/merge_requests/24
SPICE webdavd
.UE \c
\&.
.IP \(bu 2
Copy/paste via SPICE agent is \f[B]not available on macOS\f[R].
.SH macOS App Store
If you see \f[I]\(dqYour device or computer could not be
verified\(dq\f[R] when you try to login to the App Store, make sure that
your wired ethernet device is \f[CR]en0\f[R].
Use \f[CR]ifconfig\f[R] in a terminal to verify this.
.PP
If the wired ethernet device is not \f[CR]en0\f[R], then then go to
\f[I]System Preferences\f[R] \-> \f[I]Network\f[R], delete all the
network devices and apply the changes.
Next, open a terminal and run the following:
.IP
.EX
sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
.EE
.PP
Now reboot, and the App Store should work.
.PP
There may be further advice and information about macOS guests in the
project \c
.UR https://github.com/quickemu-project/quickemu/wiki/03-Create-macOS-virtual-machines#automatically-create-macos-guests
wiki
.UE \c
\&.
.SS \c
.UR https://github.com/quickemu-project/quickemu/wiki/04-Create-Windows-virtual-machines
Creating Windows guests
.UE \c
\ 🪟
\f[CR]quickget\f[R] can download \c
.UR https://www.microsoft.com/software-download/windows10
\f[B]Windows 10\f[R]
.UE \c
\ and \c
.UR https://www.microsoft.com/software-download/windows11
\f[B]Windows 11\f[R]
.UE \c
\ automatically and create an optimised virtual machine configuration.
This configuration also includes the \c
.UR https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/
VirtIO drivers for Windows
.UE \c
\&.
.PP
\f[B]Windows 8.1\f[R] is also supported but doesn\(aqt feature any
automated installation or driver optimisation.
.PP
\f[CR]quickget\f[R] can also download \c
.UR https://www.microsoft.com/en-us/evalcenter/download-windows-10-enterprise
Windows 10 LTSC
.UE \c
\ and Windows Server \c
.UR https://www.microsoft.com/en-us/evalcenter/download-windows-server-2012-r2
2012\-r2
.UE \c
, \c
.UR https://www.microsoft.com/en-us/evalcenter/download-windows-server-2016
2016
.UE \c
, \c
.UR https://www.microsoft.com/en-us/evalcenter/download-windows-server-2019
2019
.UE \c
, and \c
.UR https://www.microsoft.com/en-us/evalcenter/download-windows-server-2022
2022
.UE \c
\&.
No automated installation is supported for these releases.
.IP
.EX
quickget windows 11
quickemu \-\-vm windows\-11.conf
.EE
.IP \(bu 2
Complete the installation as you normally would.
.IP \(bu 2
All relevant drivers and services should be installed automatically.
.IP \(bu 2
A local administrator user account is automatically created, with these
credentials:
.RS 2
.IP \(bu 2
Username: \f[CR]Quickemu\f[R]
.IP \(bu 2
Password: \f[CR]quickemu\f[R]
.RE
.PP
Further information is available from the project \c
.UR https://github.com/quickemu-project/quickemu/wiki/04-Create-Windows-virtual-machines
wiki
.UE \c
.SS Configuration
Here are the usage instructions:
.IP
.EX
Usage
quickemu \-\-vm ubuntu.conf
Arguments
\-\-access : Enable remote spice access support. \(aqlocal\(aq (default), \(aqremote\(aq, \(aqclientipaddress\(aq
\-\-braille : Enable braille support. Requires SDL.
\-\-cpu\-pinning : Choose which host cores correspond to which guest cores.
\-\-delete\-disk : Delete the disk image and EFI variables
\-\-delete\-vm : Delete the entire VM and its configuration
\-\-display : Select display backend. \(aqgtk\(aq (default), \(aqsdl\(aq, \(aqcocoa\(aq, \(aqnone\(aq, \(aqspice\(aq or \(aqspice\-app\(aq
\-\-fullscreen : Starts VM in full screen mode (Ctl+Alt+f to exit)
\-\-ignore\-msrs\-always : Configure KVM to always ignore unhandled machine\-specific registers
\-\-ignore\-tsc\-warning : Skip TSC stability warning for macOS VMs on AMD
\-\-kill : Kill the VM process if it is running
\-\-offline : Override all network settings and start the VM offline
\-\-shortcut : Create a desktop shortcut
\-\-snapshot apply : Apply/restore a snapshot.
\-\-snapshot create : Create a snapshot.
\-\-snapshot delete : Delete a snapshot.
\-\-snapshot info : Show disk/snapshot info.
\-\-status\-quo : Do not commit any changes to disk/snapshot.
\-\-viewer : Choose an alternative viewer. \(atOptions: \(aqspicy\(aq (default), \(aqremote\-viewer\(aq, \(aqnone\(aq
\-\-width : Set VM screen width; requires \(aq\-\-height\(aq
\-\-height : Set VM screen height; requires \(aq\-\-width\(aq
\-\-ssh\-port : Set SSH port manually
\-\-spice\-port : Set SPICE port manually
\-\-public\-dir : Expose share directory. \(atOptions: \(aq\(aq (default: xdg\-user\-dir PUBLICSHARE), \(aq\(aq, \(aqnone\(aq
\-\-monitor : Set monitor connection type. \(atOptions: \(aqsocket\(aq (default), \(aqtelnet\(aq, \(aqnone\(aq
\-\-monitor\-telnet\-host : Set telnet host for monitor. (default: \(aqlocalhost\(aq)
\-\-monitor\-telnet\-port : Set telnet port for monitor. (default: \(aq4440\(aq)
\-\-monitor\-cmd : Send command to monitor if available. (Example: system_powerdown)
\-\-serial : Set serial connection type. \(atOptions: \(aqsocket\(aq (default), \(aqtelnet\(aq, \(aqnone\(aq
\-\-serial\-telnet\-host : Set telnet host for serial. (default: \(aqlocalhost\(aq)
\-\-serial\-telnet\-port : Set telnet port for serial. (default: \(aq6660\(aq)
\-\-keyboard : Set keyboard. \(atOptions: \(aqusb\(aq (default), \(aqps2\(aq, \(aqvirtio\(aq
\-\-keyboard_layout : Set keyboard layout: \(aqen\-us\(aq (default)
\-\-mouse : Set mouse. \(atOptions: \(aqtablet\(aq (default), \(aqps2\(aq, \(aqusb\(aq, \(aqvirtio\(aq
\-\-usb\-controller : Set usb\-controller. \(atOptions: \(aqehci\(aq (default), \(aqxhci\(aq, \(aqnone\(aq
\-\-sound\-card : Set sound card. \(atOptions: \(aqintel\-hda\(aq (default), \(aqac97\(aq, \(aqes1370\(aq, \(aqsb16\(aq, \(aqusb\-audio\(aq, \(aqvirtio\-sound\-pci\(aq, \(aqnone\(aq
\-\-sound\-duplex : Set sound card duplex. \(atOptions: \(aqhda\-micro\(aq (default: speaker/mic), \(aqhda\-duplex\(aq (line\-in/line\-out), \(aqhda\-output\(aq (output\-only)
\-\-extra_args : Pass additional arguments to qemu
\-\-version : Print version
.EE
.SS Desktop shortcuts
Desktop shortcuts can be created for a VM, the shortcuts are saved in
\f[CR]\(ti/.local/share/applications\f[R].
Here is an example of how to create a shortcut.
.IP
.EX
quickemu \-\-vm ubuntu\-22.04\-desktop.conf \-\-shortcut
.EE
.SS References
Useful reference that assisted the development of Quickemu.
.IP \(bu 2
General
.RS 2
.IP \(bu 2
\c
.UR https://qemu.readthedocs.io/en/latest/
QEMU\(aqs documentation!
.UE \c
.IP \(bu 2
\c
.UR https://pve.proxmox.com/wiki/Qemu/KVM_Virtual_Machines
.UE \c
.IP \(bu 2
\c
.UR https://www.kraxel.org/blog/2020/01/qemu-sound-audiodev/
.UE \c
.RE
.IP \(bu 2
macOS
.RS 2
.IP \(bu 2
\c
.UR https://www.nicksherlock.com/2020/06/installing-macos-big-sur-on-proxmox/
.UE \c
.IP \(bu 2
\c
.UR https://passthroughpo.st/mac-os-adds-early-support-for-virtio-qemu/
.UE \c
.IP \(bu 2
\c
.UR https://github.com/kholia/OSX-KVM
.UE \c
.IP \(bu 2
\c
.UR https://github.com/thenickdude/KVM-Opencore
.UE \c
.IP \(bu 2
\c
.UR https://gist.github.com/MCJack123/943eaca762730ca4b7ae460b731b68e7
.UE \c
.IP \(bu 2
\c
.UR https://github.com/acidanthera/OpenCorePkg/tree/master/Utilities/macrecovery
.UE \c
.IP \(bu 2
\c
.UR https://www.kraxel.org/blog/2017/09/running-macos-as-guest-in-kvm/
.UE \c
.IP \(bu 2
\c
.UR https://www.nicksherlock.com/2017/10/passthrough-of-advanced-cpu-features-for-macos-high-sierra-guests/
.UE \c
.IP \(bu 2
\c
.UR http://philjordan.eu/osx-virt/
.UE \c
.IP \(bu 2
\c
.UR https://github.com/Dids/clover-builder
.UE \c
.IP \(bu 2
\c
.UR https://mackie100projects.altervista.org
OpenCore Configurator
.UE \c
.RE
.IP \(bu 2
Windows
.RS 2
.IP \(bu 2
\c
.UR https://www.heiko-sieger.info/running-windows-10-on-linux-using-kvm-with-vga-passthrough/
.UE \c
.IP \(bu 2
\c
.UR https://leduccc.medium.com/improving-the-performance-of-a-windows-10-guest-on-qemu-a5b3f54d9cf5
.UE \c
.IP \(bu 2
\c
.UR https://frontpagelinux.com/tutorials/how-to-use-linux-kvm-to-optimize-your-windows-10-virtual-machine/
.UE \c
.IP \(bu 2
\c
.UR https://turlucode.com/qemu-command-line-args/
.UE \c
.IP \(bu 2
\c
.UR https://github.com/pbatard/Fido
.UE \c
.IP \(bu 2
\c
.UR https://www.catapultsystems.com/blogs/create-zero-touch-windows-10-iso/
.UE \c
.RE
.IP \(bu 2
TPM
.RS 2
.IP \(bu 2
\c
.UR https://qemu-project.gitlab.io/qemu/specs/tpm.html
.UE \c
.IP \(bu 2
\c
.UR https://www.tecklyfe.com/how-to-create-a-windows-11-virtual-machine-in-qemu/
.UE \c
.RE
.IP \(bu 2
9p & virtiofs
.RS 2
.IP \(bu 2
\c
.UR https://wiki.qemu.org/Documentation/9p
.UE \c
.IP \(bu 2
\c
.UR https://wiki.qemu.org/Documentation/9psetup
.UE \c
.IP \(bu 2
\c
.UR https://www.kraxel.org/blog/2019/06/macos-qemu-guest/
.UE \c
.IP \(bu 2
\c
.UR https://superuser.com/questions/628169/how-to-share-a-directory-with-the-host-without-networking-in-qemu
.UE \c
.IP \(bu 2
\c
.UR https://virtio-fs.gitlab.io/
.UE \c
.RE
.SH AUTHORS
Written by Martin Wimpress.
.SH BUGS
Submit bug reports online at: \c
.UR https://github.com/quickemu-project/quickemu/issues
.UE \c
.SH SEE ALSO
Full sources at: \c
.UR https://github.com/quickemu-project/quickemu
.UE \c
.PP
quickemu_conf(5), quickget(1), quickgui(1)
.SH AUTHORS
Martin Wimpress.
================================================
FILE: docs/quickemu.1.md
================================================
---
author: Martin Wimpress
date: February 2, 2026
footer: quickemu
header: Quickemu User Manual
section: 1
title: QUICKEMU
---
# NAME
quickemu - A quick VM builder and manager
# SYNOPSIS
**quickemu** \[*OPTION*\]...
# DESCRIPTION
**quickemu** will create and run highly optimised desktop virtual
machines for Linux, macOS and Windows
# OPTIONS
**--vm**
: vm configuration file
You can also pass optional parameters
**--access**
: Enable remote spice access support. 'local' (default), 'remote',
'clientipaddress'
**--braille**
: Enable braille support. Requires SDL.
**--delete-disk**
: Delete the disk image and EFI variables
**--delete-vm**
: Delete the entire VM and its configuration
**--display**
: Select display backend. 'gtk' (default), 'sdl', 'cocoa', 'none',
'spice' or 'spice-app'
**--fullscreen**
: Starts VM in full screen mode (Ctl+Alt+f to exit)
**--ignore-msrs-always**
: Configure KVM to always ignore unhandled machine-specific registers
**--kill**
: Kill the VM process if it is running
**--offline**
: Override all network settings and start the VM offline
**--shortcut**
: Create a desktop shortcut
**--snapshot apply \**
: Apply/restore a snapshot.
**--snapshot create \**
: Create a snapshot.
**--snapshot delete \**
: Delete a snapshot.
**--snapshot info**
: Show disk/snapshot info.
**--status-quo**
: Do not commit any changes to disk/snapshot.
**--viewer \**
: Choose an alternative viewer. @Options: 'spicy' (default),
'remote-viewer', 'none'
**--width \**
: Set VM screen width; requires '--height'
**--height \**
: Set VM screen height; requires '--width'
**--ssh-port \**
: Set SSH port manually
**--spice-port \**
: Set SPICE port manually
**--public-dir \**
: Expose share directory. @Options: '' (default: xdg-user-dir
PUBLICSHARE), '', 'none'
**--monitor \**
: Set monitor connection type. @Options: 'socket' (default), 'telnet',
'none'
**--monitor-telnet-host \**
: Set telnet host for monitor. (default: 'localhost')
**--monitor-telnet-port \**
: Set telnet port for monitor. (default: '4440')
**--monitor-cmd \**
: Send command to monitor if available. (Example: system_powerdown)
**--serial \**
: Set serial connection type. @Options: 'socket' (default), 'telnet',
'none'
**--serial-telnet-host \**
: Set telnet host for serial. (default: 'localhost')
**--serial-telnet-port \**
: Set telnet port for serial. (default: '6660')
**--keyboard \**
: Set keyboard. @Options: 'usb' (default), 'ps2', 'virtio'
**--keyboard_layout \**
: Set keyboard layout: 'en-us' (default)
**--mouse \**
: Set mouse. @Options: 'tablet' (default), 'ps2', 'usb', 'virtio'
**--usb-controller \**
: Set usb-controller. @Options: 'ehci' (default), 'xhci', 'none'
**--sound-card \**
: Set sound card. @Options: 'intel-hda' (default), 'ac97', 'es1370',
'sb16', 'none'
**--extra_args \**
: Pass additional arguments to qemu
**--version**
: Print version
# EXAMPLES
**quickemu --vm ubuntu-mate-22.04.conf**
: Launches the VM specified in the file *ubuntu-mate-22.04.conf*
# Introduction
**Quickemu** is a wrapper for the excellent
[QEMU](https://www.qemu.org/) that automatically *"does the right
thing"* when creating virtual machines. No requirement for exhaustive
configuration options. You decide what operating system you want to run
and Quickemu takes care of the rest 🤖
- `quickget` **automatically downloads the upstream OS** and creates the
configuration 📀
- `quickemu` enumerates your hardware and launches the virtual machine
with the **optimum configuration best suited to your computer** ⚡️
The original objective of the project was to [enable quick testing of
Linux
distributions](https://github.com/quickemu-project/quickemu/wiki/02-Create-Linux-virtual-machines)
where the virtual machines and their configuration can be stored
anywhere (such as external USB storage or your home directory) and no
elevated permissions are required to run the virtual machines.
**Today, Quickemu includes comprehensive support for
[macOS](https://github.com/quickemu-project/quickemu/wiki/03-Create-macOS-virtual-machines),
[Windows](https://github.com/quickemu-project/quickemu/wiki/04-Create-Windows-virtual-machines)**,
most of the BSDs, novel non-Linux operating systems such as FreeDOS,
Haiku, KolibriOS, OpenIndiana, ReactOS, and more.
# Features
- Host support for **Linux and macOS**
- **macOS** Sequoia, Sonoma, Ventura, Monterey, Big Sur, Catalina &
Mojave
- **Windows** 10 and 11 including TPM 2.0
- **Windows Server** 2022 2019 2016
- **ARM64 guest support** for running aarch64 VMs (native on ARM hosts,
emulated on x86_64)
- [Ubuntu](https://ubuntu.com/desktop) and all the **[official Ubuntu
flavours](https://ubuntu.com/download/flavours)**
- **Nearly 1000 operating system editions are supported!**
- Full SPICE support including host/guest clipboard sharing
- VirtIO-webdavd file sharing for Linux and Windows guests
- VirtIO-9p file sharing for Linux and macOS guests
- [QEMU Guest Agent support](https://wiki.qemu.org/Features/GuestAgent);
provides access to a system-level agent via standard QMP commands
- Samba file sharing for Linux, macOS and Windows guests (*if `smbd` is
installed on the host*)
- VirGL acceleration
- USB device pass-through
- Smartcard pass-through
- Automatic SSH port forwarding to guests
- Network port forwarding
- Full duplex audio
- Braille support
- EFI (with or without SecureBoot) and Legacy BIOS boot
## As featured on [Linux Matters](https://linuxmatters.sh) podcast!
The presenters of Linux Matters 🐧🎙️ are the creators of each of the
principal Quickemu projects. We discussed Quickemu's 2024 reboot in
[Episode 30 - Quickemu Rising From the
Bashes](https://linuxmatters.sh/30).
When installing from source, you will need to install the following
requirements manually:
- [QEMU](https://www.qemu.org/) (*6.0.0 or newer*) **with GTK, SDL,
SPICE & VirtFS support**
- [bash](https://www.gnu.org/software/bash/) (*4.0 or newer*)
- [Coreutils](https://www.gnu.org/software/coreutils/)
- [curl](https://curl.se/)
- [EDK II](https://github.com/tianocore/edk2)
- [gawk](https://www.gnu.org/software/gawk/)
- [grep](https://www.gnu.org/software/grep/)
- [glxinfo](https://gitlab.freedesktop.org/mesa/demos)
- [jq](https://stedolan.github.io/jq/)
- [LSB](https://wiki.linuxfoundation.org/lsb/start)
- [pciutils](https://github.com/pciutils/pciutils)
- [procps](https://gitlab.com/procps-ng/procps)
- [python3](https://www.python.org/)
- [mkisofs](http://cdrtools.sourceforge.net/private/cdrecord.html)
- [usbutils](https://github.com/gregkh/usbutils)
- [util-linux](https://github.com/karelzak/util-linux); including
`uuidgen`
- [sed](https://www.gnu.org/software/sed/)
- [socat](http://www.dest-unreach.org/socat/)
- [spicy](https://gitlab.freedesktop.org/spice/spice-gtk)
- [swtpm](https://github.com/stefanberger/swtpm)
- [xdg-user-dirs](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)
- [xrandr](https://gitlab.freedesktop.org/xorg/app/xrandr)
- [zsync](http://zsync.moria.org.uk/)
- [unzip](http://www.info-zip.org/UnZip.html)
For Ubuntu, Debian, Fedora, Arch and NixOS hosts the native packaging or
[ppa](https://launchpad.net/~flexiondotorg/+archive/ubuntu/quickemu),
[AUR](https://aur.archlinux.org/packages/quickemu) or
[nix](https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/quickemu)
packaging will take care of the dependencies. For other host
distributions or operating systems it will be necessary to install the
above requirements or their equivalents.
These examples may save a little typing:
#### Install requirements on Debian hosts
These should be handled by dependencies in Trixie and later. For earlier
versions (and their derivatives):
``` shell
sudo apt-get install bash coreutils curl genisoimage grep jq mesa-utils ovmf pciutils procps python3 qemu sed socat spice-client-gtk swtpm-tools unzip usbutils util-linux xdg-user-dirs xrandr zsync
```
#### Install requirements on Fedora hosts
These are handled natively for Fedora 41 on. For earlier versions:
``` shell
sudo dnf install bash coreutils curl edk2-tools genisoimage grep jq mesa-demos pciutils procps python3 qemu sed socat spice-gtk-tools swtpm unzip usbutils util-linux uuidgen-runtime xdg-user-dirs xrandr zsync
```
### Install requirements on Gentoo
Please note that you may have to use `sys-firmware/edk2-ovmf` instead of
`sys-firmware/edk2-ovmf-bin` - depending on how your system is
configured.
``` shell
sudo emerge --ask --noreplace app-emulation/qemu \
app-shells/bash \
sys-apps/coreutils \
net-misc/curl \
sys-firmware/edk2-ovmf-bin \
sys-apps/gawk \
sys-apps/grep \
x11-apps/mesa-progs \
app-misc/jq \
sys-apps/pciutils \
sys-process/procps \
app-cdr/cdrtools \
sys-apps/usbutils \
sys-apps/util-linux \
sys-apps/sed \
net-misc/socat \
app-emulation/spice \
app-crypt/swtpm \
x11-misc/xdg-user-dirs \
x11-apps/xrandr \
net-misc/zsync \
app-arch/unzip
```
#### Install requirements on macOS hosts
Install the Quickemu requirements using brew:
``` shell
brew install bash cdrtools coreutils jq python3 qemu usbutils samba socat swtpm zsync
```
Now clone the project:
``` shell
git clone https://github.com/quickemu-project/quickemu
cd quickemu
```
## [Alternative Frontends](https://github.com/quickemu-project/quickemu/wiki/07-Alternative-frontends)
### Quickgui
While `quickemu` and `quickget` are designed for the terminal, a
graphical user interface is also available:
- **[Quickgui](https://github.com/quickemu-project/quickgui)** by [Mark
Johnson](https://github.com/marxjohnson) and [Yannick
Mauray](https://github.com/ymauray).
To install Quickgui on Ubuntu:
``` shell
sudo add-apt-repository ppa:yannick-mauray/quickgui
sudo apt update
sudo apt install quickgui
```
Many thanks to [Luke Wesley-Holley](https://github.com/Lukewh) and
[Philipp Kiemle](https://github.com/daPhipz) for creating the
**[Quickemu icons](https://github.com/Lukewh/quickemu-icons)** 🎨
## Creating Linux guests 🐧
### Ubuntu
`quickget` will automatically download an Ubuntu release and create the
virtual machine configuration.
``` shell
quickget ubuntu 22.04
quickemu --vm ubuntu-22.04.conf
```
- Complete the installation as normal.
- Post-install:
- Install the SPICE agent (`spice-vdagent`) in the guest to enable
copy/paste and USB redirection
- `sudo apt install spice-vdagent`
- Install the SPICE WebDAV agent (`spice-webdavd`) in the guest to
enable file sharing.
- `sudo apt install spice-webdavd`
### Ubuntu daily-live images
`quickget` can also download/refresh daily-live images via `zsync` for
Ubuntu developers and testers.
``` shell
quickget ubuntu daily-live
quickemu --vm ubuntu-daily-live.conf
```
You can run `quickget ubuntu daily-live` to refresh your daily
development image as often as you like, it will even automatically
switch to a new series.
### Ubuntu Flavours
All the official Ubuntu flavours are supported, just replace `ubuntu`
with your preferred flavour.
The project
[wiki](https://github.com/quickemu-project/quickemu/wiki/02-Create-Linux-virtual-machines)
may have further information.
- `edubuntu` (Edubuntu)
- `kubuntu` (Kubuntu)
- `lubuntu` (Lubuntu)
- `ubuntu-budgie` (Ubuntu Budgie)
- `ubuntucinnamon` (Ubuntu Cinnamon)
- `ubuntukylin` (Ubuntu Kylin)
- `ubuntu-mate` (Ubuntu MATE)
- `ubuntu-server` (Ubuntu Server)
- `ubuntustudio` (Ubuntu Studio)
- `ubuntu` (Ubuntu)
- `ubuntu-unity` (Ubuntu Unity)
- `xubuntu` (Xubuntu)
You can also use `quickget` with advanced options :
``` text
--arch : Set architecture (arm64, aarch64, amd64, x86_64)
--download [edition] : Download image; no VM configuration
--create-config [path/url] [flags] : Create VM config for an OS image
--open-homepage : Open homepage for the OS
--show [os] : Show OS information
--version : Show version
--help : Show this help message
------------------------------------ Flags -------------------------------------
--create-config:
--disable-unattended : Force quickget not to set up an unattended installation
-------------------------- For testing & development ---------------------------
--url [os] [release] [edition] : Show image URL(s)
--check [os] [release] [edition] : Check image URL(s)
--check-all-arch [os] [release] [edition] : Check downloads for all architectures (amd64 and arm64)
--list : List all supported systems
--list-csv : List everything in csv format
--list-json : List everything in json format
```
Here are some typical uses
``` shell
# show an OS ISO download URL for {os} {release} [edition]
quickget --url fedora 38 Silverblue
# test if an OS ISO is available for {os} {release} [edition]
quickget --check nixos unstable plasma5
# open an OS distribution homepage in a browser
quickget --open-homepage ubuntu-mate
# Only download image file into current directory, without creating VM
quickget --download elementary 7.1
```
The `--url`, `--check`, and `--download` options are fully functional
for all operating systems, including Windows and macOS.
Further information is available from the project
[wiki](https://github.com/quickemu-project/quickemu/wiki/06-Advanced-quickget-features)
### Other Operating Systems
`quickget` also supports:
- `alma` (AlmaLinux)
- `alpine` (Alpine Linux)
- `android` (Android x86)
- `antix` (Antix)
- `archcraft` (Archcraft)
- `archlinux` (Arch Linux)
- `artixlinux` (Artix Linux)
- `azurelinux` (Azure Linux)
- `batocera` (Batocera)
- `bazzite` (Bazzite)
- `biglinux` (BigLinux)
- `blendos` (BlendOS)
- `bodhi` (Bodhi)
- `bunsenlabs` (BunsenLabs)
- `cachyos` (CachyOS)
- `centos-stream` (CentOS Stream)
- `chimeralinux` (Chimera Linux)
- `crunchbang++` (Crunchbangplusplus)
- `debian` (Debian)
- `deepin` (Deepin)
- `devuan` (Devuan)
- `dragonflybsd` (DragonFlyBSD)
- `easyos` (EasyOS)
- `elementary` (elementary OS)
- `endeavouros` (EndeavourOS)
- `endless` (Endless OS)
- `fedora` (Fedora)
- `freebsd` (FreeBSD)
- `freedos` (FreeDOS)
- `garuda` (Garuda Linux)
- `gentoo` (Gentoo)
- `ghostbsd` (GhostBSD)
- `gnomeos` (GNOME OS)
- `guix` (Guix)
- `haiku` (Haiku)
- `kali` (Kali)
- `kdeneon` (KDE Neon)
- `kolibrios` (KolibriOS)
- `linuxlite` (Linux Lite)
- `linuxmint` (Linux Mint)
- `lmde` (Linux Mint Debian Edition)
- `maboxlinux` (Mabox Linux)
- `mageia` (Mageia)
- `manjaro` (Manjaro)
- `mxlinux` (MX Linux)
- `netboot` (netboot.xyz)
- `netbsd` (NetBSD)
- `nitrux` (Nitrux)
- `nixos` (NixOS)
- `nwg-shell` (nwg-shell)
- `openbsd` (OpenBSD)
- `openindiana` (OpenIndiana)
- `opensuse` (openSUSE)
- `oraclelinux` (Oracle Linux)
- `parrotsec` (Parrot Security)
- `pclinuxos` (PCLinuxOS)
- `peppermint` (PeppermintOS)
- `popos` (Pop!\_OS)
- `porteus` (Porteus)
- `primtux` (PrimTux)
- `proxmox-ve` (Proxmox VE)
- `pureos` (PureOS)
- `reactos` (ReactOS)
- `rebornos` (RebornOS)
- `rockylinux` (Rocky Linux)
- `siduction` (Siduction)
- `slackware` (Slackware)
- `slax` (Slax)
- `slint` (Slint)
- `slitaz` (SliTaz)
- `solus` (Solus)
- `sparkylinux` (SparkyLinux)
- `spirallinux` (SpiralLinux)
- `tails` (Tails)
- `tinycore` (Tiny Core Linux)
- `trisquel` (Trisquel)
- `tuxedo-os` (Tuxedo OS)
- `vanillaos` (Vanilla OS)
- `void` (Void Linux)
- `zorin` (Zorin OS)
### [Custom Linux guests](https://github.com/quickemu-project/quickemu/wiki/02-Create-Linux-virtual-machines#manually-create-linux-guests)
Or you can download a Linux image and manually create a VM
configuration.
- Download a .iso image of a Linux distribution
- Create a VM configuration file; for example `debian-bullseye.conf`
``` shell
guest_os="linux"
disk_img="debian-bullseye/disk.qcow2"
iso="debian-bullseye/firmware-11.0.0-amd64-DVD-1.iso"
```
- Use `quickemu` to start the virtual machine:
``` shell
quickemu --vm debian-bullseye.conf
```
- Complete the installation as normal.
- Post-install:
- Install the SPICE agent (`spice-vdagent`) in the guest to enable
copy/paste and USB redirection.
- Install the SPICE WebDAV agent (`spice-webdavd`) in the guest to
enable file sharing.
## Supporting old Linux distros
If you want to run an old Linux , from 2016 or earlier, change the
`guest_os` to `linux_old`. This will enable the `vmware-svga` graphics
driver which is better supported on older distros.
## [Creating macOS Guests](https://github.com/quickemu-project/quickemu/wiki/03-Create-macOS-virtual-machines#automatically-create-macos-guests) 🍏
**Installing macOS in a VM can be a bit finicky, if you encounter
problems, [check the
Discussions](https://github.com/quickemu-project/quickemu/discussions)
for solutions or ask for help there** 🛟
`quickget` automatically downloads a macOS recovery image and creates a
virtual machine configuration.
Note: Some VPN users may need to [turn off their
VPN](https://github.com/quickemu-project/quickemu/issues/1391#issuecomment-3506845235)
in order to download a recovery image. Some other users may find [using
a
VPN](https://github.com/quickemu-project/quickemu/issues/1391#issuecomment-2429146013)
necessary in order to download a recovery image.
``` shell
quickget macos big-sur
quickemu --vm macos-big-sur.conf
```
macOS `mojave`, `catalina`, `big-sur`, `monterey`, `ventura` and
`sonoma` are supported.
- Use cursor keys and enter key to select the **macOS Base System**
- From **macOS Utilities**
- Click **Disk Utility** and **Continue**
- Select `QEMU HARDDISK Media` (~103.08GB) from the list (on Big Sur
and above use `Apple Inc. VirtIO Block Device`) and click
**Erase**.
- Enter a `Name:` for the disk
- If you are installing macOS Mojave or later (Catalina, Big Sur,
Monterey, Ventura and Sonoma), choose any of the APFS options as
the filesystem. MacOS Extended may not work.
- Click **Erase**.
- Click **Done**.
- Close Disk Utility
- From **macOS Utilities**
- Click **Reinstall macOS** and **Continue**
- Complete the installation as you normally would.
- On the first reboot use cursor keys and enter key to select **macOS
Installer**
- On the subsequent reboots use cursor keys and enter key to select
the disk you named
- Once you have finished installing macOS you will be presented with an
the out-of-the-box first-start wizard to configure various options and
set up your username and password
- OPTIONAL: After you have concluded the out-of-the-box wizard, you may
want to enable the TRIM feature that the computer industry created for
SSD disks. This feature in our macOS installation will allow QuickEmu
to compact (shrink) your macOS disk image whenever you delete files
inside the Virtual Machine. Without this step your macOS disk image
will only ever get larger and will not shrink even when you delete
lots of data inside macOS.
- To enable TRIM, open the Terminal application and type the following
command followed by pressing enter to tell macos to use
the TRIM command on the hard disk when files are deleted:
``` shell
sudo trimforce enable
```
You will be prompted to enter your account's password to gain the
privilege needed. Once you've entered your password and pressed
enter the command will request confirmation in the form of
two questions that require you to type y (for a "yes"
response) followed by enter to confirm.
If you press enter without first typing y the
system will consider that a negative response as though you said "no":
``` plain
IMPORTANT NOTICE: This tool force-enables TRIM for all relevant attached devices, even though such devices may not have been validated for data integrity while using TRIM. Use of this tool to enable TRIM may result in unintended data loss or data corruption. It should not be used in a commercial operating environment or with important data. Before using this tool, you should back up all of your data and regularly back up data while TRIM is enabled. This tool is provided on an "as is" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THIS TOOL OR ITS USE ALONE OR IN COMBINATION WITH YOUR DEVICES, SYSTEMS, OR SERVICES. BY USING THIS TOOL TO ENABLE TRIM, YOU AGREE THAT, TO THE EXTENT PERMITTED BY APPLICABLE LAW, USE OF THE TOOL IS AT YOUR SOLE RISK AND THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND EFFORT IS WITH YOU.
Are you sure you with to proceed (y/N)?
```
And a second confirmation once you've confirmed the previous one:
``` plain
Your system will immediately reboot when this is complete.
Is this OK (y/N)?
```
As the last message states, your system will automatically reboot as
soon as the command completes.
The default macOS configuration looks like this:
``` shell
guest_os="macos"
img="macos-big-sur/RecoveryImage.img"
disk_img="macos-big-sur/disk.qcow2"
macos_release="big-sur"
```
- `guest_os="macos"` instructs Quickemu to optimise for macOS.
- `macos_release="big-sur"` instructs Quickemu to optimise for a
particular macOS release.
- For example VirtIO Network and Memory Ballooning are available in
Big Sur and newer, but not previous releases.
- And VirtIO Block Media (disks) are supported/stable in Catalina and
newer.
# macOS compatibility
There are some considerations when running macOS via Quickemu.
- Supported macOS releases:
- Mojave
- Catalina
- Big Sur
- Monterey
- Ventura
- Sonoma
- `quickemu` will automatically download the required
[OpenCore](https://github.com/acidanthera/OpenCorePkg) bootloader and
OVMF firmware from [OSX-KVM](https://github.com/kholia/OSX-KVM).
- Optimised by default, but no GPU acceleration is available.
- Host CPU vendor is detected and guest CPU is optimised accordingly.
- [VirtIO Block
Media](https://www.kraxel.org/blog/2019/06/macos-qemu-guest/) is
used for the system disk where supported.
- [VirtIO `usb-tablet`](http://philjordan.eu/osx-virt/) is used for
the mouse.
- VirtIO Network (`virtio-net`) is supported and enabled on macOS Big
Sur and newer, but earlier releases use `vmxnet3`.
- VirtIO Memory Ballooning is supported and enabled on macOS Big Sur
and newer but disabled for other support macOS releases.
- USB host and SPICE pass-through is:
- UHCI (USB 2.0) on macOS Catalina and earlier.
- XHCI (USB 3.0) on macOS Big Sur and newer.
- Display resolution can be changed via `quickemu` using `--width` and
`--height` command line arguments.
- **Full Duplex audio requires [VoodooHDA
OC](https://github.com/chris1111/VoodooHDA-OC) or pass-through a USB
audio-device to the macOS guest VM**.
- NOTE! [Gatekeeper](https://disable-gatekeeper.github.io/) and
[System Integrity Protection
(SIP)](https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection)
need to be disabled to install VoodooHDA OC
- File sharing between guest and host is available via
[virtio-9p](https://wiki.qemu.org/Documentation/9psetup) and [SPICE
webdavd](https://gitlab.gnome.org/GNOME/phodav/-/merge_requests/24).
- Copy/paste via SPICE agent is **not available on macOS**.
# macOS App Store
If you see *"Your device or computer could not be verified"* when you
try to login to the App Store, make sure that your wired ethernet device
is `en0`. Use `ifconfig` in a terminal to verify this.
If the wired ethernet device is not `en0`, then then go to *System
Preferences* -\> *Network*, delete all the network devices and apply the
changes. Next, open a terminal and run the following:
``` shell
sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
```
Now reboot, and the App Store should work.
There may be further advice and information about macOS guests in the
project
[wiki](https://github.com/quickemu-project/quickemu/wiki/03-Create-macOS-virtual-machines#automatically-create-macos-guests).
## [Creating Windows guests](https://github.com/quickemu-project/quickemu/wiki/04-Create-Windows-virtual-machines) 🪟
`quickget` can download [**Windows
10**](https://www.microsoft.com/software-download/windows10) and
[**Windows 11**](https://www.microsoft.com/software-download/windows11)
automatically and create an optimised virtual machine configuration.
This configuration also includes the [VirtIO drivers for
Windows](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/).
**Windows 8.1** is also supported but doesn't feature any automated
installation or driver optimisation.
`quickget` can also download [Windows 10
LTSC](https://www.microsoft.com/en-us/evalcenter/download-windows-10-enterprise)
and Windows Server
[2012-r2](https://www.microsoft.com/en-us/evalcenter/download-windows-server-2012-r2),
[2016](https://www.microsoft.com/en-us/evalcenter/download-windows-server-2016),
[2019](https://www.microsoft.com/en-us/evalcenter/download-windows-server-2019),
and
[2022](https://www.microsoft.com/en-us/evalcenter/download-windows-server-2022).
No automated installation is supported for these releases.
``` shell
quickget windows 11
quickemu --vm windows-11.conf
```
- Complete the installation as you normally would.
- All relevant drivers and services should be installed automatically.
- A local administrator user account is automatically created, with
these credentials:
- Username: `Quickemu`
- Password: `quickemu`
Further information is available from the project
[wiki](https://github.com/quickemu-project/quickemu/wiki/04-Create-Windows-virtual-machines)
## Configuration
Here are the usage instructions:
``` text
Usage
quickemu --vm ubuntu.conf
Arguments
--access : Enable remote spice access support. 'local' (default), 'remote', 'clientipaddress'
--braille : Enable braille support. Requires SDL.
--cpu-pinning : Choose which host cores correspond to which guest cores.
--delete-disk : Delete the disk image and EFI variables
--delete-vm : Delete the entire VM and its configuration
--display : Select display backend. 'gtk' (default), 'sdl', 'cocoa', 'none', 'spice' or 'spice-app'
--fullscreen : Starts VM in full screen mode (Ctl+Alt+f to exit)
--ignore-msrs-always : Configure KVM to always ignore unhandled machine-specific registers
--ignore-tsc-warning : Skip TSC stability warning for macOS VMs on AMD
--kill : Kill the VM process if it is running
--offline : Override all network settings and start the VM offline
--shortcut : Create a desktop shortcut
--snapshot apply : Apply/restore a snapshot.
--snapshot create : Create a snapshot.
--snapshot delete : Delete a snapshot.
--snapshot info : Show disk/snapshot info.
--status-quo : Do not commit any changes to disk/snapshot.
--viewer : Choose an alternative viewer. @Options: 'spicy' (default), 'remote-viewer', 'none'
--width : Set VM screen width; requires '--height'
--height : Set VM screen height; requires '--width'
--ssh-port : Set SSH port manually
--spice-port : Set SPICE port manually
--public-dir : Expose share directory. @Options: '' (default: xdg-user-dir PUBLICSHARE), '', 'none'
--monitor : Set monitor connection type. @Options: 'socket' (default), 'telnet', 'none'
--monitor-telnet-host : Set telnet host for monitor. (default: 'localhost')
--monitor-telnet-port : Set telnet port for monitor. (default: '4440')
--monitor-cmd : Send command to monitor if available. (Example: system_powerdown)
--serial : Set serial connection type. @Options: 'socket' (default), 'telnet', 'none'
--serial-telnet-host : Set telnet host for serial. (default: 'localhost')
--serial-telnet-port : Set telnet port for serial. (default: '6660')
--keyboard : Set keyboard. @Options: 'usb' (default), 'ps2', 'virtio'
--keyboard_layout : Set keyboard layout: 'en-us' (default)
--mouse : Set mouse. @Options: 'tablet' (default), 'ps2', 'usb', 'virtio'
--usb-controller : Set usb-controller. @Options: 'ehci' (default), 'xhci', 'none'
--sound-card : Set sound card. @Options: 'intel-hda' (default), 'ac97', 'es1370', 'sb16', 'usb-audio', 'virtio-sound-pci', 'none'
--sound-duplex : Set sound card duplex. @Options: 'hda-micro' (default: speaker/mic), 'hda-duplex' (line-in/line-out), 'hda-output' (output-only)
--extra_args : Pass additional arguments to qemu
--version : Print version
```
## Desktop shortcuts
Desktop shortcuts can be created for a VM, the shortcuts are saved in
`~/.local/share/applications`. Here is an example of how to create a
shortcut.
``` shell
quickemu --vm ubuntu-22.04-desktop.conf --shortcut
```
## References
Useful reference that assisted the development of Quickemu.
- General
- [QEMU's documentation!](https://qemu.readthedocs.io/en/latest/)
-
-
- macOS
-
-
-
-
-
-
-
-
-
-
- [OpenCore Configurator](https://mackie100projects.altervista.org)
- Windows
-
-
-
-
-
-
- TPM
-
-
- 9p & virtiofs
-
-
-
-
-
# AUTHORS
Written by Martin Wimpress.
# BUGS
Submit bug reports online at:
# SEE ALSO
Full sources at:
quickemu_conf(5), quickget(1), quickgui(1)
================================================
FILE: docs/quickemu_conf.5
================================================
.\" Automatically generated by Pandoc 3.8.3
.\"
.TH "QUICKEMU_CONF" "5" "February 2, 2026" "quickemu_conf" "Quickemu Configuration Manual"
.SH NAME
quickemu_conf \- Options and parameters in the quickemu .conf
.SH DESCRIPTION
\f[B]quickemu\f[R] will create and run highly optimised desktop virtual
machines for Linux, macOS and Windows.
It uses sensible defaults, but many configuration options can be
overridden in the required configuration file, which will as a minimum
specify the path to the installation ISO and QEMU disk for the installed
VM
.SH OPTIONS
These are the options and defaults for the .conf file
.IP
.EX
# Lowercase variables are used in the VM config file only
boot=\(dqefi\(dq
cpu_cores=\(dq\(dq
disk_img=\(dq\(dq
disk_size=\(dq\(dq
display=\(dq\(dq
extra_args=\(dq\(dq
fixed_iso=\(dq\(dq
floppy=\(dq\(dq
guest_os=\(dqlinux\(dq
img=\(dq\(dq
iso=\(dq\(dq
macaddr=\(dq\(dq
macos_release=\(dq\(dq
network=\(dq\(dq
port_forwards=()
preallocation=\(dqoff\(dq
ram=\(dq\(dq
secureboot=\(dqoff\(dq
tpm=\(dqoff\(dq
usb_devices=()
viewer=\(dqspicy\(dq
ssh_port=\(dq\(dq
spice_port=\(dq\(dq
public_dir=\(dq\(dq
monitor=\(dqsocket\(dq
monitor_telnet_port=\(dq4440\(dq
monitor_telnet_host=\(dqlocalhost\(dq
monitor_cmd=\(dq\(dq
serial=\(dqsocket\(dq
serial_telnet_port=\(dq6660\(dq
serial_telnet_host=\(dqlocalhost\(dq
# options: ehci(USB2.0), xhci(USB3.0)
usb_controller=\(dqehci\(dq
# options: ps2, usb, virtio
keyboard=\(dqusb\(dq
keyboard_layout=\(dqen\-us\(dq
# options: ps2, usb, tablet, virtio
mouse=\(dqtablet\(dq
.EE
.SH EXAMPLES
.IP
.EX
guest_os=\(dqlinux\(dq
disk_img=\(dqdebian\-bullseye/disk.qcow2\(dq
iso=\(dqdebian\-bullseye/firmware\-11.0.0\-amd64\-DVD\-1.iso\(dq
.EE
.PP
The default macOS configuration looks like this:
.IP
.EX
guest_os=\(dqmacos\(dq
img=\(dqmacos\-catalina/RecoveryImage.img\(dq
disk_img=\(dqmacos\-catalina/disk.qcow2\(dq
macos_release=\(dqcatalina\(dq
.EE
.IP \(bu 2
\f[CR]guest_os=\(dqmacos\(dq\f[R] instructs Quickemu to optimise for
macOS.
.IP \(bu 2
\f[CR]macos_release=\(dqcatalina\(dq\f[R] instructs Quickemu to optimise
for a particular macOS release.
.RS 2
.IP \(bu 2
For example VirtIO Network and Memory Ballooning are available in Big
Sur and newer, but not previous releases.
.IP \(bu 2
And VirtIO Block Media (disks) are supported/stable in Catalina and
newer.
.RE
.PP
The default Windows 11 configuration looks like this:
.IP
.EX
guest_os=\(dqwindows\(dq
disk_img=\(dqwindows\-11/disk.qcow2\(dq
iso=\(dqwindows\-11/Win11_EnglishInternational_x64.iso\(dq
fixed_iso=\(dqwindows\-11/virtio\-win.iso\(dq
tpm=\(dqon\(dq
secureboot=\(dqon\(dq
.EE
.IP \(bu 2
\f[CR]guest_os=\(dqwindows\(dq\f[R] instructs \f[CR]quickemu\f[R] to
optimise for Windows.
.IP \(bu 2
\f[CR]fixed_iso=\f[R] specifies the ISO image that provides VirtIO
drivers.
.IP \(bu 2
\f[CR]tpm=\(dqon\(dq\f[R] instructs \f[CR]quickemu\f[R] to create a
software emulated TPM device using \f[CR]swtpm\f[R].
.SS BIOS and EFI
Since Quickemu 2.1.0 \f[CR]efi\f[R] is the default boot option.
If you want to override this behaviour then add the following line to
you VM configuration to enable legacy BIOS.
.IP \(bu 2
\f[CR]boot=\(dqlegacy\(dq\f[R] \- Enable Legacy BIOS boot
.SS Tuning CPU cores, RAM & disks
By default, Quickemu will calculate the number of CPUs cores and RAM to
allocate to a VM based on the specifications of your host computer.
You can override this default behaviour and tune the VM configuration to
your liking.
.PP
Add additional lines to your virtual machine configuration:
.IP \(bu 2
\f[CR]cpu_cores=\(dq4\(dq\f[R] \- Specify the number of CPU cores
allocated to the VM
.IP \(bu 2
\f[CR]ram=\(dq4G\(dq\f[R] \- Specify the amount of RAM to allocate to
the VM
.IP \(bu 2
\f[CR]disk_size=\(dq16G\(dq\f[R] \- Specify the size of the virtual disk
allocated to the VM
.SS Disk preallocation
Preallocation mode (allowed values: \f[CR]off\f[R] (default),
\f[CR]metadata\f[R], \f[CR]falloc\f[R], \f[CR]full\f[R]).
An image with preallocated metadata is initially larger but can improve
performance when the image needs to grow.
.PP
Specify what disk preallocation should be used, if any, when creating
the system disk image by adding a line like this to your VM
configuration.
.IP \(bu 2
\f[CR]preallocation=\(dqmetadata\(dq\f[R]
.SS CD\-ROM disks
If you want to expose an ISO image from the host to guest add the
following line to the VM configuration:
.IP \(bu 2
\f[CR]fixed_iso=\(dq/path/to/image.iso\(dq\f[R]
.SS Floppy disks
If you\(aqre like \c
.UR https://popey.com
Alan Pope
.UE \c
\ you\(aqll probably want to mount a floppy disk image in the guest.
To do so add the following line to the VM configuration:
.IP \(bu 2
\f[CR]floppy=\(dq/path/to/floppy.img\(dq\f[R]
.SS File Sharing
All File Sharing options will only expose \f[CR]\(ti/Public\f[R] (or
localised variations) for the current user to the guest VMs.
.SS Samba 🐧 🍏 🪟
If \f[CR]smbd\f[R] is available on the host, Quickemu will automatically
enable the built\-in QEMU support for exposing a Samba share from the
host to the guest.
.PP
You can install the minimal Samba components on Ubuntu using:
.IP
.EX
sudo apt install \-\-no\-install\-recommends samba
.EE
.PP
If everything is set up correctly, the \f[CR]smbd\f[R] address will be
printed when the virtual machine is started.
For example:
.IP
.EX
\- smbd: On guest: smb://10.0.2.4/qemu
.EE
.PP
If using a Windows guest, right\-click on \(dqThis PC\(dq, click \(dqAdd
a network location\(dq, and paste this address, removing \f[CR]smb:\f[R]
and replacing forward slashes with backslashes (in this example
\f[CR]\(rs\(rs10.0.2.4\(rsqemu\f[R]).
.SS SPICE WebDAV 🐧 🪟
.IP \(bu 2
TBD
.SS VirtIO\-9P 🐧 🍏
.IP \(bu 2
TBD
.SS Networking
.SS Port forwarding
Add an additional line to your virtual machine configuration.
For example:
.IP \(bu 2
\f[CR]port_forwards=(\(dq8123:8123\(dq \(dq8888:80\(dq)\f[R]
.PP
In the example above:
.IP \(bu 2
Port 8123 on the host is forwarded to port 8123 on the guest.
.IP \(bu 2
Port 8888 on the host is forwarded to port 80 on the guest.
.SS Disable networking
To completely disable all network interfaces in a guest VM add this
additional line to your virtual machine configuration:
.IP \(bu 2
\f[CR]network=\(dqnone\(dq\f[R]
.SS Restricted networking
You can isolate the guest from the host (and broader network) using the
restrict option, which will restrict networking to just the guest and
any virtual devices.
.PP
This can be used to prevent software running inside the guest from
phoning home while still providing a network inside the guest.
Add this additional line to your virtual machine configuration:
.IP \(bu 2
\f[CR]network=\(dqrestrict\(dq\f[R]
.SS Bridged networking
Connect your virtual machine to a preconfigured network bridge.
Add an additional line to your virtual machine configuration:
.IP \(bu 2
\f[CR]network=\(dqbr0\(dq\f[R]
.PP
If you want to have a persistent MAC address for your bridged network
interface in the guest VM you can add \f[CR]macaddr\f[R] to the virtual
machine configuration.
QEMU requires that the MAC address is in the range:
\f[B]52:54:00:AB:00:00 \- 52:54:00:AB:FF:FF\f[R]
.PP
So you can generate your own MAC addresses with:
.IP \(bu 2
\f[CR]macaddr=\(dq52:54:00:AB:51:AE\(dq\f[R]
.SS USB redirection
Quickemu supports USB redirection via SPICE pass\-through and host
pass\-through.
Quickemu supports USB redirection via SPICE pass\-through and host
pass\-through.
.PP
\f[B]NOTE!\f[R] When a USB device is redirected from the host, it will
not be usable by host operating system until the guest redirection is
stopped.
Therefore, do not redirect the input devices, such as the keyboard and
mouse, as it will be difficult (or impossible) to revert the situation.
.SS SPICE redirection (recommended)
Using SPICE for USB pass\-through is easiest as it doesn\(aqt require
any elevated permission:
.PP
Both \f[CR]spicy\f[R] from \c
.UR https://www.spice-space.org/spice-gtk.html
spice\-gtk
.UE \c
\ (\f[I]Input \-> Select USB Devices for redirection\f[R]) and
\f[CR]remote\-viewer\f[R] from \c
.UR https://gitlab.com/virt-viewer/virt-viewer
virt\-viewer
.UE \c
\ (\f[I]File \-> USB device selection\f[R]) support this feature.
.IP \(bu 2
Start Quickemu with \f[CR]\-\-display spice\f[R] and then
.IP \(bu 2
Select \f[CR]Input\f[R] \-> \f[CR]Select USB Device for redirection\f[R]
from the menu to choose which device(s) you want to attach to the guest.
.IP \(bu 2
**\f[CR]spicy\f[R] (default)
.RS 2
.IP \(bu 2
**Select \f[CR]Input\f[R] \->
\f[CR]Select USB Device for redirection\f[R] from the menu to choose
which device(s) you want to attach to the guest.
.RE
.IP \(bu 2
**\f[CR]remote\-viewer\f[R]
.RS 2
.IP \(bu 2
**Select \f[CR]File\f[R] \-> \f[CR]USB device selection\f[R] from the
menu to choose which device(s) you want to attach to the guest.
.RE
.PP
To ensure that this functionality works as expected, make sure that you
have installed the necessary SPICE Guest Tools on the virtual machine.
.SS Enabling SPICE redirection on NixOS
On NixOS, if you encounter this error:
.IP
.EX
Error setting facl: Operation not permitted
.EE
.PP
Try setting \c
.UR https://search.nixos.org/options?channel=23.11&show=virtualisation.spiceUSBRedirection.enable&from=0&size=50&sort=relevance&type=packages&query=spiceusbredirec
the following option
.UE \c
:
.IP
.EX
virtualisation.spiceUSBRedirection.enable = true;
.EE
.SS Host redirection (\f[B]NOT Recommended\f[R])
\f[B]USB host redirection is not recommended\f[R], it is provided purely
for backwards compatibility to older versions of Quickemu.
Using SPICE is preferred, see above.
.PP
Add an additional line to your virtual machine configuration.
For example:
.IP \(bu 2
\f[CR]usb_devices=(\(dq046d:082d\(dq \(dq046d:085e\(dq)\f[R]
.PP
In the example above:
.IP \(bu 2
The USB device with vendor_id 046d and product_id 082d will be exposed
to the guest.
.IP \(bu 2
The USB device with vendor_id 046d and product_id 085e will be exposed
to the guest.
.PP
If the USB devices are not writable, \f[CR]quickemu\f[R] will display
the appropriate commands to modify the USB device(s) access permissions,
like this:
.IP
.EX
\- USB: Host pass\-through requested:
\- Sennheiser Communications EPOS GTW 270 on bus 001 device 005 needs permission changes:
sudo chown \-v root:user /dev/bus/usb/001/005
ERROR! USB permission changes are required 👆
.EE
.SS TPM
Since Quickemu 2.2.0 a software emulated TPM device can be added to
guest virtual machines.
Just add \f[CR]tpm=\(dqon\(dq\f[R] to your VM configuration.
\f[CR]quickget\f[R] will automatically add this line to Windows 11
virtual machines.
.SH AUTHORS
Written by Martin Wimpress.
.SH BUGS
Submit bug reports online at: \c
.UR https://github.com/quickemu-project/quickemu/issues
.UE \c
.SH SEE ALSO
Full sources at: \c
.UR https://github.com/quickemu-project/quickemu
.UE \c
.PP
quickget(1), quickemu(1), quickgui(1)
.SH AUTHORS
Martin Wimpress.
================================================
FILE: docs/quickemu_conf.5.md
================================================
---
author: Martin Wimpress
date: February 2, 2026
footer: quickemu_conf
header: Quickemu Configuration Manual
section: 5
title: QUICKEMU_CONF
---
# NAME
quickemu_conf - Options and parameters in the quickemu \.conf
# DESCRIPTION
**quickemu** will create and run highly optimised desktop virtual
machines for Linux, macOS and Windows. It uses sensible defaults, but
many configuration options can be overridden in the required
configuration file, which will as a minimum specify the path to the
installation ISO and QEMU disk for the installed VM
# OPTIONS
These are the options and defaults for the \.conf file
``` shell
# Lowercase variables are used in the VM config file only
boot="efi"
cpu_cores=""
disk_img=""
disk_size=""
display=""
extra_args=""
fixed_iso=""
floppy=""
guest_os="linux"
img=""
iso=""
macaddr=""
macos_release=""
network=""
port_forwards=()
preallocation="off"
ram=""
secureboot="off"
tpm="off"
usb_devices=()
viewer="spicy"
ssh_port=""
spice_port=""
public_dir=""
monitor="socket"
monitor_telnet_port="4440"
monitor_telnet_host="localhost"
monitor_cmd=""
serial="socket"
serial_telnet_port="6660"
serial_telnet_host="localhost"
# options: ehci(USB2.0), xhci(USB3.0)
usb_controller="ehci"
# options: ps2, usb, virtio
keyboard="usb"
keyboard_layout="en-us"
# options: ps2, usb, tablet, virtio
mouse="tablet"
```
# EXAMPLES
``` shell
guest_os="linux"
disk_img="debian-bullseye/disk.qcow2"
iso="debian-bullseye/firmware-11.0.0-amd64-DVD-1.iso"
```
The default macOS configuration looks like this:
``` shell
guest_os="macos"
img="macos-catalina/RecoveryImage.img"
disk_img="macos-catalina/disk.qcow2"
macos_release="catalina"
```
- `guest_os="macos"` instructs Quickemu to optimise for macOS.
- `macos_release="catalina"` instructs Quickemu to optimise for a
particular macOS release.
- For example VirtIO Network and Memory Ballooning are available in
Big Sur and newer, but not previous releases.
- And VirtIO Block Media (disks) are supported/stable in Catalina and
newer.
The default Windows 11 configuration looks like this:
``` shell
guest_os="windows"
disk_img="windows-11/disk.qcow2"
iso="windows-11/Win11_EnglishInternational_x64.iso"
fixed_iso="windows-11/virtio-win.iso"
tpm="on"
secureboot="on"
```
- `guest_os="windows"` instructs `quickemu` to optimise for Windows.
- `fixed_iso=` specifies the ISO image that provides VirtIO drivers.
- `tpm="on"` instructs `quickemu` to create a software emulated TPM
device using `swtpm`.
### BIOS and EFI
Since Quickemu 2.1.0 `efi` is the default boot option. If you want to
override this behaviour then add the following line to you VM
configuration to enable legacy BIOS.
- `boot="legacy"` - Enable Legacy BIOS boot
### Tuning CPU cores, RAM & disks
By default, Quickemu will calculate the number of CPUs cores and RAM to
allocate to a VM based on the specifications of your host computer. You
can override this default behaviour and tune the VM configuration to
your liking.
Add additional lines to your virtual machine configuration:
- `cpu_cores="4"` - Specify the number of CPU cores allocated to the VM
- `ram="4G"` - Specify the amount of RAM to allocate to the VM
- `disk_size="16G"` - Specify the size of the virtual disk allocated to
the VM
### Disk preallocation
Preallocation mode (allowed values: `off` (default), `metadata`,
`falloc`, `full`). An image with preallocated metadata is initially
larger but can improve performance when the image needs to grow.
Specify what disk preallocation should be used, if any, when creating
the system disk image by adding a line like this to your VM
configuration.
- `preallocation="metadata"`
### CD-ROM disks
If you want to expose an ISO image from the host to guest add the
following line to the VM configuration:
- `fixed_iso="/path/to/image.iso"`
### Floppy disks
If you're like [Alan Pope](https://popey.com) you'll probably want to
mount a floppy disk image in the guest. To do so add the following line
to the VM configuration:
- `floppy="/path/to/floppy.img"`
### File Sharing
All File Sharing options will only expose `~/Public` (or localised
variations) for the current user to the guest VMs.
#### Samba 🐧 🍏 🪟
If `smbd` is available on the host, Quickemu will automatically enable
the built-in QEMU support for exposing a Samba share from the host to
the guest.
You can install the minimal Samba components on Ubuntu using:
``` shell
sudo apt install --no-install-recommends samba
```
If everything is set up correctly, the `smbd` address will be printed
when the virtual machine is started. For example:
- smbd: On guest: smb://10.0.2.4/qemu
If using a Windows guest, right-click on "This PC", click "Add a network
location", and paste this address, removing `smb:` and replacing forward
slashes with backslashes (in this example `\\10.0.2.4\qemu`).
#### SPICE WebDAV 🐧 🪟
- TBD
#### VirtIO-9P 🐧 🍏
- TBD
### Networking
#### Port forwarding
Add an additional line to your virtual machine configuration. For
example:
- `port_forwards=("8123:8123" "8888:80")`
In the example above:
- Port 8123 on the host is forwarded to port 8123 on the guest.
- Port 8888 on the host is forwarded to port 80 on the guest.
#### Disable networking
To completely disable all network interfaces in a guest VM add this
additional line to your virtual machine configuration:
- `network="none"`
#### Restricted networking
You can isolate the guest from the host (and broader network) using the
restrict option, which will restrict networking to just the guest and
any virtual devices.
This can be used to prevent software running inside the guest from
phoning home while still providing a network inside the guest. Add this
additional line to your virtual machine configuration:
- `network="restrict"`
#### Bridged networking
Connect your virtual machine to a preconfigured network bridge. Add an
additional line to your virtual machine configuration:
- `network="br0"`
If you want to have a persistent MAC address for your bridged network
interface in the guest VM you can add `macaddr` to the virtual machine
configuration. QEMU requires that the MAC address is in the range:
**52:54:00:AB:00:00 - 52:54:00:AB:FF:FF**
So you can generate your own MAC addresses with:
- `macaddr="52:54:00:AB:51:AE"`
### USB redirection
Quickemu supports USB redirection via SPICE pass-through and host
pass-through. Quickemu supports USB redirection via SPICE pass-through
and host pass-through.
**NOTE!** When a USB device is redirected from the host, it will not be
usable by host operating system until the guest redirection is stopped.
Therefore, do not redirect the input devices, such as the keyboard and
mouse, as it will be difficult (or impossible) to revert the situation.
#### SPICE redirection (recommended)
Using SPICE for USB pass-through is easiest as it doesn't require any
elevated permission:
Both `spicy` from
[spice-gtk](https://www.spice-space.org/spice-gtk.html) (*Input -\>
Select USB Devices for redirection*) and `remote-viewer` from
[virt-viewer](https://gitlab.com/virt-viewer/virt-viewer) (*File -\> USB
device selection*) support this feature.
- Start Quickemu with `--display spice` and then
- Select `Input` -\> `Select USB Device for redirection` from the menu
to choose which device(s) you want to attach to the guest.
- \*\*`spicy` (default)
- \*\*Select `Input` -\> `Select USB Device for redirection` from the
menu to choose which device(s) you want to attach to the guest.
- \*\*`remote-viewer`
- \*\*Select `File` -\> `USB device selection` from the menu to choose
which device(s) you want to attach to the guest.
To ensure that this functionality works as expected, make sure that you
have installed the necessary SPICE Guest Tools on the virtual machine.
##### Enabling SPICE redirection on NixOS
On NixOS, if you encounter this error:
Error setting facl: Operation not permitted
Try setting [the following
option](https://search.nixos.org/options?channel=23.11&show=virtualisation.spiceUSBRedirection.enable&from=0&size=50&sort=relevance&type=packages&query=spiceusbredirec):
``` nix
virtualisation.spiceUSBRedirection.enable = true;
```
#### Host redirection (**NOT Recommended**)
**USB host redirection is not recommended**, it is provided purely for
backwards compatibility to older versions of Quickemu. Using SPICE is
preferred, see above.
Add an additional line to your virtual machine configuration. For
example:
- `usb_devices=("046d:082d" "046d:085e")`
In the example above:
- The USB device with vendor_id 046d and product_id 082d will be exposed
to the guest.
- The USB device with vendor_id 046d and product_id 085e will be exposed
to the guest.
If the USB devices are not writable, `quickemu` will display the
appropriate commands to modify the USB device(s) access permissions,
like this:
- USB: Host pass-through requested:
- Sennheiser Communications EPOS GTW 270 on bus 001 device 005 needs permission changes:
sudo chown -v root:user /dev/bus/usb/001/005
ERROR! USB permission changes are required 👆
### TPM
Since Quickemu 2.2.0 a software emulated TPM device can be added to
guest virtual machines. Just add `tpm="on"` to your VM configuration.
`quickget` will automatically add this line to Windows 11 virtual
machines.
# AUTHORS
Written by Martin Wimpress.
# BUGS
Submit bug reports online at:
# SEE ALSO
Full sources at:
quickget(1), quickemu(1), quickgui(1)
================================================
FILE: docs/quickget.1
================================================
.\" Automatically generated by Pandoc 3.8.3
.\"
.TH "QUICKGET" "1" "February 2, 2026" "quickget" "Quickget User Manual"
.SH NAME
quickget \- download and prepare materials for building a quickemu VM
.SH SYNOPSIS
\f[B]quickget\f[R] [\f[I]os\f[R]] [\f[I]release\f[R]]
[\f[I]edition\f[R]] | [\f[I]OPTION\f[R]]*
.SH DESCRIPTION
\f[B]quickget\f[R] will download the requisite materials and prepare a
configuration for \f[CR]quickemu\f[R] to use to build and run
.SH OPTIONS
.TP
\f[B][OS] [Release] [Edition]\f[R]
specify the OS and release (and optional edition) if insufficient input
is provided a list of missing options will be reported and the script
will exit.
Editions may not apply and will be defaulted if not provided.
.TP
\f[B]\-\-download\f[R] [edition]
Download image; no VM configuration
.TP
\f[B]\-\-create\-config\f[R] [path/url]
Create VM config for a OS image
.TP
\f[B]\-\-open\-homepage\f[R]
Open homepage for the OS
.TP
\f[B]\-\-show\f[R] [os]
Show OS information
.TP
\f[B]\-\-url\f[R] [os] [release] [edition]
Show image URL(s)
.TP
\f[B]\-\-check\f[R] [os] [release] [edition]
Check image URL(s)
.TP
\f[B]\-\-list\f[R]
List all supported systems
.TP
\f[B]\-\-list\-csv\f[R]
List everything in csv format
.TP
\f[B]\-\-list\-json\f[R]
List everything in json format
.TP
\f[B]\-\-version\f[R]
Show version
.TP
\f[B]\-\-help\f[R]
Show this help message
.SH NOTES
.SS Creating Linux guests 🐧
.SS Ubuntu
\f[CR]quickget\f[R] will automatically download an Ubuntu release and
create the virtual machine configuration.
.IP
.EX
quickget ubuntu 22.04
quickemu \-\-vm ubuntu\-22.04.conf
.EE
.IP \(bu 2
Complete the installation as normal.
.IP \(bu 2
Post\-install:
.RS 2
.IP \(bu 2
Install the SPICE agent (\f[CR]spice\-vdagent\f[R]) in the guest to
enable copy/paste and USB redirection
.RS 2
.IP \(bu 2
\f[CR]sudo apt install spice\-vdagent\f[R]
.RE
.IP \(bu 2
Install the SPICE WebDAV agent (\f[CR]spice\-webdavd\f[R]) in the guest
to enable file sharing.
.RS 2
.IP \(bu 2
\f[CR]sudo apt install spice\-webdavd\f[R]
.RE
.RE
.SS Ubuntu daily\-live images
\f[CR]quickget\f[R] can also download/refresh daily\-live images via
\f[CR]zsync\f[R] for Ubuntu developers and testers.
.IP
.EX
quickget ubuntu daily\-live
quickemu \-\-vm ubuntu\-daily\-live.conf
.EE
.PP
You can run \f[CR]quickget ubuntu daily\-live\f[R] to refresh your daily
development image as often as you like, it will even automatically
switch to a new series.
.SS Ubuntu Flavours
All the official Ubuntu flavours are supported, just replace
\f[CR]ubuntu\f[R] with your preferred flavour.
.PP
The project \c
.UR https://github.com/quickemu-project/quickemu/wiki/02-Create-Linux-virtual-machines
wiki
.UE \c
\ may have further information.
.IP \(bu 2
\f[CR]edubuntu\f[R] (Edubuntu)
.IP \(bu 2
\f[CR]kubuntu\f[R] (Kubuntu)
.IP \(bu 2
\f[CR]lubuntu\f[R] (Lubuntu)
.IP \(bu 2
\f[CR]ubuntu\-budgie\f[R] (Ubuntu Budgie)
.IP \(bu 2
\f[CR]ubuntucinnamon\f[R] (Ubuntu Cinnamon)
.IP \(bu 2
\f[CR]ubuntukylin\f[R] (Ubuntu Kylin)
.IP \(bu 2
\f[CR]ubuntu\-mate\f[R] (Ubuntu MATE)
.IP \(bu 2
\f[CR]ubuntu\-server\f[R] (Ubuntu Server)
.IP \(bu 2
\f[CR]ubuntustudio\f[R] (Ubuntu Studio)
.IP \(bu 2
\f[CR]ubuntu\f[R] (Ubuntu)
.IP \(bu 2
\f[CR]ubuntu\-unity\f[R] (Ubuntu Unity)
.IP \(bu 2
\f[CR]xubuntu\f[R] (Xubuntu)
.PP
You can also use \f[CR]quickget\f[R] with advanced options :
.IP
.EX
\-\-arch : Set architecture (arm64, aarch64, amd64, x86_64)
\-\-download [edition] : Download image; no VM configuration
\-\-create\-config [path/url] [flags] : Create VM config for an OS image
\-\-open\-homepage : Open homepage for the OS
\-\-show [os] : Show OS information
\-\-version : Show version
\-\-help : Show this help message
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- Flags \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
\-\-create\-config:
\-\-disable\-unattended : Force quickget not to set up an unattended installation
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- For testing & development \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
\-\-url [os] [release] [edition] : Show image URL(s)
\-\-check [os] [release] [edition] : Check image URL(s)
\-\-check\-all\-arch [os] [release] [edition] : Check downloads for all architectures (amd64 and arm64)
\-\-list : List all supported systems
\-\-list\-csv : List everything in csv format
\-\-list\-json : List everything in json format
.EE
.PP
Here are some typical uses
.IP
.EX
# show an OS ISO download URL for {os} {release} [edition]
quickget \-\-url fedora 38 Silverblue
# test if an OS ISO is available for {os} {release} [edition]
quickget \-\-check nixos unstable plasma5
# open an OS distribution homepage in a browser
quickget \-\-open\-homepage ubuntu\-mate
# Only download image file into current directory, without creating VM
quickget \-\-download elementary 7.1
.EE
.PP
The \f[CR]\-\-url\f[R], \f[CR]\-\-check\f[R], and
\f[CR]\-\-download\f[R] options are fully functional for all operating
systems, including Windows and macOS.
.PP
Further information is available from the project \c
.UR https://github.com/quickemu-project/quickemu/wiki/06-Advanced-quickget-features
wiki
.UE \c
.SS Other Operating Systems
\f[CR]quickget\f[R] also supports:
.IP \(bu 2
\f[CR]alma\f[R] (AlmaLinux)
.IP \(bu 2
\f[CR]alpine\f[R] (Alpine Linux)
.IP \(bu 2
\f[CR]android\f[R] (Android x86)
.IP \(bu 2
\f[CR]antix\f[R] (Antix)
.IP \(bu 2
\f[CR]archcraft\f[R] (Archcraft)
.IP \(bu 2
\f[CR]archlinux\f[R] (Arch Linux)
.IP \(bu 2
\f[CR]artixlinux\f[R] (Artix Linux)
.IP \(bu 2
\f[CR]azurelinux\f[R] (Azure Linux)
.IP \(bu 2
\f[CR]batocera\f[R] (Batocera)
.IP \(bu 2
\f[CR]bazzite\f[R] (Bazzite)
.IP \(bu 2
\f[CR]biglinux\f[R] (BigLinux)
.IP \(bu 2
\f[CR]blendos\f[R] (BlendOS)
.IP \(bu 2
\f[CR]bodhi\f[R] (Bodhi)
.IP \(bu 2
\f[CR]bunsenlabs\f[R] (BunsenLabs)
.IP \(bu 2
\f[CR]cachyos\f[R] (CachyOS)
.IP \(bu 2
\f[CR]centos\-stream\f[R] (CentOS Stream)
.IP \(bu 2
\f[CR]chimeralinux\f[R] (Chimera Linux)
.IP \(bu 2
\f[CR]crunchbang++\f[R] (Crunchbangplusplus)
.IP \(bu 2
\f[CR]debian\f[R] (Debian)
.IP \(bu 2
\f[CR]deepin\f[R] (Deepin)
.IP \(bu 2
\f[CR]devuan\f[R] (Devuan)
.IP \(bu 2
\f[CR]dragonflybsd\f[R] (DragonFlyBSD)
.IP \(bu 2
\f[CR]easyos\f[R] (EasyOS)
.IP \(bu 2
\f[CR]elementary\f[R] (elementary OS)
.IP \(bu 2
\f[CR]endeavouros\f[R] (EndeavourOS)
.IP \(bu 2
\f[CR]endless\f[R] (Endless OS)
.IP \(bu 2
\f[CR]fedora\f[R] (Fedora)
.IP \(bu 2
\f[CR]freebsd\f[R] (FreeBSD)
.IP \(bu 2
\f[CR]freedos\f[R] (FreeDOS)
.IP \(bu 2
\f[CR]garuda\f[R] (Garuda Linux)
.IP \(bu 2
\f[CR]gentoo\f[R] (Gentoo)
.IP \(bu 2
\f[CR]ghostbsd\f[R] (GhostBSD)
.IP \(bu 2
\f[CR]gnomeos\f[R] (GNOME OS)
.IP \(bu 2
\f[CR]guix\f[R] (Guix)
.IP \(bu 2
\f[CR]haiku\f[R] (Haiku)
.IP \(bu 2
\f[CR]kali\f[R] (Kali)
.IP \(bu 2
\f[CR]kdeneon\f[R] (KDE Neon)
.IP \(bu 2
\f[CR]kolibrios\f[R] (KolibriOS)
.IP \(bu 2
\f[CR]linuxlite\f[R] (Linux Lite)
.IP \(bu 2
\f[CR]linuxmint\f[R] (Linux Mint)
.IP \(bu 2
\f[CR]lmde\f[R] (Linux Mint Debian Edition)
.IP \(bu 2
\f[CR]maboxlinux\f[R] (Mabox Linux)
.IP \(bu 2
\f[CR]mageia\f[R] (Mageia)
.IP \(bu 2
\f[CR]manjaro\f[R] (Manjaro)
.IP \(bu 2
\f[CR]mxlinux\f[R] (MX Linux)
.IP \(bu 2
\f[CR]netboot\f[R] (netboot.xyz)
.IP \(bu 2
\f[CR]netbsd\f[R] (NetBSD)
.IP \(bu 2
\f[CR]nitrux\f[R] (Nitrux)
.IP \(bu 2
\f[CR]nixos\f[R] (NixOS)
.IP \(bu 2
\f[CR]nwg\-shell\f[R] (nwg\-shell)
.IP \(bu 2
\f[CR]openbsd\f[R] (OpenBSD)
.IP \(bu 2
\f[CR]openindiana\f[R] (OpenIndiana)
.IP \(bu 2
\f[CR]opensuse\f[R] (openSUSE)
.IP \(bu 2
\f[CR]oraclelinux\f[R] (Oracle Linux)
.IP \(bu 2
\f[CR]parrotsec\f[R] (Parrot Security)
.IP \(bu 2
\f[CR]pclinuxos\f[R] (PCLinuxOS)
.IP \(bu 2
\f[CR]peppermint\f[R] (PeppermintOS)
.IP \(bu 2
\f[CR]popos\f[R] (Pop!_OS)
.IP \(bu 2
\f[CR]porteus\f[R] (Porteus)
.IP \(bu 2
\f[CR]primtux\f[R] (PrimTux)
.IP \(bu 2
\f[CR]proxmox\-ve\f[R] (Proxmox VE)
.IP \(bu 2
\f[CR]pureos\f[R] (PureOS)
.IP \(bu 2
\f[CR]reactos\f[R] (ReactOS)
.IP \(bu 2
\f[CR]rebornos\f[R] (RebornOS)
.IP \(bu 2
\f[CR]rockylinux\f[R] (Rocky Linux)
.IP \(bu 2
\f[CR]siduction\f[R] (Siduction)
.IP \(bu 2
\f[CR]slackware\f[R] (Slackware)
.IP \(bu 2
\f[CR]slax\f[R] (Slax)
.IP \(bu 2
\f[CR]slint\f[R] (Slint)
.IP \(bu 2
\f[CR]slitaz\f[R] (SliTaz)
.IP \(bu 2
\f[CR]solus\f[R] (Solus)
.IP \(bu 2
\f[CR]sparkylinux\f[R] (SparkyLinux)
.IP \(bu 2
\f[CR]spirallinux\f[R] (SpiralLinux)
.IP \(bu 2
\f[CR]tails\f[R] (Tails)
.IP \(bu 2
\f[CR]tinycore\f[R] (Tiny Core Linux)
.IP \(bu 2
\f[CR]trisquel\f[R] (Trisquel)
.IP \(bu 2
\f[CR]tuxedo\-os\f[R] (Tuxedo OS)
.IP \(bu 2
\f[CR]vanillaos\f[R] (Vanilla OS)
.IP \(bu 2
\f[CR]void\f[R] (Void Linux)
.IP \(bu 2
\f[CR]zorin\f[R] (Zorin OS)
.SS \c
.UR https://github.com/quickemu-project/quickemu/wiki/02-Create-Linux-virtual-machines#manually-create-linux-guests
Custom Linux guests
.UE \c
Or you can download a Linux image and manually create a VM
configuration.
.IP \(bu 2
Download a .iso image of a Linux distribution
.IP \(bu 2
Create a VM configuration file; for example
\f[CR]debian\-bullseye.conf\f[R]
.IP
.EX
guest_os=\(dqlinux\(dq
disk_img=\(dqdebian\-bullseye/disk.qcow2\(dq
iso=\(dqdebian\-bullseye/firmware\-11.0.0\-amd64\-DVD\-1.iso\(dq
.EE
.IP \(bu 2
Use \f[CR]quickemu\f[R] to start the virtual machine:
.IP
.EX
quickemu \-\-vm debian\-bullseye.conf
.EE
.IP \(bu 2
Complete the installation as normal.
.IP \(bu 2
Post\-install:
.RS 2
.IP \(bu 2
Install the SPICE agent (\f[CR]spice\-vdagent\f[R]) in the guest to
enable copy/paste and USB redirection.
.IP \(bu 2
Install the SPICE WebDAV agent (\f[CR]spice\-webdavd\f[R]) in the guest
to enable file sharing.
.RE
.SS Supporting old Linux distros
If you want to run an old Linux , from 2016 or earlier, change the
\f[CR]guest_os\f[R] to \f[CR]linux_old\f[R].
This will enable the \f[CR]vmware\-svga\f[R] graphics driver which is
better supported on older distros.
.SS \c
.UR https://github.com/quickemu-project/quickemu/wiki/03-Create-macOS-virtual-machines#automatically-create-macos-guests
Creating macOS Guests
.UE \c
\ 🍏
\f[B]Installing macOS in a VM can be a bit finicky, if you encounter
problems, \c
.UR https://github.com/quickemu-project/quickemu/discussions
check the Discussions
.UE \c
\ for solutions or ask for help there\f[R] 🛟
.PP
\f[CR]quickget\f[R] automatically downloads a macOS recovery image and
creates a virtual machine configuration.
.PP
Note: Some VPN users may need to \c
.UR https://github.com/quickemu-project/quickemu/issues/1391#issuecomment-3506845235
turn off their VPN
.UE \c
\ in order to download a recovery image.
Some other users may find \c
.UR https://github.com/quickemu-project/quickemu/issues/1391#issuecomment-2429146013
using a VPN
.UE \c
\ necessary in order to download a recovery image.
.IP
.EX
quickget macos big\-sur
quickemu \-\-vm macos\-big\-sur.conf
.EE
.PP
macOS \f[CR]mojave\f[R], \f[CR]catalina\f[R], \f[CR]big\-sur\f[R],
\f[CR]monterey\f[R], \f[CR]ventura\f[R] and \f[CR]sonoma\f[R] are
supported.
.IP \(bu 2
Use cursor keys and enter key to select the \f[B]macOS Base System\f[R]
.IP \(bu 2
From \f[B]macOS Utilities\f[R]
.RS 2
.IP \(bu 2
Click \f[B]Disk Utility\f[R] and \f[B]Continue\f[R]
.RS 2
.IP \(bu 2
Select \f[CR]QEMU HARDDISK Media\f[R] (\(ti103.08GB) from the list (on
Big Sur and above use \f[CR]Apple Inc. VirtIO Block Device\f[R]) and
click \f[B]Erase\f[R].
.IP \(bu 2
Enter a \f[CR]Name:\f[R] for the disk
.IP \(bu 2
If you are installing macOS Mojave or later (Catalina, Big Sur,
Monterey, Ventura and Sonoma), choose any of the APFS options as the
filesystem.
MacOS Extended may not work.
.RE
.IP \(bu 2
Click \f[B]Erase\f[R].
.IP \(bu 2
Click \f[B]Done\f[R].
.IP \(bu 2
Close Disk Utility
.RE
.IP \(bu 2
From \f[B]macOS Utilities\f[R]
.RS 2
.IP \(bu 2
Click \f[B]Reinstall macOS\f[R] and \f[B]Continue\f[R]
.RE
.IP \(bu 2
Complete the installation as you normally would.
.RS 2
.IP \(bu 2
On the first reboot use cursor keys and enter key to select \f[B]macOS
Installer\f[R]
.IP \(bu 2
On the subsequent reboots use cursor keys and enter key to select the
disk you named
.RE
.IP \(bu 2
Once you have finished installing macOS you will be presented with an
the out\-of\-the\-box first\-start wizard to configure various options
and set up your username and password
.IP \(bu 2
OPTIONAL: After you have concluded the out\-of\-the\-box wizard, you may
want to enable the TRIM feature that the computer industry created for
SSD disks.
This feature in our macOS installation will allow QuickEmu to compact
(shrink) your macOS disk image whenever you delete files inside the
Virtual Machine.
Without this step your macOS disk image will only ever get larger and
will not shrink even when you delete lots of data inside macOS.
.RS 2
.IP \(bu 2
To enable TRIM, open the Terminal application and type the following
command followed by pressing enter to tell macos to use the TRIM command
on the hard disk when files are deleted:
.RE
.IP
.EX
sudo trimforce enable
.EE
.PP
You will be prompted to enter your account\(aqs password to gain the
privilege needed.
Once you\(aqve entered your password and pressed enter the command will
request confirmation in the form of two questions that require you to
type y (for a \(dqyes\(dq response) followed by enter to confirm.
.PP
If you press enter without first typing y the system will consider that
a negative response as though you said \(dqno\(dq:
.IP
.EX
IMPORTANT NOTICE: This tool force\-enables TRIM for all relevant attached devices, even though such devices may not have been validated for data integrity while using TRIM. Use of this tool to enable TRIM may result in unintended data loss or data corruption. It should not be used in a commercial operating environment or with important data. Before using this tool, you should back up all of your data and regularly back up data while TRIM is enabled. This tool is provided on an \(dqas is\(dq basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON\-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THIS TOOL OR ITS USE ALONE OR IN COMBINATION WITH YOUR DEVICES, SYSTEMS, OR SERVICES. BY USING THIS TOOL TO ENABLE TRIM, YOU AGREE THAT, TO THE EXTENT PERMITTED BY APPLICABLE LAW, USE OF THE TOOL IS AT YOUR SOLE RISK AND THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND EFFORT IS WITH YOU.
Are you sure you with to proceed (y/N)?
.EE
.PP
And a second confirmation once you\(aqve confirmed the previous one:
.IP
.EX
Your system will immediately reboot when this is complete.
Is this OK (y/N)?
.EE
.PP
As the last message states, your system will automatically reboot as
soon as the command completes.
.PP
The default macOS configuration looks like this:
.IP
.EX
guest_os=\(dqmacos\(dq
img=\(dqmacos\-big\-sur/RecoveryImage.img\(dq
disk_img=\(dqmacos\-big\-sur/disk.qcow2\(dq
macos_release=\(dqbig\-sur\(dq
.EE
.IP \(bu 2
\f[CR]guest_os=\(dqmacos\(dq\f[R] instructs Quickemu to optimise for
macOS.
.IP \(bu 2
\f[CR]macos_release=\(dqbig\-sur\(dq\f[R] instructs Quickemu to optimise
for a particular macOS release.
.RS 2
.IP \(bu 2
For example VirtIO Network and Memory Ballooning are available in Big
Sur and newer, but not previous releases.
.IP \(bu 2
And VirtIO Block Media (disks) are supported/stable in Catalina and
newer.
.RE
.SH macOS compatibility
There are some considerations when running macOS via Quickemu.
.IP \(bu 2
Supported macOS releases:
.RS 2
.IP \(bu 2
Mojave
.IP \(bu 2
Catalina
.IP \(bu 2
Big Sur
.IP \(bu 2
Monterey
.IP \(bu 2
Ventura
.IP \(bu 2
Sonoma
.RE
.IP \(bu 2
\f[CR]quickemu\f[R] will automatically download the required \c
.UR https://github.com/acidanthera/OpenCorePkg
OpenCore
.UE \c
\ bootloader and OVMF firmware from \c
.UR https://github.com/kholia/OSX-KVM
OSX\-KVM
.UE \c
\&.
.IP \(bu 2
Optimised by default, but no GPU acceleration is available.
.RS 2
.IP \(bu 2
Host CPU vendor is detected and guest CPU is optimised accordingly.
.IP \(bu 2
\c
.UR https://www.kraxel.org/blog/2019/06/macos-qemu-guest/
VirtIO Block Media
.UE \c
\ is used for the system disk where supported.
.IP \(bu 2
\c
.UR http://philjordan.eu/osx-virt/
VirtIO \f[CR]usb\-tablet\f[R]
.UE \c
\ is used for the mouse.
.IP \(bu 2
VirtIO Network (\f[CR]virtio\-net\f[R]) is supported and enabled on
macOS Big Sur and newer, but earlier releases use \f[CR]vmxnet3\f[R].
.IP \(bu 2
VirtIO Memory Ballooning is supported and enabled on macOS Big Sur and
newer but disabled for other support macOS releases.
.RE
.IP \(bu 2
USB host and SPICE pass\-through is:
.RS 2
.IP \(bu 2
UHCI (USB 2.0) on macOS Catalina and earlier.
.IP \(bu 2
XHCI (USB 3.0) on macOS Big Sur and newer.
.RE
.IP \(bu 2
Display resolution can be changed via \f[CR]quickemu\f[R] using
\f[CR]\-\-width\f[R] and \f[CR]\-\-height\f[R] command line arguments.
.IP \(bu 2
\f[B]Full Duplex audio requires \c
.UR https://github.com/chris1111/VoodooHDA-OC
VoodooHDA OC
.UE \c
\ or pass\-through a USB audio\-device to the macOS guest VM\f[R].
.RS 2
.IP \(bu 2
NOTE!
\c
.UR https://disable-gatekeeper.github.io/
Gatekeeper
.UE \c
\ and \c
.UR https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection
System Integrity Protection (SIP)
.UE \c
\ need to be disabled to install VoodooHDA OC
.RE
.IP \(bu 2
File sharing between guest and host is available via \c
.UR https://wiki.qemu.org/Documentation/9psetup
virtio\-9p
.UE \c
\ and \c
.UR https://gitlab.gnome.org/GNOME/phodav/-/merge_requests/24
SPICE webdavd
.UE \c
\&.
.IP \(bu 2
Copy/paste via SPICE agent is \f[B]not available on macOS\f[R].
.SH macOS App Store
If you see \f[I]\(dqYour device or computer could not be
verified\(dq\f[R] when you try to login to the App Store, make sure that
your wired ethernet device is \f[CR]en0\f[R].
Use \f[CR]ifconfig\f[R] in a terminal to verify this.
.PP
If the wired ethernet device is not \f[CR]en0\f[R], then then go to
\f[I]System Preferences\f[R] \-> \f[I]Network\f[R], delete all the
network devices and apply the changes.
Next, open a terminal and run the following:
.IP
.EX
sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
.EE
.PP
Now reboot, and the App Store should work.
.PP
There may be further advice and information about macOS guests in the
project \c
.UR https://github.com/quickemu-project/quickemu/wiki/03-Create-macOS-virtual-machines#automatically-create-macos-guests
wiki
.UE \c
\&.
.SS \c
.UR https://github.com/quickemu-project/quickemu/wiki/04-Create-Windows-virtual-machines
Creating Windows guests
.UE \c
\ 🪟
\f[CR]quickget\f[R] can download \c
.UR https://www.microsoft.com/software-download/windows10
\f[B]Windows 10\f[R]
.UE \c
\ and \c
.UR https://www.microsoft.com/software-download/windows11
\f[B]Windows 11\f[R]
.UE \c
\ automatically and create an optimised virtual machine configuration.
This configuration also includes the \c
.UR https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/
VirtIO drivers for Windows
.UE \c
\&.
.PP
\f[B]Windows 8.1\f[R] is also supported but doesn\(aqt feature any
automated installation or driver optimisation.
.PP
\f[CR]quickget\f[R] can also download \c
.UR https://www.microsoft.com/en-us/evalcenter/download-windows-10-enterprise
Windows 10 LTSC
.UE \c
\ and Windows Server \c
.UR https://www.microsoft.com/en-us/evalcenter/download-windows-server-2012-r2
2012\-r2
.UE \c
, \c
.UR https://www.microsoft.com/en-us/evalcenter/download-windows-server-2016
2016
.UE \c
, \c
.UR https://www.microsoft.com/en-us/evalcenter/download-windows-server-2019
2019
.UE \c
, and \c
.UR https://www.microsoft.com/en-us/evalcenter/download-windows-server-2022
2022
.UE \c
\&.
No automated installation is supported for these releases.
.IP
.EX
quickget windows 11
quickemu \-\-vm windows\-11.conf
.EE
.IP \(bu 2
Complete the installation as you normally would.
.IP \(bu 2
All relevant drivers and services should be installed automatically.
.IP \(bu 2
A local administrator user account is automatically created, with these
credentials:
.RS 2
.IP \(bu 2
Username: \f[CR]Quickemu\f[R]
.IP \(bu 2
Password: \f[CR]quickemu\f[R]
.RE
.PP
Further information is available from the project \c
.UR https://github.com/quickemu-project/quickemu/wiki/04-Create-Windows-virtual-machines
wiki
.UE \c
.SH AUTHORS
Written by Martin Wimpress.
.SH BUGS
Submit bug reports online at: \c
.UR https://github.com/quickemu-project/quickemu/issues
.UE \c
.SH SEE ALSO
Full sources at: \c
.UR https://github.com/quickemu-project/quickemu
.UE \c
.PP
quickemu(1), quickemu_conf(5), quickgui(1)
.SH AUTHORS
Martin Wimpress.
================================================
FILE: docs/quickget.1.md
================================================
---
author: Martin Wimpress
date: February 2, 2026
footer: quickget
header: Quickget User Manual
section: 1
title: QUICKGET
---
# NAME
quickget - download and prepare materials for building a quickemu VM
# SYNOPSIS
**quickget** \[*os*\] \[*release*\] \[*edition*\] \| \[*OPTION*\]\*
# DESCRIPTION
**quickget** will download the requisite materials and prepare a
configuration for `quickemu` to use to build and run
# OPTIONS
**\[OS\] \[Release\] \[Edition\]**
: specify the OS and release (and optional edition) if insufficient
input is provided a list of missing options will be reported and the
script will exit. Editions may not apply and will be defaulted if
not provided.
**--download** \[edition\]
: Download image; no VM configuration
**--create-config** \[path/url\]
: Create VM config for a OS image
**--open-homepage**
: Open homepage for the OS
**--show** \[os\]
: Show OS information
**--url** \[os\] \[release\] \[edition\]
: Show image URL(s)
**--check** \[os\] \[release\] \[edition\]
: Check image URL(s)
**--list**
: List all supported systems
**--list-csv**
: List everything in csv format
**--list-json**
: List everything in json format
**--version**
: Show version
**--help**
: Show this help message
# NOTES
## Creating Linux guests 🐧
### Ubuntu
`quickget` will automatically download an Ubuntu release and create the
virtual machine configuration.
``` shell
quickget ubuntu 22.04
quickemu --vm ubuntu-22.04.conf
```
- Complete the installation as normal.
- Post-install:
- Install the SPICE agent (`spice-vdagent`) in the guest to enable
copy/paste and USB redirection
- `sudo apt install spice-vdagent`
- Install the SPICE WebDAV agent (`spice-webdavd`) in the guest to
enable file sharing.
- `sudo apt install spice-webdavd`
### Ubuntu daily-live images
`quickget` can also download/refresh daily-live images via `zsync` for
Ubuntu developers and testers.
``` shell
quickget ubuntu daily-live
quickemu --vm ubuntu-daily-live.conf
```
You can run `quickget ubuntu daily-live` to refresh your daily
development image as often as you like, it will even automatically
switch to a new series.
### Ubuntu Flavours
All the official Ubuntu flavours are supported, just replace `ubuntu`
with your preferred flavour.
The project
[wiki](https://github.com/quickemu-project/quickemu/wiki/02-Create-Linux-virtual-machines)
may have further information.
- `edubuntu` (Edubuntu)
- `kubuntu` (Kubuntu)
- `lubuntu` (Lubuntu)
- `ubuntu-budgie` (Ubuntu Budgie)
- `ubuntucinnamon` (Ubuntu Cinnamon)
- `ubuntukylin` (Ubuntu Kylin)
- `ubuntu-mate` (Ubuntu MATE)
- `ubuntu-server` (Ubuntu Server)
- `ubuntustudio` (Ubuntu Studio)
- `ubuntu` (Ubuntu)
- `ubuntu-unity` (Ubuntu Unity)
- `xubuntu` (Xubuntu)
You can also use `quickget` with advanced options :
``` text
--arch : Set architecture (arm64, aarch64, amd64, x86_64)
--download [edition] : Download image; no VM configuration
--create-config [path/url] [flags] : Create VM config for an OS image
--open-homepage : Open homepage for the OS
--show [os] : Show OS information
--version : Show version
--help : Show this help message
------------------------------------ Flags -------------------------------------
--create-config:
--disable-unattended : Force quickget not to set up an unattended installation
-------------------------- For testing & development ---------------------------
--url [os] [release] [edition] : Show image URL(s)
--check [os] [release] [edition] : Check image URL(s)
--check-all-arch [os] [release] [edition] : Check downloads for all architectures (amd64 and arm64)
--list : List all supported systems
--list-csv : List everything in csv format
--list-json : List everything in json format
```
Here are some typical uses
``` shell
# show an OS ISO download URL for {os} {release} [edition]
quickget --url fedora 38 Silverblue
# test if an OS ISO is available for {os} {release} [edition]
quickget --check nixos unstable plasma5
# open an OS distribution homepage in a browser
quickget --open-homepage ubuntu-mate
# Only download image file into current directory, without creating VM
quickget --download elementary 7.1
```
The `--url`, `--check`, and `--download` options are fully functional
for all operating systems, including Windows and macOS.
Further information is available from the project
[wiki](https://github.com/quickemu-project/quickemu/wiki/06-Advanced-quickget-features)
### Other Operating Systems
`quickget` also supports:
- `alma` (AlmaLinux)
- `alpine` (Alpine Linux)
- `android` (Android x86)
- `antix` (Antix)
- `archcraft` (Archcraft)
- `archlinux` (Arch Linux)
- `artixlinux` (Artix Linux)
- `azurelinux` (Azure Linux)
- `batocera` (Batocera)
- `bazzite` (Bazzite)
- `biglinux` (BigLinux)
- `blendos` (BlendOS)
- `bodhi` (Bodhi)
- `bunsenlabs` (BunsenLabs)
- `cachyos` (CachyOS)
- `centos-stream` (CentOS Stream)
- `chimeralinux` (Chimera Linux)
- `crunchbang++` (Crunchbangplusplus)
- `debian` (Debian)
- `deepin` (Deepin)
- `devuan` (Devuan)
- `dragonflybsd` (DragonFlyBSD)
- `easyos` (EasyOS)
- `elementary` (elementary OS)
- `endeavouros` (EndeavourOS)
- `endless` (Endless OS)
- `fedora` (Fedora)
- `freebsd` (FreeBSD)
- `freedos` (FreeDOS)
- `garuda` (Garuda Linux)
- `gentoo` (Gentoo)
- `ghostbsd` (GhostBSD)
- `gnomeos` (GNOME OS)
- `guix` (Guix)
- `haiku` (Haiku)
- `kali` (Kali)
- `kdeneon` (KDE Neon)
- `kolibrios` (KolibriOS)
- `linuxlite` (Linux Lite)
- `linuxmint` (Linux Mint)
- `lmde` (Linux Mint Debian Edition)
- `maboxlinux` (Mabox Linux)
- `mageia` (Mageia)
- `manjaro` (Manjaro)
- `mxlinux` (MX Linux)
- `netboot` (netboot.xyz)
- `netbsd` (NetBSD)
- `nitrux` (Nitrux)
- `nixos` (NixOS)
- `nwg-shell` (nwg-shell)
- `openbsd` (OpenBSD)
- `openindiana` (OpenIndiana)
- `opensuse` (openSUSE)
- `oraclelinux` (Oracle Linux)
- `parrotsec` (Parrot Security)
- `pclinuxos` (PCLinuxOS)
- `peppermint` (PeppermintOS)
- `popos` (Pop!\_OS)
- `porteus` (Porteus)
- `primtux` (PrimTux)
- `proxmox-ve` (Proxmox VE)
- `pureos` (PureOS)
- `reactos` (ReactOS)
- `rebornos` (RebornOS)
- `rockylinux` (Rocky Linux)
- `siduction` (Siduction)
- `slackware` (Slackware)
- `slax` (Slax)
- `slint` (Slint)
- `slitaz` (SliTaz)
- `solus` (Solus)
- `sparkylinux` (SparkyLinux)
- `spirallinux` (SpiralLinux)
- `tails` (Tails)
- `tinycore` (Tiny Core Linux)
- `trisquel` (Trisquel)
- `tuxedo-os` (Tuxedo OS)
- `vanillaos` (Vanilla OS)
- `void` (Void Linux)
- `zorin` (Zorin OS)
### [Custom Linux guests](https://github.com/quickemu-project/quickemu/wiki/02-Create-Linux-virtual-machines#manually-create-linux-guests)
Or you can download a Linux image and manually create a VM
configuration.
- Download a .iso image of a Linux distribution
- Create a VM configuration file; for example `debian-bullseye.conf`
``` shell
guest_os="linux"
disk_img="debian-bullseye/disk.qcow2"
iso="debian-bullseye/firmware-11.0.0-amd64-DVD-1.iso"
```
- Use `quickemu` to start the virtual machine:
``` shell
quickemu --vm debian-bullseye.conf
```
- Complete the installation as normal.
- Post-install:
- Install the SPICE agent (`spice-vdagent`) in the guest to enable
copy/paste and USB redirection.
- Install the SPICE WebDAV agent (`spice-webdavd`) in the guest to
enable file sharing.
## Supporting old Linux distros
If you want to run an old Linux , from 2016 or earlier, change the
`guest_os` to `linux_old`. This will enable the `vmware-svga` graphics
driver which is better supported on older distros.
## [Creating macOS Guests](https://github.com/quickemu-project/quickemu/wiki/03-Create-macOS-virtual-machines#automatically-create-macos-guests) 🍏
**Installing macOS in a VM can be a bit finicky, if you encounter
problems, [check the
Discussions](https://github.com/quickemu-project/quickemu/discussions)
for solutions or ask for help there** 🛟
`quickget` automatically downloads a macOS recovery image and creates a
virtual machine configuration.
Note: Some VPN users may need to [turn off their
VPN](https://github.com/quickemu-project/quickemu/issues/1391#issuecomment-3506845235)
in order to download a recovery image. Some other users may find [using
a
VPN](https://github.com/quickemu-project/quickemu/issues/1391#issuecomment-2429146013)
necessary in order to download a recovery image.
``` shell
quickget macos big-sur
quickemu --vm macos-big-sur.conf
```
macOS `mojave`, `catalina`, `big-sur`, `monterey`, `ventura` and
`sonoma` are supported.
- Use cursor keys and enter key to select the **macOS Base System**
- From **macOS Utilities**
- Click **Disk Utility** and **Continue**
- Select `QEMU HARDDISK Media` (~103.08GB) from the list (on Big Sur
and above use `Apple Inc. VirtIO Block Device`) and click
**Erase**.
- Enter a `Name:` for the disk
- If you are installing macOS Mojave or later (Catalina, Big Sur,
Monterey, Ventura and Sonoma), choose any of the APFS options as
the filesystem. MacOS Extended may not work.
- Click **Erase**.
- Click **Done**.
- Close Disk Utility
- From **macOS Utilities**
- Click **Reinstall macOS** and **Continue**
- Complete the installation as you normally would.
- On the first reboot use cursor keys and enter key to select **macOS
Installer**
- On the subsequent reboots use cursor keys and enter key to select
the disk you named
- Once you have finished installing macOS you will be presented with an
the out-of-the-box first-start wizard to configure various options and
set up your username and password
- OPTIONAL: After you have concluded the out-of-the-box wizard, you may
want to enable the TRIM feature that the computer industry created for
SSD disks. This feature in our macOS installation will allow QuickEmu
to compact (shrink) your macOS disk image whenever you delete files
inside the Virtual Machine. Without this step your macOS disk image
will only ever get larger and will not shrink even when you delete
lots of data inside macOS.
- To enable TRIM, open the Terminal application and type the following
command followed by pressing enter to tell macos to use
the TRIM command on the hard disk when files are deleted:
``` shell
sudo trimforce enable
```
You will be prompted to enter your account's password to gain the
privilege needed. Once you've entered your password and pressed
enter the command will request confirmation in the form of
two questions that require you to type y (for a "yes"
response) followed by enter to confirm.
If you press enter without first typing y the
system will consider that a negative response as though you said "no":
``` plain
IMPORTANT NOTICE: This tool force-enables TRIM for all relevant attached devices, even though such devices may not have been validated for data integrity while using TRIM. Use of this tool to enable TRIM may result in unintended data loss or data corruption. It should not be used in a commercial operating environment or with important data. Before using this tool, you should back up all of your data and regularly back up data while TRIM is enabled. This tool is provided on an "as is" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THIS TOOL OR ITS USE ALONE OR IN COMBINATION WITH YOUR DEVICES, SYSTEMS, OR SERVICES. BY USING THIS TOOL TO ENABLE TRIM, YOU AGREE THAT, TO THE EXTENT PERMITTED BY APPLICABLE LAW, USE OF THE TOOL IS AT YOUR SOLE RISK AND THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND EFFORT IS WITH YOU.
Are you sure you with to proceed (y/N)?
```
And a second confirmation once you've confirmed the previous one:
``` plain
Your system will immediately reboot when this is complete.
Is this OK (y/N)?
```
As the last message states, your system will automatically reboot as
soon as the command completes.
The default macOS configuration looks like this:
``` shell
guest_os="macos"
img="macos-big-sur/RecoveryImage.img"
disk_img="macos-big-sur/disk.qcow2"
macos_release="big-sur"
```
- `guest_os="macos"` instructs Quickemu to optimise for macOS.
- `macos_release="big-sur"` instructs Quickemu to optimise for a
particular macOS release.
- For example VirtIO Network and Memory Ballooning are available in
Big Sur and newer, but not previous releases.
- And VirtIO Block Media (disks) are supported/stable in Catalina and
newer.
# macOS compatibility
There are some considerations when running macOS via Quickemu.
- Supported macOS releases:
- Mojave
- Catalina
- Big Sur
- Monterey
- Ventura
- Sonoma
- `quickemu` will automatically download the required
[OpenCore](https://github.com/acidanthera/OpenCorePkg) bootloader and
OVMF firmware from [OSX-KVM](https://github.com/kholia/OSX-KVM).
- Optimised by default, but no GPU acceleration is available.
- Host CPU vendor is detected and guest CPU is optimised accordingly.
- [VirtIO Block
Media](https://www.kraxel.org/blog/2019/06/macos-qemu-guest/) is
used for the system disk where supported.
- [VirtIO `usb-tablet`](http://philjordan.eu/osx-virt/) is used for
the mouse.
- VirtIO Network (`virtio-net`) is supported and enabled on macOS Big
Sur and newer, but earlier releases use `vmxnet3`.
- VirtIO Memory Ballooning is supported and enabled on macOS Big Sur
and newer but disabled for other support macOS releases.
- USB host and SPICE pass-through is:
- UHCI (USB 2.0) on macOS Catalina and earlier.
- XHCI (USB 3.0) on macOS Big Sur and newer.
- Display resolution can be changed via `quickemu` using `--width` and
`--height` command line arguments.
- **Full Duplex audio requires [VoodooHDA
OC](https://github.com/chris1111/VoodooHDA-OC) or pass-through a USB
audio-device to the macOS guest VM**.
- NOTE! [Gatekeeper](https://disable-gatekeeper.github.io/) and
[System Integrity Protection
(SIP)](https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection)
need to be disabled to install VoodooHDA OC
- File sharing between guest and host is available via
[virtio-9p](https://wiki.qemu.org/Documentation/9psetup) and [SPICE
webdavd](https://gitlab.gnome.org/GNOME/phodav/-/merge_requests/24).
- Copy/paste via SPICE agent is **not available on macOS**.
# macOS App Store
If you see *"Your device or computer could not be verified"* when you
try to login to the App Store, make sure that your wired ethernet device
is `en0`. Use `ifconfig` in a terminal to verify this.
If the wired ethernet device is not `en0`, then then go to *System
Preferences* -\> *Network*, delete all the network devices and apply the
changes. Next, open a terminal and run the following:
``` shell
sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
```
Now reboot, and the App Store should work.
There may be further advice and information about macOS guests in the
project
[wiki](https://github.com/quickemu-project/quickemu/wiki/03-Create-macOS-virtual-machines#automatically-create-macos-guests).
## [Creating Windows guests](https://github.com/quickemu-project/quickemu/wiki/04-Create-Windows-virtual-machines) 🪟
`quickget` can download [**Windows
10**](https://www.microsoft.com/software-download/windows10) and
[**Windows 11**](https://www.microsoft.com/software-download/windows11)
automatically and create an optimised virtual machine configuration.
This configuration also includes the [VirtIO drivers for
Windows](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/).
**Windows 8.1** is also supported but doesn't feature any automated
installation or driver optimisation.
`quickget` can also download [Windows 10
LTSC](https://www.microsoft.com/en-us/evalcenter/download-windows-10-enterprise)
and Windows Server
[2012-r2](https://www.microsoft.com/en-us/evalcenter/download-windows-server-2012-r2),
[2016](https://www.microsoft.com/en-us/evalcenter/download-windows-server-2016),
[2019](https://www.microsoft.com/en-us/evalcenter/download-windows-server-2019),
and
[2022](https://www.microsoft.com/en-us/evalcenter/download-windows-server-2022).
No automated installation is supported for these releases.
``` shell
quickget windows 11
quickemu --vm windows-11.conf
```
- Complete the installation as you normally would.
- All relevant drivers and services should be installed automatically.
- A local administrator user account is automatically created, with
these credentials:
- Username: `Quickemu`
- Password: `quickemu`
Further information is available from the project
[wiki](https://github.com/quickemu-project/quickemu/wiki/04-Create-Windows-virtual-machines)
# AUTHORS
Written by Martin Wimpress.
# BUGS
Submit bug reports online at:
# SEE ALSO
Full sources at:
quickemu(1), quickemu_conf(5), quickgui(1)
================================================
FILE: flake.lock
================================================
{
"nodes": {
"flake-schemas": {
"locked": {
"lastModified": 1772200446,
"narHash": "sha256-hcUPpu25+VLvQsf961cu4zTeA//Ab35MaMjqSS/Ojqc=",
"rev": "d6a6b7cfa25bea552c197c9e227cd293ff801dbb",
"revCount": 115,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.3.0/019c9f61-e746-760e-a1fe-53f05b10d026/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%2A.tar.gz"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1771848320,
"narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2fc6539b481e1d2569f25f8799236694180c0993",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-schemas": "flake-schemas",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
================================================
FILE: flake.nix
================================================
{
description = "Quickemu flake";
inputs = {
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs =
{
self,
flake-schemas,
nixpkgs,
}:
let
# Define supported systems and a helper function for generating system-specific outputs
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
"aarch64-linux"
];
forEachSupportedSystem =
f:
nixpkgs.lib.genAttrs supportedSystems (
system:
f {
system = system;
pkgs = import nixpkgs { inherit system; };
}
);
in
{
# Define schemas for the flake's outputs
schemas = flake-schemas.schemas;
# Define overlays for each supported system
overlays = {
default =
final: prev:
let
# OVMF is only available/needed on Linux
ovmfArgs =
if final.stdenv.hostPlatform.isLinux then
{ }
else
{
OVMF = null;
OVMFFull = null;
};
in
{
quickemu = final.callPackage ./package.nix ovmfArgs;
};
};
# Define packages for each supported system
packages = forEachSupportedSystem (
{ pkgs, system, ... }:
let
# OVMF is only available/needed on Linux
ovmfArgs =
if pkgs.stdenv.hostPlatform.isLinux then
{ }
else
{
OVMF = null;
OVMFFull = null;
};
in
rec {
quickemu = pkgs.callPackage ./package.nix ovmfArgs;
default = quickemu;
}
);
# Define devShells for each supported system
devShells = forEachSupportedSystem (
{ pkgs, system, ... }:
let
# OVMF is only available/needed on Linux
ovmfArgs =
if pkgs.stdenv.hostPlatform.isLinux then
{ }
else
{
OVMF = null;
OVMFFull = null;
};
in
{
default = pkgs.callPackage ./devshell.nix ovmfArgs;
}
);
};
}
================================================
FILE: package.nix
================================================
{
lib,
fetchFromGitHub,
installShellFiles,
makeWrapper,
stdenv,
testers,
cdrtools,
curl,
gawk,
gnugrep,
gnused,
jq,
mesa-demos,
pciutils,
procps,
python3,
qemu_full,
samba,
socat,
spice-gtk,
swtpm,
unzip,
usbutils,
util-linux,
xdg-user-dirs,
xrandr,
zsync,
OVMF ? null,
OVMFFull ? null,
}:
let
runtimePaths = [
cdrtools
curl
gawk
gnugrep
gnused
jq
pciutils
procps
python3
qemu_full
samba
socat
swtpm
unzip
util-linux
xrandr
zsync
]
++ lib.optionals stdenv.hostPlatform.isLinux [
mesa-demos
OVMF
OVMFFull
usbutils
xdg-user-dirs
];
# Extract version using builtins.split to avoid regex backtracking on large files.
# builtins.match with .* patterns on multi-kilobyte files can cause stack overflow.
versionParts = builtins.split "readonly VERSION=\"([0-9]+\\.[0-9]+\\.[0-9]+)\"" (
builtins.readFile ./quickemu
);
version = builtins.elemAt (builtins.elemAt versionParts 1) 0;
in
stdenv.mkDerivation (finalAttrs: {
pname = "quickemu";
version = version;
src = lib.cleanSource ./.;
postPatch = ''
sed -i \
${
lib.optionalString (OVMF != null && OVMFFull != null) ''
-e '/OVMF_CODE_4M.secboot.fd/s|ovmfs=(|ovmfs=("${OVMFFull.firmware}","${OVMFFull.variablesMs}" |' \
-e '/OVMF_CODE_4M.fd/s|ovmfs=(|ovmfs=("${OVMF.firmware}","${OVMF.variables}" |' \
''
} \
-e '/cp "''${VARS_IN}" "''${VARS_OUT}"/a chmod +w "''${VARS_OUT}"' \
-e 's/Icon=.*qemu.svg/Icon=qemu/' \
-e 's,\$(command -v smbd),${samba}/bin/smbd,' \
quickemu
'';
nativeBuildInputs = [
makeWrapper
installShellFiles
];
installPhase = ''
runHook preInstall
installManPage docs/quickget.1 docs/quickemu.1 docs/quickemu_conf.5
install -Dm755 -t "$out/bin" chunkcheck quickemu quickget quickreport
# spice-gtk needs to be put in suffix so that when virtualisation.spiceUSBRedirection
# is enabled, the wrapped spice-client-glib-usb-acl-helper is used
for f in chunkcheck quickget quickemu quickreport; do
wrapProgram $out/bin/$f \
--prefix PATH : "${lib.makeBinPath runtimePaths}" \
--suffix PATH : "${lib.makeBinPath [ spice-gtk ]}"
done
runHook postInstall
'';
passthru.tests = testers.testVersion { package = finalAttrs.finalPackage; };
meta = {
description = "Quickly create and run optimised Windows, macOS and Linux virtual machines";
homepage = "https://github.com/quickemu-project/quickemu";
changelog = "https://github.com/quickemu-project/quickemu/releases/tag/${finalAttrs.version}";
mainProgram = "quickemu";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
fedx-sudo
flexiondotorg
];
};
})
================================================
FILE: quickemu
================================================
#!/usr/bin/env bash
export LC_ALL=C
if ((BASH_VERSINFO[0] < 4)); then
echo "Sorry, you need bash 4.0 or newer to run this script."
exit 1
fi
function ignore_msrs_always() {
# Make sure the host has /etc/modprobe.d
if [ -d /etc/modprobe.d ]; then
# Skip if ignore_msrs is already enabled, assumes initramfs has been rebuilt
if ! grep -lq 'ignore_msrs=Y' /etc/modprobe.d/kvm-quickemu.conf >/dev/null 2>&1; then
echo "options kvm ignore_msrs=Y" | sudo tee /etc/modprobe.d/kvm-quickemu.conf
sudo update-initramfs -k all -u
fi
else
echo "ERROR! /etc/modprobe.d was not found, I don't know how to configure this system."
exit 1
fi
}
function ignore_msrs_alert() {
local ignore_msrs=""
if [ "${OS_KERNEL}" == "Darwin" ]; then
return
elif [ -e /sys/module/kvm/parameters/ignore_msrs ]; then
ignore_msrs=$(cat /sys/module/kvm/parameters/ignore_msrs)
if [ "${ignore_msrs}" == "N" ]; then
echo " - MSR: WARNING! Ignoring unhandled Model-Specific Registers is disabled."
echo
echo " echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs"
echo
echo " If you are unable to run macOS or Windows VMs then run the above 👆"
echo " This will enable ignoring of unhandled MSRs until you reboot the host."
echo " You can make this change permanent by running: 'quickemu --ignore-msrs-always'"
fi
fi
}
# Check for TSC instability that can cause macOS Ventura+ to freeze on AMD Ryzen mobile CPUs.
# Returns 0 if check passes or user acknowledges warning, exits with 1 if user aborts.
# Reference: https://github.com/quickemu-project/quickemu/issues/1273
function check_macos_tsc_stability() {
# Gate 1: Only on Linux hosts
if [ "${OS_KERNEL}" != "Linux" ]; then
return 0
fi
# Gate 2: Only for AMD CPUs
if [ "${HOST_CPU_VENDOR}" != "AuthenticAMD" ]; then
return 0
fi
# Gate 3: Only for macOS guests
if [ "${guest_os}" != "macos" ]; then
return 0
fi
# Gate 4: Only for macOS Ventura (13) and newer
case ${macos_release} in
ventura|sonoma|sequoia|tahoe) ;;
*) return 0 ;;
esac
# Gate 5: Skip if user has already set tsc=reliable in kernel cmdline
local cmdline=""
if [ -r /proc/cmdline ]; then
cmdline=$(cat /proc/cmdline)
if [[ "${cmdline}" == *"tsc=reliable"* ]]; then
return 0
fi
fi
# Gate 6: Check if TSC is the current clocksource (indicates stable TSC)
local clocksource_path="/sys/devices/system/clocksource/clocksource0/current_clocksource"
local current_clocksource=""
if [ -r "${clocksource_path}" ]; then
current_clocksource=$(cat "${clocksource_path}")
if [ "${current_clocksource}" == "tsc" ]; then
return 0
fi
else
# Cannot determine clocksource - assume OK and let user discover issues
return 0
fi
# All gates failed - this system is at risk
# Check if warning should be skipped
if [ "${IGNORE_TSC_WARNING}" == "1" ]; then
echo " - TSC: WARNING! Unstable TSC detected (clocksource: ${current_clocksource})"
echo " Proceeding anyway due to --ignore-tsc-warning flag."
return 0
fi
# Display warning and prompt user
echo " - TSC: WARNING! Unstable TSC detected (clocksource: ${current_clocksource})"
echo " macOS ${macos_release^} may freeze on AMD Ryzen mobile CPUs."
echo
echo " Fix: Add 'tsc=reliable' to kernel boot parameters and reboot."
echo " Or: Use macOS Big Sur (11) or Monterey (12) instead."
echo " See: https://github.com/quickemu-project/quickemu/wiki/03-Create-macOS-virtual-machines#tsc-instability-on-amd-ryzen-mobile-cpus"
echo
# Log the warning
echo "TSC_WARNING: clocksource=${current_clocksource} macos_release=${macos_release} cpu_vendor=${HOST_CPU_VENDOR}" >> "${VMDIR}/${VMNAME}.log"
# Interactive prompt - check if stdin is a terminal
if [ -t 0 ]; then
echo -n "Do you want to continue anyway? [y/N] "
read -r response
case "${response}" in
[yY]|[yY][eE][sS])
echo " - TSC: Proceeding despite unstable TSC warning."
return 0
;;
*)
echo " - TSC: Aborting. Please apply one of the solutions above."
exit 1
;;
esac
else
# Non-interactive mode - abort by default for safety
echo "ERROR! Non-interactive mode detected. Use --ignore-tsc-warning to bypass this check."
exit 1
fi
}
function delete_shortcut() {
local SHORTCUT_DIR="${HOME}/.local/share/applications"
if [ -e "${SHORTCUT_DIR}/${VMNAME}.desktop" ]; then
rm "${SHORTCUT_DIR}/${VMNAME}.desktop"
echo " - Deleted ${SHORTCUT_DIR}/${VMNAME}.desktop"
fi
}
function delete_disk() {
echo "Deleting ${VMNAME} virtual hard disk"
if [ -e "${disk_img}" ]; then
rm "${disk_img}" >/dev/null 2>&1
# Remove any EFI vars, but not for macOS
rm "${VMDIR}"/OVMF_VARS*.fd >/dev/null 2>&1
rm "${VMDIR}/${VMNAME}-vars.fd" >/dev/null 2>&1
echo " - Deleted ${disk_img}"
delete_shortcut
else
echo " - ${disk_img} not found. Doing nothing."
fi
}
function delete_vm() {
echo "Deleting ${VMNAME} completely"
if [ -d "${VMDIR}" ]; then
rm -rf "${VMDIR}"
rm "${VM}"
echo " - Deleted ${VM} and ${VMDIR}/"
delete_shortcut
else
echo " - ${VMDIR} not found. Doing nothing."
fi
}
function kill_vm() {
echo "Killing ${VMNAME}"
if [ -z "${VM_PID}" ]; then
echo " - ${VMNAME} is not running."
rm -f "${VMDIR}/${VMNAME}.pid"
rm -f "${VMDIR}/${VMNAME}.spice"
rm -f "${VMDIR}/${VMNAME}.sock"
elif [ -n "${VM_PID}" ]; then
if kill -9 "${VM_PID}" > /dev/null 2>&1; then
echo " - ${VMNAME} (${VM_PID}) killed."
rm -f "${VMDIR}/${VMNAME}.pid"
rm -f "${VMDIR}/${VMNAME}.spice"
rm -f "${VMDIR}/${VMNAME}.sock"
else
echo " - ${VMNAME} (${VM_PID}) was not killed."
fi
elif [ ! -r "${VMDIR}/${VMNAME}.pid" ]; then
echo " - ${VMNAME} has no ${VMDIR}/${VMNAME}.pid"
fi
}
function snapshot_apply() {
echo "Snapshot apply to ${disk_img}"
local TAG="${1}"
if [ -z "${TAG}" ]; then
echo " - ERROR! No snapshot tag provided."
exit
fi
if [ -e "${disk_img}" ]; then
if ${QEMU_IMG} snapshot -q -a "${TAG}" "${disk_img}"; then
echo " - Applied snapshot '${TAG}' to ${disk_img}"
else
echo " - ERROR! Failed to apply snapshot '${TAG}' to ${disk_img}"
fi
else
echo " - NOTE! ${disk_img} not found. Doing nothing."
fi
}
function snapshot_create() {
echo "Snapshotting ${disk_img}"
local TAG="${1}"
if [ -z "${TAG}" ]; then
echo "- ERROR! No snapshot tag provided."
exit
fi
if [ -e "${disk_img}" ]; then
if ${QEMU_IMG} snapshot -q -c "${TAG}" "${disk_img}"; then
echo " - Created snapshot '${TAG}' for ${disk_img}"
else
echo " - ERROR! Failed to create snapshot '${TAG}' for ${disk_img}"
fi
else
echo " - NOTE! ${disk_img} not found. Doing nothing."
fi
}
function snapshot_delete() {
echo "Snapshot removal ${disk_img}"
local TAG="${1}"
if [ -z "${TAG}" ]; then
echo " - ERROR! No snapshot tag provided."
exit
fi
if [ -e "${disk_img}" ]; then
if ${QEMU_IMG} snapshot -q -d "${TAG}" "${disk_img}"; then
echo " - Deleted snapshot '${TAG}' from ${disk_img}"
else
echo " - ERROR! Failed to delete snapshot '${TAG}' from ${disk_img}"
fi
else
echo " - NOTE! ${disk_img} not found. Doing nothing."
fi
}
function snapshot_info() {
echo
if [ -e "${disk_img}" ]; then
${QEMU_IMG} info "${disk_img}"
fi
}
function get_port() {
local PORT_START=$1
local PORT_RANGE=$((PORT_START+$2))
local PORT
for ((PORT = PORT_START; PORT <= PORT_RANGE; PORT++)); do
# Make sure port scans do not block too long.
timeout 0.1s bash -c "echo >/dev/tcp/127.0.0.1/${PORT}" >/dev/null 2>&1
if [ ${?} -eq 1 ]; then
echo "${PORT}"
break
fi
done
}
function configure_usb() {
local DEVICE=""
local USB_BUS=""
local USB_DEV=""
local USB_NAME=""
local VENDOR_ID=""
local PRODUCT_ID=""
local USB_NOT_READY=0
# Have any USB devices been requested for pass-through?
if (( ${#usb_devices[@]} )); then
echo " - USB: Host pass-through requested:"
for DEVICE in "${usb_devices[@]}"; do
VENDOR_ID=$(echo "${DEVICE}" | cut -d':' -f1)
PRODUCT_ID=$(echo "${DEVICE}" | cut -d':' -f2)
USB_BUS=$(lsusb -d "${VENDOR_ID}:${PRODUCT_ID}" | cut -d' ' -f2)
USB_DEV=$(lsusb -d "${VENDOR_ID}:${PRODUCT_ID}" | cut -d' ' -f4 | cut -d':' -f1)
USB_NAME=$(lsusb -d "${VENDOR_ID}:${PRODUCT_ID}" | cut -d' ' -f7-)
if [ -z "${USB_NAME}" ]; then
echo " ! USB device ${VENDOR_ID}:${PRODUCT_ID} not found. Check your configuration"
continue
elif [ -w "/dev/bus/usb/${USB_BUS}/${USB_DEV}" ]; then
echo " o ${USB_NAME} on bus ${USB_BUS} device ${USB_DEV} is accessible."
else
echo " x ${USB_NAME} on bus ${USB_BUS} device ${USB_DEV} needs permission changes:"
echo " sudo chown -v root:${USER} /dev/bus/usb/${USB_BUS}/${USB_DEV}"
USB_NOT_READY=1
fi
USB_PASSTHROUGH="${USB_PASSTHROUGH} -device usb-host,bus=hostpass.0,vendorid=0x${VENDOR_ID},productid=0x${PRODUCT_ID}"
done
if [ "${USB_NOT_READY}" -eq 1 ]; then
echo " ERROR! USB permission changes are required 👆"
exit 1
fi
fi
}
# get the number of processing units
function get_nproc() {
if command -v nproc &>/dev/null; then
nproc
elif command -v sysctl &>/dev/null; then
sysctl -n hw.ncpu
else
echo "ERROR! Unable to determine the number of processing units."
exit 1
fi
}
# macOS and Linux compatible get_cpu_info function
function get_cpu_info() {
local INFO_NAME="${1}"
if [ "${OS_KERNEL}" == "Darwin" ]; then
if [ "^Model name:" == "${INFO_NAME}" ]; then
sysctl -n machdep.cpu.brand_string
elif [ "Socket" == "${INFO_NAME}" ]; then
sysctl -n hw.packages
elif [ "^Vendor ID" == "${INFO_NAME}" ]; then
if [ "${ARCH_HOST}" == "arm64" ]; then
sysctl -n machdep.cpu.brand_string | cut -d' ' -f1
else
sysctl -n machdep.cpu.vendor | sed 's/ //g'
fi
else
echo "ERROR! Could not find macOS translation for ${INFO_NAME}"
exit 1
fi
else
if [ "^Model name:" == "${INFO_NAME}" ]; then
for MODEL_NAME in $(IFS=$'\n' lscpu | grep "${INFO_NAME}" | cut -d':' -f2 | sed -e 's/^[[:space:]]*//'); do
echo -n "${MODEL_NAME} "
done
else
lscpu | grep -E "${INFO_NAME}" | cut -d':' -f2 | sed 's/ //g' | sort -u
fi
fi
}
# returns an enabled or disable CPU flag for QEMU, based on the host CPU
# capabilities, or nothing if the flag is not supported
# converts the flags appropriately from macOS and Linux to QEMU
function configure_cpu_flag() {
local HOST_CPU_FLAG="${1}"
# Convert the flag to lowercase for QEMU
local QEMU_CPU_FLAG=${HOST_CPU_FLAG,,}
if check_cpu_flag "${HOST_CPU_FLAG}"; then
# Replace _ with - to make it compatible with QEMU
QEMU_CPU_FLAG="${HOST_CPU_FLAG//_/-}"
QEMU_CPU_FLAG="${QEMU_CPU_FLAG//4_/4\.}"
# macOS uses different flag names
if [ "${OS_KERNEL}" == "Darwin" ]; then
case "${HOST_CPU_FLAG}" in
avx) QEMU_CPU_FLAG="AVX1.0";;
esac
fi
echo ",+${QEMU_CPU_FLAG}"
else
# Fully disable any QEMU flags that are not supported by the host CPU
if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ]; then
case ${HOST_CPU_FLAG} in
pcid) echo ",-${QEMU_CPU_FLAG}";;
esac
fi
fi
}
# checks if a CPU flag is supported by the host CPU on Linux and macOS
function check_cpu_flag() {
local HOST_CPU_FLAG=""
if [ "${OS_KERNEL}" == "Darwin" ]; then
# Make the macOS compatible: uppercase, replace _ with . and replace X2APIC with x2APIC
HOST_CPU_FLAG="${1^^}"
HOST_CPU_FLAG="${HOST_CPU_FLAG//_/.}"
HOST_CPU_FLAG="${HOST_CPU_FLAG//X2APIC/x2APIC}"
if [ "${HOST_CPU_FLAG}" == "AVX" ]; then
HOST_CPU_FLAG="AVX1.0"
fi
if sysctl -n machdep.cpu.features | grep -o "${HOST_CPU_FLAG}" > /dev/null; then
return 0
else
return 1
fi
else
HOST_CPU_FLAG="${1}"
if lscpu | grep -o "^Flags\b.*: .*\b${HOST_CPU_FLAG}\b" > /dev/null; then
return 0
else
# AMD CPUs report invtsc as constant_tsc; check for equivalence
if [ "${HOST_CPU_FLAG}" == "invtsc" ] && [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ]; then
if lscpu | grep -o "^Flags\b.*: .*\bconstant_tsc\b" > /dev/null; then
return 0
fi
fi
return 1
fi
fi
}
function efi_vars() {
local VARS_IN=""
local VARS_OUT=""
VARS_IN="${1}"
VARS_OUT="${2}"
if [ ! -e "${VARS_OUT}" ]; then
if [ -e "${VARS_IN}" ]; then
cp "${VARS_IN}" "${VARS_OUT}"
else
echo "ERROR! ${VARS_IN} was not found. Please install edk2."
exit 1
fi
fi
}
# Reset CPU flags tracking (call when initialising new CPU string)
function reset_cpu_flags() {
CPU_FLAG_MAP=()
}
# Add a CPU flag with deduplication and conflict detection
# Usage: add_cpu_flag "+vmx" or add_cpu_flag ",+vmx"
function add_cpu_flag() {
local flag="${1#,}" # Strip leading comma if present
# Skip empty flags
[[ -z "${flag}" ]] && return 0
# Validate flag format: must be [+-]?name or name=value
if [[ ! "${flag}" =~ ^[+-]?[a-zA-Z][a-zA-Z0-9._-]*(=.+)?$ ]]; then
echo "WARNING: Invalid CPU flag format: '${flag}' - skipping"
return 1
fi
# Extract base flag name (without +/- prefix and =value suffix)
local prefix=""
local base="${flag}"
if [[ "${flag}" == [+-]* ]]; then
prefix="${flag:0:1}"
base="${flag:1}"
fi
base="${base%%=*}"
# Check for exact duplicate
if [[ -n "${CPU_FLAG_MAP[${flag}]:-}" ]]; then
return 0 # Silently skip duplicates
fi
# Check for conflicts (opposite prefix)
local opposite=""
if [[ "${prefix}" == "+" ]]; then
opposite="-${base}"
elif [[ "${prefix}" == "-" ]]; then
opposite="+${base}"
fi
if [[ -n "${opposite}" ]] && [[ -n "${CPU_FLAG_MAP[${opposite}]:-}" ]]; then
echo "WARNING: Conflicting CPU flag '${flag}' ignored (${opposite} already set)"
return 1
fi
# Check for value conflicts (e.g., flag=on vs flag=off)
if [[ "${flag}" == *=* ]]; then
for existing in "${!CPU_FLAG_MAP[@]}"; do
if [[ "${existing%%=*}" == "${base}" ]] && [[ "${existing}" == *=* ]]; then
echo "WARNING: Conflicting CPU flag '${flag}' ignored (${existing} already set)"
return 1
fi
done
fi
# Add to tracking map and append to CPU string
CPU_FLAG_MAP["${flag}"]=1
CPU+=",${flag}"
return 0
}
function configure_cpu() {
HOST_CPU_CORES=$(get_nproc)
HOST_CPU_MODEL=$(get_cpu_info '^Model name:')
HOST_CPU_SOCKETS=$(get_cpu_info 'Socket')
if [ "${OS_KERNEL}" == "Darwin" ]; then
HOST_CPU_VENDOR=$(get_cpu_info 'Vendor')
else
HOST_CPU_VENDOR=$(get_cpu_info '^Vendor ID')
fi
if [ "${HOST_CPU_SOCKETS}" = "-" ]; then
HOST_CPU_SOCKETS=1
fi
CPU_MODEL="host"
QEMU_ACCEL="tcg"
# Configure appropriately for the host platform
if [ "${OS_KERNEL}" == "Darwin" ]; then
MANUFACTURER=$(ioreg -l | grep -e Manufacturer | grep -v iMan | cut -d'"' -f4 | sort -u)
CPU_KVM_UNHALT=""
QEMU_ACCEL="hvf"
# QEMU for macOS from Homebrew does not support SMM
SMM="off"
else
if [ -r /sys/class/dmi/id/sys_vendor ]; then
MANUFACTURER=$(head -n 1 /sys/class/dmi/id/sys_vendor)
fi
CPU_KVM_UNHALT=",kvm_pv_unhalt"
GUEST_TWEAKS+=" -global kvm-pit.lost_tick_policy=discard"
QEMU_ACCEL="kvm"
fi
if [ "${ARCH_VM}" == "aarch64" ]; then
# ARM64 guest support
# https://qemu-project.gitlab.io/qemu/system/arm/virt.html
# highmem=on allows aarch64 guests on the "virt" machine type to access guest RAM
# above the 4GB boundary. This is required for VMs configured with >3GB RAM and is
# generally more compatible on modern aarch64 systems.
# pflash0/pflash1 reference the blockdev nodes for AAVMF firmware
MACHINE_TYPE="virt,highmem=on,pflash0=rom,pflash1=efivars"
case ${ARCH_HOST} in
arm64|aarch64)
# Native ARM64 host running ARM64 guest - use hardware acceleration
CPU_MODEL="max";;
*)
# Cross-architecture emulation (e.g., x86_64 host running ARM64 guest)
CPU_MODEL="max"
QEMU_ACCEL="tcg";;
esac
elif [ "${ARCH_VM}" != "${ARCH_HOST}" ]; then
# If the architecture of the VM is different from the host, disable acceleration
# and use TCG (Tiny Code Generator) software emulation. TCG emulates the target
# architecture in software, allowing cross-architecture virtualisation (e.g.,
# running x86_64 VMs on ARM hosts).
#
# Users can manually force TCG mode by adding this to their VM .conf file:
# cpu_model="qemu64"
# extra_args="-accel tcg"
# or by exporting QEMU_ACCEL in the shell environment:
# export QEMU_ACCEL="tcg"
#
# TCG is useful for:
# - Cross-architecture virtualisation (x86 on ARM, ARM on x86)
# - Testing VMs on hosts without hardware virtualisation support
# - Emulating CPU features in software (e.g., running macOS x86_64 VMs on ARM Macs)
CPU_MODEL="qemu64"
CPU_KVM_UNHALT=""
QEMU_ACCEL="tcg"
fi
# Detect if running inside a VM based on manufacturer detection
# Note: Checking CPU flags (vmx/svm) indicates hardware virtualisation SUPPORT,
# not whether we're inside a VM. Nested virtualisation may expose these flags.
case ${MANUFACTURER,,} in
qemu|virtualbox) CPU_MODEL="qemu64"
QEMU_ACCEL="tcg"
HYPERVISOR="${MANUFACTURER,,}";;
*) HYPERVISOR="";;
esac
if [ -z "${HYPERVISOR}" ]; then
# A CPU with Intel VT-x / AMD SVM support is required
if [ "${HOST_CPU_VENDOR}" == "GenuineIntel" ]; then
if ! check_cpu_flag vmx; then
echo "ERROR! Intel VT-x support is required."
exit 1
fi
elif [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ] || [ "${HOST_CPU_VENDOR}" == "HygonGenuine" ]; then
# HygonGenuine is Chinese AMD-compatible CPUs (Hygon Dhyana)
if ! check_cpu_flag svm; then
echo "ERROR! AMD SVM support is required."
exit 1
fi
elif [ "${ARCH_HOST}" == "aarch64" ] || [ "${ARCH_HOST}" == "arm64" ]; then
# ARM hosts running native ARM guests with hardware acceleration (HVF on macOS, KVM on Linux)
# ARM processors don't have x86-specific virtualisation flags (VT-x/SVM) to check.
# We use architecture detection here instead of vendor detection (used for x86)
# because ARM CPUs don't have standardised vendor strings like x86 (GenuineIntel/AuthenticAMD).
# Cross-architecture guests (x86 on ARM) use TCG and skip this validation block entirely.
# No validation needed here - ARM virtualisation support is handled by the hypervisor
true
else
# Unknown CPU vendor - could be future/custom CPUs
echo "WARNING! Unknown CPU vendor '${HOST_CPU_VENDOR}' - cannot verify virtualisation support."
echo " If virtualisation fails, check your CPU supports hardware virtualisation and it's enabled in firmware."
fi
fi
CPU="-cpu ${CPU_MODEL}"
reset_cpu_flags
# Make any OS specific adjustments
if [ "${guest_os}" == "freedos" ] || [ "${guest_os}" == "windows" ] || [ "${guest_os}" == "windows-server" ]; then
# SMM is not available on QEMU for macOS via Homebrew
if [ "${OS_KERNEL}" == "Linux" ]; then
SMM="on"
fi
fi
# SMM is also required for Linux guests when Secure Boot is enabled
if [ "${secureboot}" == "on" ]; then
if [ "${guest_os}" == "linux" ]; then
# SMM is not available on QEMU for macOS via Homebrew
if [ "${OS_KERNEL}" == "Linux" ]; then
SMM="on"
fi
fi
fi
case ${guest_os} in
batocera|freedos|haiku|solaris) MACHINE_TYPE="pc";;
kolibrios|reactos)
CPU="-cpu qemu32"
reset_cpu_flags
MACHINE_TYPE="pc";;
macos)
# If the host has an Intel CPU, passes the host CPU model features, model, stepping, exactly to the guest.
# Disable huge pages (,-pdpe1gb) on macOS to prevent crashes
# - https://stackoverflow.com/questions/60231203/qemu-qcow2-mmu-gva-to-gpa-crash-in-mac-os-x
# vmware-cpuid-freq=on enables VMware TSC frequency reporting for macOS timing
if [ "${HOST_CPU_VENDOR}" == "GenuineIntel" ] && [ -z "${HYPERVISOR}" ]; then
CPU_MODEL="host"
CPU="-cpu ${CPU_MODEL},-pdpe1gb,+hypervisor,vmware-cpuid-freq=on"
reset_cpu_flags
else
CPU_MODEL="Haswell-v2"
CPU="-cpu ${CPU_MODEL},vendor=GenuineIntel,-pdpe1gb,+avx,+sse,+sse2,+ssse3,vmware-cpuid-freq=on"
reset_cpu_flags
fi
# A CPU with fma is required for Metal support
# A CPU with invtsc is required for macOS to boot
# Skip CPU feature checks when using TCG emulation (cross-architecture)
# as TCG will emulate the required x86 features in software. This enables
# running macOS x86_64 VMs on ARM Macs through software emulation.
if [ "${QEMU_ACCEL}" != "tcg" ]; then
case ${macos_release} in
ventura|sonoma|sequoia|tahoe)
# A CPU with AVX2 support is required for >= macOS Ventura
if check_cpu_flag sse4_2 && check_cpu_flag avx2; then
if [ "${HOST_CPU_VENDOR}" != "GenuineIntel" ] && [ -z "${HYPERVISOR}" ]; then
add_cpu_flag "+avx2"
add_cpu_flag "+sse4.2"
fi
else
echo "ERROR! macOS ${macos_release} requires a CPU with SSE 4.2 and AVX2 support."
echo " Try macOS Monterey or Big Sur."
exit 1
fi;;
catalina|big-sur|monterey)
# A CPU with SSE4.2 support is required for >= macOS Catalina
if check_cpu_flag sse4_2; then
if [ "${HOST_CPU_VENDOR}" != "GenuineIntel" ] && [ -z "${HYPERVISOR}" ]; then
add_cpu_flag "+sse4.2"
fi
else
echo "ERROR! macOS ${macos_release} requires a CPU with SSE 4.2 support."
exit 1
fi;;
*)
# A CPU with SSE4.1 support is required for >= macOS Sierra
if check_cpu_flag sse4_1; then
if [ "${HOST_CPU_VENDOR}" != "GenuineIntel" ] && [ -z "${HYPERVISOR}" ]; then
add_cpu_flag "+sse4.1"
fi
else
echo "ERROR! macOS ${macos_release} requires a CPU with SSE 4.1 support."
exit 1
fi;;
esac
if [ "${HOST_CPU_VENDOR}" != "GenuineIntel" ] && [ -z "${HYPERVISOR}" ]; then
for FLAG in abm adx aes amd-ssbd apic arat bmi1 bmi2 clflush cmov cx8 cx16 de \
eist erms f16c fma fp87 fsgsbase fxsr invpcid invtsc lahf_lm lm \
mca mce mmx movbe mpx msr mtrr nx pae pat pcid pge pse popcnt pse36 \
rdrand rdtscp sep smep syscall tsc tsc_adjust vaes vbmi2 vmx vpclmulqdq \
x2apic xgetbv1 xsave xsaveopt; do
local cpu_flag
cpu_flag=$(configure_cpu_flag "${FLAG}")
[[ -n "${cpu_flag}" ]] && add_cpu_flag "${cpu_flag#,}"
done
# AMD CPUs with constant_tsc need explicit TSC flags for macOS stability
# constant_tsc is AMD's equivalent of Intel's invtsc
if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ] && check_cpu_flag invtsc; then
add_cpu_flag "+tsc"
add_cpu_flag "+tsc-deadline"
fi
fi
fi
# Disable S3 support in the VM to prevent macOS suspending during install
# Disable ACPI PCI hotplug to prevent issues with macOS (required for QEMU 6.1+)
GUEST_TWEAKS+=" -global ICH9-LPC.disable_s3=1 -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off -device isa-applesmc,osk=$(echo "bheuneqjbexolgurfrjbeqfthneqrqcyrnfrqbagfgrny(p)NccyrPbzchgreVap" | tr 'A-Za-z' 'N-ZA-Mn-za-m')"
# Disable High Precision Timer
if [ "${QEMU_VER_SHORT}" -ge 70 ]; then
MACHINE_TYPE+=",hpet=off"
else
GUEST_TWEAKS+=" -no-hpet"
fi
;;
windows|windows-server)
# Base CPU flags that work with all accelerators (KVM, HVF, TCG)
CPU="-cpu ${CPU_MODEL},+hypervisor,+invtsc,l3-cache=on"
reset_cpu_flags
# KVM-specific flags: migratable and Hyper-V enlightenments
if [ "${QEMU_ACCEL}" == "kvm" ]; then
if [ "${QEMU_VER_SHORT}" -gt 60 ]; then
add_cpu_flag "migratable=no"
add_cpu_flag "hv_passthrough"
else
add_cpu_flag "migratable=no"
add_cpu_flag "hv_frequencies"
[[ -n "${CPU_KVM_UNHALT}" ]] && add_cpu_flag "${CPU_KVM_UNHALT#,}"
add_cpu_flag "hv_reenlightenment"
add_cpu_flag "hv_relaxed"
add_cpu_flag "hv_spinlocks=8191"
add_cpu_flag "hv_stimer"
add_cpu_flag "hv_synic"
add_cpu_flag "hv_time"
add_cpu_flag "hv_vapic"
add_cpu_flag "hv_vendor_id=1234567890ab"
add_cpu_flag "hv_vpindex"
fi
fi
# Disable S3 support in the VM to ensure Windows can boot with SecureBoot enabled
# - https://wiki.archlinux.org/title/QEMU/Troubleshooting#Virtual_machine_not_booting_when_using_a_Secure_Boot_enabled_OVMF
GUEST_TWEAKS+=" -global ICH9-LPC.disable_s3=1"
# Disable High Precision Timer
if [ "${QEMU_VER_SHORT}" -ge 70 ]; then
MACHINE_TYPE+=",hpet=off"
else
GUEST_TWEAKS+=" -no-hpet"
fi
;;
esac
if [ "${HOST_CPU_VENDOR}" == "AuthenticAMD" ] && [ "${guest_os}" != "macos" ] && [ "${ARCH_VM}" == "x86_64" ]; then
add_cpu_flag "topoext"
fi
if [ -z "${cpu_cores}" ]; then
if [ "${HOST_CPU_CORES}" -ge 32 ]; then
GUEST_CPU_CORES="16"
elif [ "${HOST_CPU_CORES}" -ge 16 ]; then
GUEST_CPU_CORES="8"
elif [ "${HOST_CPU_CORES}" -ge 8 ]; then
GUEST_CPU_CORES="4"
elif [ "${HOST_CPU_CORES}" -ge 4 ]; then
GUEST_CPU_CORES="2"
else
GUEST_CPU_CORES="1"
fi
else
GUEST_CPU_CORES="${cpu_cores}"
fi
# Windows 11 requires a minimum of 2 CPU cores to install
# https://github.com/quickemu-project/quickemu/issues/1423
if [ "${guest_os}" == "windows" ] && [[ "${VMNAME}" == *"windows-11"* || "${VMNAME}" == *"win11"* ]]; then
if [ "${GUEST_CPU_CORES}" -lt 2 ]; then
echo " - CPU: Adjusting CPU cores from ${GUEST_CPU_CORES} to 2 (Windows 11 minimum requirement)"
GUEST_CPU_CORES="2"
fi
fi
# macOS guests cannot boot with most core counts not powers of 2.
# Find the nearest but lowest power of 2 using a predefined table
if [ "${guest_os}" == "macos" ]; then
local POWERS=(1 2 4 8 16 32 64 128 256 512 1024)
for (( i=${#POWERS[@]}-1; i>=0; i-- )); do
if [ "${POWERS[i]}" -le "${GUEST_CPU_CORES}" ]; then
GUEST_CPU_CORES="${POWERS[i]}"
break
fi
done
fi
if [ "${OS_KERNEL}" == "Darwin" ]; then
# Get the number of physical cores
physicalcpu=$(sysctl -n hw.physicalcpu)
# Get the number of logical processors
logicalcpu=$(sysctl -n hw.logicalcpu)
# Check if Hyper-Threading is enabled
if [ "${logicalcpu}" -gt "${physicalcpu}" ]; then
HOST_CPU_SMT="on"
else
HOST_CPU_SMT="off"
fi
elif [ -e /sys/devices/system/cpu/smt/control ]; then
HOST_CPU_SMT=$(cat /sys/devices/system/cpu/smt/control)
fi
# Account for Hyperthreading/SMT.
if [ "${GUEST_CPU_CORES}" -ge 2 ]; then
case ${HOST_CPU_SMT} in
on) GUEST_CPU_THREADS=2
GUEST_CPU_LOGICAL_CORES=$(( GUEST_CPU_CORES / GUEST_CPU_THREADS ));;
*) GUEST_CPU_THREADS=1
GUEST_CPU_LOGICAL_CORES=${GUEST_CPU_CORES};;
esac
else
GUEST_CPU_THREADS=1
GUEST_CPU_LOGICAL_CORES=${GUEST_CPU_CORES}
fi
SMP="-smp cores=${GUEST_CPU_LOGICAL_CORES},threads=${GUEST_CPU_THREADS},sockets=${HOST_CPU_SOCKETS}"
echo " - CPU: ${HOST_CPU_MODEL}"
echo " - CPU VM: ${CPU_MODEL%%,*}, ${HOST_CPU_SOCKETS} Socket(s), ${GUEST_CPU_LOGICAL_CORES} Core(s), ${GUEST_CPU_THREADS} Thread(s)"
if [ "${guest_os}" == "macos" ] || [ "${guest_os}" == "windows" ] || [ "${guest_os}" == "windows-server" ]; then
# Display MSRs alert if the guest is macOS or windows
ignore_msrs_alert
fi
}
function configure_ram() {
local OS_PRETTY_NAME=""
RAM_VM="2G"
if [ -z "${ram}" ]; then
local RAM_HOST=""
if [ "${OS_KERNEL}" == "Darwin" ]; then
RAM_HOST=$(($(sysctl -n hw.memsize) / (1048576*1024)))
else
# Determine the number of gigabytes of RAM in the host by extracting the first numerical value from the output.
RAM_HOST=$(free --giga | tr ' ' '\n' | grep -m 1 "[0-9]" )
fi
if [ "${RAM_HOST}" -ge 128 ]; then
RAM_VM="32G"
elif [ "${RAM_HOST}" -ge 64 ]; then
RAM_VM="16G"
elif [ "${RAM_HOST}" -ge 16 ]; then
RAM_VM="8G"
elif [ "${RAM_HOST}" -ge 8 ]; then
RAM_VM="4G"
fi
else
RAM_VM="${ram}"
fi
echo " - RAM VM: ${RAM_VM} RAM"
case "${guest_os}" in
windows|windows-server)
OS_PRETTY_NAME="Windows"
min_ram="4"
;;
macos)
OS_PRETTY_NAME="macOS"
min_ram="8"
;;
esac
if [ -n "${min_ram}" ] && [ "${RAM_VM//G/}" -lt "${min_ram}" ]; then
if [ -z "${ram}" ]; then
echo " ERROR! The guest virtual machine has been allocated insufficient RAM to run ${OS_PRETTY_NAME}."
echo " You can override the guest RAM allocation by adding 'ram=${min_ram}G' to ${VM}"
exit 1
else
echo " WARNING! You have allocated less than the recommended amount of RAM to run ${OS_PRETTY_NAME}."
fi
fi
}
function is_firmware_qcow2() {
# Check for the magic bytes that indicate the firmware is in qcow2 format,
# otherwise default to assuming firmware files are in raw format.
# Use od to read bytes as hex to avoid null byte warnings in command substitution.
local magic
magic=$(od -An -tx1 -N4 "$1" 2>/dev/null | tr -d ' ')
[ "$magic" = "514649fb" ] && echo "true" || echo "false"
}
# Derive QEMU share path from binary location
# Handles Nix, Homebrew, MacPorts, system packages, custom builds
function get_qemu_share_path() {
local qemu_bin="${QEMU}"
local qemu_real qemu_prefix share_path
# Resolve the actual binary path (handles symlinks, Nix store paths)
if command -v realpath &>/dev/null; then
qemu_real=$(realpath "${qemu_bin}" 2>/dev/null) || qemu_real="${qemu_bin}"
else
# macOS fallback: follow symlink chain manually
qemu_real="${qemu_bin}"
while [ -L "${qemu_real}" ]; do
local link_target
link_target=$(readlink "${qemu_real}")
# Handle relative symlinks
if [[ "${link_target}" != /* ]]; then
qemu_real="$(dirname "${qemu_real}")/${link_target}"
else
qemu_real="${link_target}"
fi
done
fi
# /path/to/bin/qemu-system-x86_64 -> /path/to/share
qemu_prefix="$(dirname "$(dirname "${qemu_real}")")"
share_path="${qemu_prefix}/share"
# Validate: must contain qemu firmware directory
if [ -d "${share_path}/qemu" ]; then
echo "${share_path}"
return 0
fi
# Fallback for system installations
echo "/usr/share"
}
function configure_bios() {
# Always Boot macOS using EFI
if [ "${guest_os}" == "macos" ]; then
boot="efi"
if [ -e "${VMDIR}/OVMF_CODE.fd" ] && [ -e "${VMDIR}/OVMF_VARS-1024x768.fd" ]; then
EFI_CODE="${VMDIR}/OVMF_CODE.fd"
EFI_VARS="${VMDIR}/OVMF_VARS-1024x768.fd"
elif [ -e "${VMDIR}/OVMF_CODE.fd" ] && [ -e "${VMDIR}/OVMF_VARS-1920x1080.fd" ]; then
EFI_CODE="${VMDIR}/OVMF_CODE.fd"
EFI_VARS="${VMDIR}/OVMF_VARS-1920x1080.fd"
else
MAC_MISSING="Firmware"
fi
# Check for OpenCore bootloader
if [ -e "${VMDIR}/OpenCore.qcow2" ]; then
MAC_BOOTLOADER="${VMDIR}/OpenCore.qcow2"
elif [ -e "${VMDIR}/ESP.qcow2" ]; then
# Backwards compatibility for Clover
MAC_BOOTLOADER="${VMDIR}/ESP.qcow2"
else
MAC_MISSING="Bootloader"
fi
if [ -n "${MAC_MISSING}" ]; then
echo "ERROR! macOS ${MAC_MISSING} was not found."
echo " Use 'quickget' to download the required files."
exit 1
fi
BOOT_STATUS="EFI (macOS), OVMF ($(basename "${EFI_CODE}")), SecureBoot (${secureboot})."
elif [[ "${boot}" == *"efi"* ]]; then
EFI_VARS="${VMDIR}/OVMF_VARS.fd"
# Preserve backward compatibility
if [ -e "${VMDIR}/${VMNAME}-vars.fd" ]; then
mv "${VMDIR}/${VMNAME}-vars.fd" "${EFI_VARS}"
elif [ -e "${VMDIR}/OVMF_VARS_4M.fd" ]; then
mv "${VMDIR}/OVMF_VARS_4M.fd" "${EFI_VARS}"
fi
# OVMF_CODE_4M.fd is for booting guests in non-Secure Boot mode.
# While this image technically supports Secure Boot, it does so
# without requiring SMM support from QEMU
# OVMF_CODE.secboot.fd is like OVMF_CODE_4M.fd, but will abort if QEMU
# does not support SMM.
local SHARE_PATH
SHARE_PATH=$(get_qemu_share_path)
# https://bugzilla.redhat.com/show_bug.cgi?id=1929357#c5
# TODO: Check if macOS should use 'edk2-i386-vars.fd'
# Search for firmware if EFI_CODE is not set or the specified file doesn't exist
if [ -z "${EFI_CODE}" ] || [ ! -e "${EFI_CODE}" ]; then
if [ "${ARCH_VM}" == "aarch64" ]; then
# AAVMF firmware paths for ARM64 guests
# SecureBoot is not commonly supported on ARM64, use standard firmware
# shellcheck disable=SC2054,SC2140
ovmfs=("/usr/share/AAVMF/AAVMF_CODE.fd","/usr/share/AAVMF/AAVMF_VARS.fd" \
"${SHARE_PATH}/edk2/aarch64/QEMU_CODE.fd","${SHARE_PATH}/edk2/aarch64/QEMU_VARS.fd" \
"${SHARE_PATH}/edk2/aarch64/QEMU_EFI-pflash.raw","${SHARE_PATH}/edk2/aarch64/vars-template-pflash.raw" \
"${SHARE_PATH}/qemu/edk2-aarch64-code.fd","${SHARE_PATH}/qemu/edk2-arm-vars.fd" \
"${SHARE_PATH}/AAVMF/AAVMF_CODE.fd","${SHARE_PATH}/AAVMF/AAVMF_VARS.fd"
)
else
# x86_64 OVMF firmware paths
case ${secureboot} in
on) # shellcheck disable=SC2054,SC2140
ovmfs=("${SHARE_PATH}/OVMF/OVMF_CODE_4M.secboot.fd","${SHARE_PATH}/OVMF/OVMF_VARS_4M.ms.fd" \
"${SHARE_PATH}/edk2/ovmf/OVMF_CODE.secboot.fd","${SHARE_PATH}/edk2/ovmf/OVMF_VARS.secboot.fd" \
"${SHARE_PATH}/OVMF/x64/OVMF_CODE.secboot.fd","${SHARE_PATH}/OVMF/x64/OVMF_VARS.fd" \
"${SHARE_PATH}/edk2-ovmf/OVMF_CODE.secboot.fd","${SHARE_PATH}/edk2-ovmf/OVMF_VARS.fd" \
"${SHARE_PATH}/qemu/ovmf-x86_64-smm-ms-code.bin","${SHARE_PATH}/qemu/ovmf-x86_64-smm-ms-vars.bin" \
"${SHARE_PATH}/qemu/edk2-x86_64-secure-code.fd","${SHARE_PATH}/qemu/edk2-x86_64-code.fd" \
"${SHARE_PATH}/edk2-ovmf/x64/OVMF_CODE.secboot.fd","${SHARE_PATH}/edk2-ovmf/x64/OVMF_VARS.fd" \
"${SHARE_PATH}/edk2/x64/OVMF_CODE.secboot.4m.fd","${SHARE_PATH}/edk2/x64/OVMF_VARS.4m.fd" \
"${SHARE_PATH}/edk2/ovmf/OVMF_CODE_4M.secboot.qcow2","${SHARE_PATH}/edk2/ovmf/OVMF_VARS_4M.secboot.qcow2"
);;
*) # shellcheck disable=SC2054,SC2140
ovmfs=("${SHARE_PATH}/OVMF/OVMF_CODE_4M.fd","${SHARE_PATH}/OVMF/OVMF_VARS_4M.fd" \
"${SHARE_PATH}/edk2/ovmf/OVMF_CODE.fd","${SHARE_PATH}/edk2/ovmf/OVMF_VARS.fd" \
"${SHARE_PATH}/OVMF/OVMF_CODE.fd","${SHARE_PATH}/OVMF/OVMF_VARS.fd" \
"${SHARE_PATH}/OVMF/x64/OVMF_CODE.fd","${SHARE_PATH}/OVMF/x64/OVMF_VARS.fd" \
"${SHARE_PATH}/edk2-ovmf/OVMF_CODE.fd","${SHARE_PATH}/edk2-ovmf/OVMF_VARS.fd" \
"${SHARE_PATH}/qemu/ovmf-x86_64-4m-code.bin","${SHARE_PATH}/qemu/ovmf-x86_64-4m-vars.bin" \
"${SHARE_PATH}/qemu/edk2-x86_64-code.fd","${SHARE_PATH}/qemu/edk2-x86_64-code.fd" \
"${SHARE_PATH}/edk2-ovmf/x64/OVMF_CODE.fd","${SHARE_PATH}/edk2-ovmf/x64/OVMF_VARS.fd" \
"${SHARE_PATH}/edk2/x64/OVMF_CODE.4m.fd","${SHARE_PATH}/edk2/x64/OVMF_VARS.4m.fd" \
"${SHARE_PATH}/edk2/ovmf/OVMF_CODE_4M.qcow2","${SHARE_PATH}/edk2/ovmf/OVMF_VARS_4M.qcow2"
);;
esac
fi
# Attempt each EFI_CODE file one by one, selecting the corresponding code and vars
# when an existing file is found.
_IFS=$IFS
IFS=","
for f in "${ovmfs[@]}"; do
# shellcheck disable=SC2086
set -- ${f};
if [ -e "${1}" ]; then
EFI_CODE="${1}"
EFI_EXTRA_VARS="${2}"
fi
done
IFS=$_IFS
fi
if [ -z "${EFI_CODE}" ] || [ ! -e "${EFI_CODE}" ]; then
if [ "${secureboot}" == "on" ]; then
echo "ERROR! SecureBoot was requested but no SecureBoot capable firmware was found."
else
echo "ERROR! EFI boot requested but no EFI firmware found."
fi
echo " Please install OVMF firmware."
exit 1
fi
if [ -n "${EFI_EXTRA_VARS}" ]; then
if [ ! -e "${EFI_EXTRA_VARS}" ]; then
echo " - EFI: ERROR! EFI_EXTRA_VARS file ${EFI_EXTRA_VARS} does not exist."
exit 1
fi
# Write destination vars file with correct extension
# based on source format of the EFI_EXTRA_VARS file
QCOW2VARS=$(is_firmware_qcow2 "${EFI_EXTRA_VARS}")
if [ "${QCOW2VARS}" = "true" ]; then
EFI_VARS="${VMDIR}/OVMF_VARS.qcow2"
else
EFI_VARS="${VMDIR}/OVMF_VARS.fd"
fi
efi_vars "${EFI_EXTRA_VARS}" "${EFI_VARS}"
fi
# Make sure EFI_VARS references an actual, writeable, file
if [ ! -f "${EFI_VARS}" ] || [ ! -w "${EFI_VARS}" ]; then
echo " - EFI: ERROR! ${EFI_VARS} is not a regular file or not writeable."
echo " Deleting ${EFI_VARS}. Please re-run quickemu."
rm -f "${EFI_VARS}"
exit 1
fi
# If EFI_CODE references a symlink, resolve it to the real file.
if [ -L "${EFI_CODE}" ]; then
echo " - EFI: WARNING! ${EFI_CODE} is a symlink."
echo -n " Resolving to... "
EFI_CODE=$(realpath "${EFI_CODE}")
echo "${EFI_CODE}"
fi
BOOT_STATUS="EFI (${guest_os^}), OVMF (${EFI_CODE}), EFI Vars (${EFI_VARS}), SecureBoot (${secureboot})."
else
BOOT_STATUS="Legacy BIOS (${guest_os^})"
boot="legacy"
secureboot="off"
# Legacy BIOS boot requires the i440fx/PIIX3 chipset (pc), not Q35
MACHINE_TYPE="pc"
fi
echo " - BOOT: ${BOOT_STATUS}"
}
function configure_os_quirks() {
if [ "${guest_os}" == "batocera" ] || [ "${guest_os}" == "haiku" ] || [ "${guest_os}" == "kolibrios" ]; then
NET_DEVICE="rtl8139"
fi
if [ "${guest_os}" == "freebsd" ] || [ "${guest_os}" == "ghostbsd" ]; then
mouse="usb"
fi
case ${guest_os} in
windows-server) NET_DEVICE="e1000";;
*bsd|linux*|windows) NET_DEVICE="virtio-net-pci";;
freedos) sound_card="sb16"
NET_DEVICE="pcnet";;
*solaris) usb_controller="xhci"
sound_card="ac97";;
reactos) NET_DEVICE="e1000"
keyboard="ps2";;
macos)
# Tune QEMU optimisations based on the macOS release, or fallback to lowest
# common supported options if none is specified.
# * VirtIO Block Media doesn't work in High Sierra (at all) or the Mojave (Recovery Image)
# * VirtIO Network is supported since Big Sur
# * VirtIO Memory Balloning is supported since Big Sur (https://pmhahn.github.io/virtio-balloon/)
# * VirtIO RNG is supported since Big Sur, but exposed to all guests by default.
case ${macos_release} in
monterey|ventura|sonoma|sequoia|tahoe)
# macOS 12+ (Monterey onwards) supports virtio-sound-pci natively
BALLOON="-device virtio-balloon"
MAC_DISK_DEV="virtio-blk-pci"
NET_DEVICE="virtio-net-pci"
USB_HOST_PASSTHROUGH_CONTROLLER="nec-usb-xhci"
GUEST_TWEAKS+=" -global nec-usb-xhci.msi=off"
sound_card="virtio-sound-pci"
usb_controller="xhci";;
big-sur)
# Big Sur uses VirtIO but usb-audio/VoodooHDA don't work reliably
# Fall back to ich9-intel-hda which may work with VoodooHDA
BALLOON="-device virtio-balloon"
MAC_DISK_DEV="virtio-blk-pci"
NET_DEVICE="virtio-net-pci"
USB_HOST_PASSTHROUGH_CONTROLLER="nec-usb-xhci"
GUEST_TWEAKS+=" -global nec-usb-xhci.msi=off"
sound_card="ich9-intel-hda"
usb_controller="xhci";;
*)
# Backwards compatibility if no macos_release is specified.
# Also safe catch all for High Sierra and Mojave
BALLOON=""
if [ "${macos_release}" == "catalina" ]; then
MAC_DISK_DEV="virtio-blk-pci"
else
MAC_DISK_DEV="ide-hd,bus=ahci.2"
fi
NET_DEVICE="vmxnet3"
USB_HOST_PASSTHROUGH_CONTROLLER="usb-ehci";;
esac
;;
*) NET_DEVICE="rtl8139";;
esac
}
function configure_storage() {
local create_options=""
echo " - Disk: ${disk_img} (${disk_size})"
if [ ! -f "${disk_img}" ]; then
# If there is no disk image, create a new image.
mkdir -p "${VMDIR}" 2>/dev/null
case ${preallocation} in
off|metadata|falloc|full) true;;
*) echo "ERROR! ${preallocation} is an unsupported disk preallocation option."
exit 1;;
esac
case ${disk_format} in
qcow2) create_options="lazy_refcounts=on,preallocation=${preallocation},nocow=on";;
raw) create_options="preallocation=${preallocation}";;
*) true;;
esac
# https://blog.programster.org/qcow2-performance
if ! ${QEMU_IMG} create -q -f "${disk_format}" -o "${create_options=}" "${disk_img}" "${disk_size}"; then
echo "ERROR! Failed to create ${disk_img} using ${disk_format} format."
exit 1
fi
if [ -z "${iso}" ] && [ -z "${img}" ]; then
echo "ERROR! You haven't specified a .iso or .img image to boot from."
exit 1
fi
echo " Just created, booting from ${iso}${img}"
DISK_USED="no"
elif [ -e "${disk_img}" ]; then
# If the VM is not running, check for disk related issues.
if [ -z "${VM_PID}" ]; then
# Check there isn't already a process attached to the disk image.
if ! ${QEMU_IMG} info "${disk_img}" >/dev/null; then
echo " Failed to get \"write\" lock. Is another process using the disk?"
exit 1
fi
else
if ! ${QEMU_IMG} check -q "${disk_img}"; then
echo " Disk integrity check failed. Please run qemu-img check --help."
echo
"${QEMU_IMG}" check "${disk_img}"
exit 1
fi
fi
# Only check disk image size if preallocation is off
if [ "${preallocation}" == "off" ]; then
DISK_CURR_SIZE=$(${STAT} -c%s "${disk_img}")
if [ "${DISK_CURR_SIZE}" -le "${DISK_MIN_SIZE}" ]; then
echo " Looks unused, booting from ${iso}${img}"
if [ -z "${iso}" ] && [ -z "${img}" ]; then
echo "ERROR! You haven't specified a .iso or .img image to boot from."
exit 1
fi
else
DISK_USED="yes"
fi
else
DISK_USED="yes"
fi
fi
if [ "${DISK_USED}" == "yes" ] && [ "${guest_os}" != "kolibrios" ]; then
# If there is a disk image that appears to be used do not boot from installation media.
iso=""
img=""
fi
# Has the status quo been requested?
if [ "${STATUS_QUO}" == "-snapshot" ]; then
if [ -z "${img}" ] && [ -z "${iso}" ]; then
echo " Existing disk state will be preserved, no writes will be committed."
fi
fi
if [ -n "${iso}" ] && [ -e "${iso}" ]; then
echo " - Boot ISO: ${iso}"
elif [ -n "${img}" ] && [ -e "${img}" ]; then
echo " - Recovery: ${img}"
fi
if [ -n "${fixed_iso}" ] && [ -e "${fixed_iso}" ]; then
echo " - CD-ROM: ${fixed_iso}"
fi
}
function check_cocoa_gl_es_support() {
[ "${OS_KERNEL}" != "Darwin" ] && return 1
# Test QEMU directly for gl=es support - most reliable method
# This catches both missing OpenGL build support and missing ANGLE libraries
if "${QEMU}" -display cocoa,gl=es -M none 2>&1 | grep -Eqi "OpenGL support was not enabled|does not accept"; then
return 1
fi
# Fallback: check for ANGLE libraries if QEMU test is inconclusive
# Resolve QEMU's real path (follows Nix symlinks)
local qemu_real qemu_dir qemu_prefix
qemu_real=$(realpath "${QEMU}" 2>/dev/null || readlink -f "${QEMU}" 2>/dev/null || echo "${QEMU}")
qemu_dir=$(dirname "${qemu_real}")
qemu_prefix="${qemu_dir%/bin}"
local angle_libs=(
"${qemu_prefix}/lib/libEGL.dylib"
"/opt/homebrew/lib/libEGL.dylib"
"/usr/local/lib/libEGL.dylib"
)
# Also check DYLD paths if set (covers additional Nix scenarios)
if [ -n "${DYLD_LIBRARY_PATH:-}" ]; then
local IFS=':'
for path in ${DYLD_LIBRARY_PATH}; do
angle_libs+=("${path}/libEGL.dylib")
done
fi
for lib in "${angle_libs[@]}"; do
[ -f "$lib" ] && return 0
done
return 1
}
function configure_display() {
# Determine which audio driver to use: PipeWire, PulseAudio, or ALSA
# Socket detection is more reliable than process detection on headless servers
local AUDIO_DRIVER="alsa"
local pw_socket="${PIPEWIRE_REMOTE:-${XDG_RUNTIME_DIR}/pipewire-0}"
local pa_socket="${PULSE_SERVER:-${XDG_RUNTIME_DIR}/pulse/native}"
if [ "${QEMU_VER_SHORT}" -ge 81 ] && [ -S "${pw_socket}" ]; then
# QEMU's pipewire audio backend was added in version 8.1
AUDIO_DRIVER="pipewire"
elif [ -S "${pa_socket}" ]; then
AUDIO_DRIVER="pa"
fi
# Setup the appropriate audio device based on the display output
# https://www.kraxel.org/blog/2020/01/qemu-sound-audiodev/
case ${display} in
cocoa) AUDIO_DEV="coreaudio,id=audio0";;
none|spice|spice-app) AUDIO_DEV="spice,id=audio0";;
*) AUDIO_DEV="${AUDIO_DRIVER},id=audio0";;
esac
# Determine a sane resolution for Linux guests.
local X_RES="1280"
local Y_RES="800"
if [ -n "${width}" ] && [ -n "${height}" ]; then
local X_RES="${width}"
local Y_RES="${height}"
fi
# https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/
case ${guest_os} in
*bsd) DISPLAY_DEVICE="VGA";;
linux_old|solaris) DISPLAY_DEVICE="vmware-svga";;
linux)
# ARM64 does not have VGA hardware - use virtio-gpu-pci instead of virtio-vga
if [ "${ARCH_VM}" == "aarch64" ]; then
DISPLAY_DEVICE="virtio-gpu-pci"
else
case ${display} in
none|spice|spice-app) DISPLAY_DEVICE="virtio-gpu";;
*) DISPLAY_DEVICE="virtio-vga";;
esac
fi;;
macos)
# macOS has native VMware display driver support; aligns with OSX-KVM
DISPLAY_DEVICE="vmware-svga";;
windows|windows-server)
case ${display} in
none|spice) DISPLAY_DEVICE="qxl-vga";;
cocoa|gtk|sdl|spice-app) DISPLAY_DEVICE="virtio-vga";;
esac;;
*) DISPLAY_DEVICE="qxl-vga";;
esac
# Map Quickemu $display to QEMU -display
case ${display} in
cocoa)
# macOS: prefer OpenGL ES (via ANGLE) for stability and performance
# ANGLE provides OpenGL ES on macOS through Metal, which is more stable
# than the deprecated native OpenGL implementation
# Reference: https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5
if [ "${gl}" == "on" ] && check_cocoa_gl_es_support; then
DISPLAY_RENDER="${display},gl=es"
gl="es"
else
DISPLAY_RENDER="${display}"
[ "${gl}" == "on" ] && gl="off"
fi;;
gtk) DISPLAY_RENDER="${display},grab-on-hover=on,zoom-to-fit=off,gl=${gl}";;
none) DISPLAY_RENDER="none"
gl="off";; # No display backend means no GL context
spice)
# For local SPICE with GL, use egl-headless to provide the GL context
# for VirGL. Don't use gl=on in SPICE itself as it blocks the main loop.
if [ -z "${ACCESS}" ] || [ "${ACCESS}" == "local" ]; then
if [ "${gl}" == "on" ]; then
DISPLAY_RENDER="egl-headless,rendernode=/dev/dri/renderD128"
else
DISPLAY_RENDER="none"
fi
else
# Remote access cannot use GL
DISPLAY_RENDER="none"
gl="off"
fi;;
sdl) DISPLAY_RENDER="${display},gl=${gl}";;
spice-app) DISPLAY_RENDER="${display},gl=${gl}";;
*) DISPLAY_RENDER="${display}";;
esac
# https://www.kraxel.org/blog/2021/05/virtio-gpu-qemu-graphics-update/
# For GL-enabled displays, check if dedicated GL device variants are available.
# Note: virtio-gpu-pci becomes virtio-gpu-gl-pci (not virtio-gpu-pci-gl)
if [ "${gl}" != "off" ] && [[ "${DISPLAY_DEVICE}" =~ ^virtio-(vga|gpu|gpu-pci)$ ]]; then
local GL_DEVICE=""
case "${DISPLAY_DEVICE}" in
virtio-gpu-pci) GL_DEVICE="virtio-gpu-gl-pci";;
virtio-gpu) GL_DEVICE="virtio-gpu-gl";;
virtio-vga) GL_DEVICE="virtio-vga-gl";;
esac
if "${QEMU}" -device help 2>&1 | grep -q "\"${GL_DEVICE}\""; then
DISPLAY_DEVICE="${GL_DEVICE}"
fi
echo -n " - Display: ${display^^}, ${DISPLAY_DEVICE}, GL (${gl}), VirGL (on)"
else
echo -n " - Display: ${display^^}, ${DISPLAY_DEVICE}, GL (${gl}), VirGL (off)"
fi
# Disable default VGA for SPICE modes to prevent duplicate scanouts
# SPICE creates its own display output; the default VGA would create a second one
case ${display} in
none|spice|spice-app) VGA="-vga none";;
*) VGA="";;
esac
# Build the video configuration
VIDEO="${VGA:+${VGA} }-device ${DISPLAY_DEVICE}"
# ARM64 needs ramfb for UEFI boot display before virtio-gpu driver loads
if [ "${ARCH_VM}" == "aarch64" ]; then
VIDEO="-device ramfb ${VIDEO}"
fi
# Set display resolution for devices that support xres/yres parameters
# Use (,|$) anchor to match device names with or without comma-separated parameters
# Pattern ordered most-specific to least-specific for clarity (vga-gl before vga, etc.)
if [[ "${DISPLAY_DEVICE}" =~ ^(virtio-(vga|vga-gl|gpu|gpu-gl|gpu-pci|gpu-gl-pci)|qxl|qxl-vga|bochs-display)(,|$) ]]; then
VIDEO="${VIDEO},xres=${X_RES},yres=${Y_RES}"
echo " @ (${X_RES} x ${Y_RES})"
else
echo " "
fi
# Allocate VRAM to VGA devices
# Note: virtio devices (virtio-vga, virtio-gpu-pci, and their -gl variants) use
# dynamic memory management and don't require explicit VRAM allocation via parameters.
# They use QEMU's default max_hostmem setting (256 MiB) which is sufficient for most use cases.
case ${DISPLAY_DEVICE} in
bochs-display) VIDEO="${VIDEO},vgamem=67108864";;
qxl|qxl-vga) VIDEO="${VIDEO},ram_size=65536,vram_size=65536,vgamem_mb=64";;
ati-vga|cirrus-vga|VGA|vmware-svga) VIDEO="${VIDEO},vgamem_mb=256";;
esac
# Configure multiscreen if max_outputs was provided in the .conf file
if [ -n "${max_outputs}" ]; then
VIDEO="${VIDEO},max_outputs=${max_outputs}"
fi
# Add fullscreen options
VIDEO="${VIDEO} ${FULLSCREEN}"
}
function configure_audio() {
# Build the sound hardware configuration
case ${sound_card} in
ich9-intel-hda|intel-hda) SOUND="-device ${sound_card} -device ${sound_duplex},audiodev=audio0";;
usb-audio) SOUND="-device ${sound_card},audiodev=audio0";;
virtio-sound-pci) SOUND="-device ${sound_card},audiodev=audio0";;
ac97|es1370|sb16) SOUND="-device ${sound_card},audiodev=audio0";;
none) SOUND="";;
esac
echo " - Sound: ${sound_card} (${sound_duplex})"
}
function configure_ports() {
echo -n "" > "${VMDIR}/${VMNAME}.ports"
rm -f "${VMDIR}/${VMNAME}.spice"
rm -f "${VMDIR}/${VMNAME}.sock"
if [ -z "${ssh_port}" ]; then
# Find a free port to expose ssh to the guest
ssh_port=$(get_port 22220 9)
fi
if [ -n "${ssh_port}" ]; then
echo "ssh,${ssh_port}" >> "${VMDIR}/${VMNAME}.ports"
NET="${NET},hostfwd=tcp::${ssh_port}-:22"
echo " - ssh: On host: ssh user@localhost -p ${ssh_port}"
else
echo " - ssh: All ssh ports have been exhausted."
fi
# Have any port forwards been requested?
if (( ${#port_forwards[@]} )); then
echo " - PORTS: Port forwards requested:"
for FORWARD in "${port_forwards[@]}"; do
HOST_PORT=$(echo "${FORWARD}" | cut -d':' -f1)
GUEST_PORT=$(echo "${FORWARD}" | cut -d':' -f2)
echo " - ${HOST_PORT} => ${GUEST_PORT}"
NET="${NET},hostfwd=tcp::${HOST_PORT}-:${GUEST_PORT}"
NET="${NET},hostfwd=udp::${HOST_PORT}-:${GUEST_PORT}"
done
fi
if [ "${display}" == "none" ] || [ "${display}" == "spice" ] || [ "${display}" == "spice-app" ]; then
SPICE="disable-ticketing=on"
if [ "${display}" == "spice-app" ]; then
# spice-app uses QEMU's built-in viewer with GL support
SPICE+=",gl=${gl}"
echo " - SPICE: Enabled"
elif [ "${display}" == "spice" ]; then
# For spice display, use Unix socket for local or TCP for remote
if [ -z "${ACCESS}" ] || [ "${ACCESS}" == "local" ]; then
# Unix socket mode for local access
# GL context is provided by egl-headless display, not SPICE
SPICE+=",unix=on,addr=${VMDIR}/${VMNAME}.sock"
echo "unix,${VMDIR}/${VMNAME}.sock" >> "${VMDIR}/${VMNAME}.ports"
echo "${VMDIR}/${VMNAME}.sock" > "${VMDIR}/${VMNAME}.spice"
echo -n " - SPICE: On host: spicy --uri=\"spice+unix://${VMDIR}/${VMNAME}.sock\" --title \"${VMNAME}\""
if [ "${guest_os}" != "macos" ] && [ -n "${PUBLIC}" ]; then
echo -n " --spice-shared-dir ${PUBLIC}"
fi
echo "${FULLSCREEN}"
else
# TCP mode for remote access (no GL support)
if [ -z "${spice_port}" ]; then
spice_port=$(get_port 5930 9)
fi
if [ "${ACCESS}" == "remote" ]; then
SPICE_ADDR=""
else
SPICE_ADDR="${ACCESS}"
fi
if [ -z "${spice_port}" ]; then
echo " - SPICE: All SPICE ports have been exhausted."
echo " ERROR! Requested SPICE display, but no SPICE ports are free."
exit 1
fi
SPICE+=",port=${spice_port},addr=${SPICE_ADDR}"
echo "spice,${spice_port}" >> "${VMDIR}/${VMNAME}.ports"
echo "${spice_port}" > "${VMDIR}/${VMNAME}.spice"
echo -n " - SPICE: On host: spicy --title \"${VMNAME}\" --port ${spice_port}"
if [ "${guest_os}" != "macos" ] && [ -n "${PUBLIC}" ]; then
echo -n " --spice-shared-dir ${PUBLIC}"
fi
echo "${FULLSCREEN}"
fi
elif [ "${display}" == "none" ]; then
# display=none with SPICE for headless VMs - use TCP for remote access
if [ -z "${spice_port}" ]; then
spice_port=$(get_port 5930 9)
fi
if [ -z "${ACCESS}" ]; then
SPICE_ADDR="127.0.0.1"
elif [ "${ACCESS}" == "remote" ]; then
SPICE_ADDR=""
elif [ "${ACCESS}" == "local" ]; then
SPICE_ADDR="127.0.0.1"
else
SPICE_ADDR="${ACCESS}"
fi
if [ -z "${spice_port}" ]; then
echo " - SPICE: All SPICE ports have been exhausted."
echo " ERROR! Requested SPICE display, but no SPICE ports are free."
exit 1
fi
SPICE+=",port=${spice_port},addr=${SPICE_ADDR}"
echo "spice,${spice_port}" >> "${VMDIR}/${VMNAME}.ports"
echo "${spice_port}" > "${VMDIR}/${VMNAME}.spice"
echo -n " - SPICE: On host: spicy --title \"${VMNAME}\" --port ${spice_port}"
if [ "${guest_os}" != "macos" ] && [ -n "${PUBLIC}" ]; then
echo -n " --spice-shared-dir ${PUBLIC}"
fi
echo "${FULLSCREEN}"
fi
fi
}
function configure_file_sharing() {
if [ -n "${PUBLIC}" ]; then
# WebDAV
case ${guest_os} in
macos)
if [ "${display}" == "none" ] || [ "${display}" == "spice" ] || [ "${display}" == "spice-app" ]; then
# Reference: https://gitlab.gnome.org/GNOME/phodav/-/issues/5
echo " - WebDAV: On guest: build spice-webdavd (https://gitlab.gnome.org/GNOME/phodav/-/merge_requests/24)"
echo " - WebDAV: On guest: Finder -> Connect to Server -> http://localhost:9843/"
fi;;
*) echo " - WebDAV: On guest: dav://localhost:9843/";;
esac
# 9P
if [ "${guest_os}" != "windows" ] || [ "${guest_os}" == "windows-server" ]; then
echo -n " - 9P: On guest: "
if [ "${guest_os}" == "linux" ]; then
echo "sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 ${PUBLIC_TAG} ~/$(basename "${PUBLIC}")"
elif [ "${guest_os}" == "macos" ]; then
# PUBLICSHARE needs to be world writeable for seamless integration with
# macOS. Test if it is world writeable, and prompt what to do if not.
echo "sudo mount_9p ${PUBLIC_TAG}"
if [ "${PUBLIC_PERMS}" != "drwxrwxrwx" ]; then
echo " - 9P: On host: chmod 777 ${PUBLIC}"
echo " Required for macOS integration 👆"
fi
fi
fi
# SMB
# We need to search in NixOS compatible paths as well as the standard location
# since /usr/sbin/smbd may not be in the PATH.
if [ -x "$(command -v smbd)" ] || [ -x "/usr/sbin/smbd" ]; then
NET+=",smb=${PUBLIC}"
echo " - smbd: On guest: smb://10.0.2.4/qemu"
fi
fi
}
function configure_tpm() {
# Start TPM
if [ "${tpm}" == "on" ]; then
local tpm_args=()
# shellcheck disable=SC2054
tpm_args+=(socket
--ctrl type=unixio,path="${VMDIR}/${VMNAME}.swtpm-sock"
--terminate
--tpmstate dir="${VMDIR}"
--tpm2)
echo "${SWTPM} ${tpm_args[*]} &" >> "${VMDIR}/${VMNAME}.sh"
${SWTPM} "${tpm_args[@]}" >> "${VMDIR}/${VMNAME}.log" &
echo " - TPM: ${VMDIR}/${VMNAME}.swtpm-sock (${!})"
sleep 0.25
fi
}
function configure_cpu_pinning() {
if [ -z "${CORE_MAPPING}" ]; then
return
fi
GUEST_CPUS=""
idx=0
for tid_dir in /proc/"${VM_PID}"/task/*; do
tid=$(basename "$tid_dir")
name=$(cat "$tid_dir/comm")
if [[ "$name" == CPU* ]]; then
# Map per core, if threads are specified pin them to the same core
core_idx=$(( idx / GUEST_CPU_THREADS ))
host_cpu=${CORE_MAPPING[$core_idx]}
if (( idx % GUEST_CPU_THREADS == 0 )); then
[[ -n "$GUEST_CPUS" ]] && GUEST_CPUS+=","
GUEST_CPUS+="$core_idx"
fi
taskset -cp "$host_cpu" "$tid" &>/dev/null
idx=$((idx + 1))
fi
done
echo " - CPU Pinning: Bind guest cores to host cores (${GUEST_CPUS} -> ${CPU_PINNING})"
}
function vm_boot() {
AUDIO_DEV=""
BALLOON="-device virtio-balloon"
BOOT_STATUS=""
CPU=""
CORE_MAPPING=""
DISK_USED=""
DISPLAY_DEVICE=""
DISPLAY_RENDER=""
EFI_CODE=""
EFI_VARS=""
GUEST_CPU_CORES=""
GUEST_CPU_LOGICAL_CORES=""
GUEST_CPU_THREADS=""
HOST_CPU_CORES=""
HOST_CPU_SMT=""
HOST_CPU_SOCKETS=""
HOST_CPU_VENDOR=""
GUEST_TWEAKS=""
KERNEL_NAME="Unknown"
KERNEL_NODE=""
KERNEL_VER="?"
OS_RELEASE="Unknown OS"
MACHINE_TYPE="${MACHINE_TYPE:-q35}"
MAC_BOOTLOADER=""
MAC_MISSING=""
MAC_DISK_DEV="${MAC_DISK_DEV:-ide-hd,bus=ahci.2}"
NET_DEVICE="${NET_DEVICE:-virtio-net-pci}"
SOUND=""
SPICE=""
SMM="${SMM:-off}"
local TEMP_PORT=""
USB_HOST_PASSTHROUGH_CONTROLLER="qemu-xhci"
VIDEO=""
KERNEL_NAME="$(uname -s)"
KERNEL_NODE="$(uname -n | cut -d'.' -f 1)"
KERNEL_VER="$(uname -r)"
if [ "${OS_KERNEL}" == "Darwin" ]; then
# Get macOS product name and version using swvers
if [ -x "$(command -v sw_vers)" ]; then
OS_RELEASE="$(sw_vers -productName) $(sw_vers -productVersion)"
fi
elif [ -e /etc/os-release ]; then
OS_RELEASE=$(grep PRETTY_NAME /etc/os-release | cut -d'"' -f2)
fi
echo "Quickemu ${VERSION} using ${QEMU} v${QEMU_VER_LONG}"
echo " - Host: ${OS_RELEASE} running ${KERNEL_NAME} ${KERNEL_VER} ${KERNEL_NODE}"
# Force to lowercase.
boot=${boot,,}
guest_os=${guest_os,,}
args=()
# Set the hostname of the VM
NET="user,hostname=${VMNAME}"
echo "#!/usr/bin/env bash" > "${VMDIR}/${VMNAME}.sh"
configure_cpu
configure_ram
check_macos_tsc_stability
configure_bios
configure_os_quirks
configure_storage
configure_display
configure_audio
configure_ports
configure_file_sharing
configure_usb
configure_tpm
# Changing process name is not supported on macOS
if [ "${OS_KERNEL}" == "Linux" ]; then
# shellcheck disable=SC2054,SC2206,SC2140
args+=(-name ${VMNAME},process=${VMNAME},debug-threads=on)
fi
# Build machine arguments - SMM and vmport are x86-only options
# SMM (System Management Mode) is an x86-specific CPU mode used for firmware operations
# and is required for Secure Boot. ARM64 uses different mechanisms for firmware security.
# vmport emulates VMware's I/O port for guest tools, which is also x86-specific.
#
# TCG-specific optimisations for cross-architecture emulation:
# - Use -accel tcg,... to specify tb-size and thread options
# - QEMU does not allow both -machine accel= and -accel simultaneously
# - For KVM/HVF, continue using -machine accel= (simpler, no extra options needed)
if [ "${QEMU_ACCEL}" == "tcg" ]; then
local HOST_RAM_GB=0
if [ "${OS_KERNEL}" == "Darwin" ]; then
HOST_RAM_GB=$(($(sysctl -n hw.memsize) / (1024*1024*1024)))
else
HOST_RAM_GB=$(awk '/MemTotal/ {printf "%.0f", $2/1024/1024}' /proc/meminfo)
fi
# Use larger translation cache on hosts with 16GB+ RAM
local TCG_TB_SIZE=256
if [ "${HOST_RAM_GB}" -ge 16 ]; then
TCG_TB_SIZE=512
fi
# shellcheck disable=SC2054,SC2206
args+=(-accel tcg,tb-size=${TCG_TB_SIZE},thread=multi)
if [ "${ARCH_VM}" == "aarch64" ]; then
# ARM64 uses 'virt' machine type without x86-specific options
# shellcheck disable=SC2054,SC2206,SC2140
args+=(-machine ${MACHINE_TYPE} ${GUEST_TWEAKS}
${CPU} ${SMP}
-m ${RAM_VM} ${BALLOON}
-pidfile "${VMDIR}/${VMNAME}.pid")
else
# x86_64 includes SMM (System Management Mode) and vmport options
# shellcheck disable=SC2054,SC2206,SC2140
args+=(-machine ${MACHINE_TYPE},smm=${SMM},vmport=off ${GUEST_TWEAKS}
${CPU} ${SMP}
-m ${RAM_VM} ${BALLOON}
-pidfile "${VMDIR}/${VMNAME}.pid")
fi
else
# KVM/HVF: use -machine accel= (no extra options needed)
if [ "${ARCH_VM}" == "aarch64" ]; then
# ARM64 uses 'virt' machine type without x86-specific options
# shellcheck disable=SC2054,SC2206,SC2140
args+=(-machine ${MACHINE_TYPE},accel=${QEMU_ACCEL} ${GUEST_TWEAKS}
${CPU} ${SMP}
-m ${RAM_VM} ${BALLOON}
-pidfile "${VMDIR}/${VMNAME}.pid")
else
# x86_64 includes SMM (System Management Mode) and vmport options
# shellcheck disable=SC2054,SC2206,SC2140
args+=(-machine ${MACHINE_TYPE},smm=${SMM},vmport=off,accel=${QEMU_ACCEL} ${GUEST_TWEAKS}
${CPU} ${SMP}
-m ${RAM_VM} ${BALLOON}
-pidfile "${VMDIR}/${VMNAME}.pid")
fi
fi
if [ "${guest_os}" == "windows" ] || [ "${guest_os}" == "windows-server" ] || [ "${guest_os}" == "reactos" ] || [ "${guest_os}" == "freedos" ]; then
# shellcheck disable=SC2054
args+=(-rtc base=localtime,clock=host,driftfix=slew)
else
# shellcheck disable=SC2054
args+=(-rtc base=utc,clock=host)
fi
# shellcheck disable=SC2206
args+=(${VIDEO} -display ${DISPLAY_RENDER})
# Only enable SPICE is using SPICE display
if [ "${display}" == "none" ] || [ "${display}" == "spice" ] || [ "${display}" == "spice-app" ]; then
# shellcheck disable=SC2054
args+=(-spice "${SPICE}"
-device virtio-serial-pci
-chardev socket,id=agent0,path="${VMDIR}/${VMNAME}-agent.sock",server=on,wait=off
-device virtserialport,chardev=agent0,name=org.qemu.guest_agent.0
-chardev spicevmc,id=vdagent0,name=vdagent
-device virtserialport,chardev=vdagent0,name=com.redhat.spice.0
-chardev spiceport,id=webdav0,name=org.spice-space.webdav.0
-device virtserialport,chardev=webdav0,name=org.spice-space.webdav.0)
fi
# shellcheck disable=SC2054
args+=(-device virtio-rng-pci,rng=rng0 -object rng-random,id=rng0,filename=/dev/urandom)
# macOS doesn't support SPICE
if [ "${OS_KERNEL}" == "Linux" ]; then
# shellcheck disable=SC2054
args+=(-device "${USB_HOST_PASSTHROUGH_CONTROLLER}",id=spicepass
-chardev spicevmc,id=usbredirchardev1,name=usbredir
-device usb-redir,chardev=usbredirchardev1,id=usbredirdev1
-chardev spicevmc,id=usbredirchardev2,name=usbredir
-device usb-redir,chardev=usbredirchardev2,id=usbredirdev2
-chardev spicevmc,id=usbredirchardev3,name=usbredir
-device usb-redir,chardev=usbredirchardev3,id=usbredirdev3
-device pci-ohci,id=smartpass
-device usb-ccid)
if ${QEMU} -device help | grep -q "passthrough smartcard"; then
# shellcheck disable=SC2054
args+=(-chardev spicevmc,id=ccid,name=smartcard
-device ccid-card-passthru,chardev=ccid)
else
echo " - WARNING! ${QEMU} or SPICE was not compiled with support for smartcard devices"
fi
fi
# setup usb-controller
if [ "${usb_controller}" == "ehci" ]; then
# shellcheck disable=SC2054
args+=(-device usb-ehci,id=input)
elif [ "${usb_controller}" == "xhci" ]; then
# shellcheck disable=SC2054
args+=(-device qemu-xhci,id=input)
elif [ "${usb_controller}" == "none" ]; then
# add nothing
:
else
echo " - WARNING! Unknown usb-controller value: '${usb_controller}'"
fi
# setup keyboard
# @INFO: must be set after usb-controller
if [ "${keyboard}" == "usb" ]; then
# shellcheck disable=SC2054
args+=(-device usb-kbd,bus=input.0)
elif [ "${keyboard}" == "virtio" ]; then
# shellcheck disable=SC2054
args+=(-device virtio-keyboard)
elif [ "${keyboard}" == "ps2" ]; then
# add nothing, default is ps/2 keyboard
:
else
echo " - WARNING! Unknown keyboard value: '${keyboard}'; Fallback to ps2"
fi
# setup keyboard_layout
# @INFO: When using the VNC display, you must use the -k parameter to set the keyboard layout if you are not using en-us.
if [ -n "${keyboard_layout}" ]; then
args+=(-k "${keyboard_layout}")
fi
# Braille requires SDL, so disable for macOS
if [ -n "${BRAILLE}" ] && [ "${OS_KERNEL}" == "Linux" ]; then
if ${QEMU} -chardev help | grep -q braille; then
# shellcheck disable=SC2054
#args+=(-chardev braille,id=brltty
# -device usb-braille,id=usbbrl,chardev=brltty)
args+=(-usbdevice braille)
else
echo " - WARNING! ${QEMU} does not support -chardev braille "
fi
fi
# Validate input of the CPU_PINNING, pinning is not supported on macOS
if [ -n "${CPU_PINNING}" ] && [ "${OS_KERNEL}" == "Linux" ]; then
if ! [[ "${CPU_PINNING}" =~ ^[0-9]+(,[0-9]+)*$ ]]; then
echo " - ERROR! Couldn't parse CPU pinning: '${CPU_PINNING}', only comma-separated list is supported"
exit 1
fi
IFS=',' read -r -a CORE_MAPPING <<< "$CPU_PINNING"
NUM_CORE_MAPPING=${#CORE_MAPPING[@]}
if [ "$NUM_CORE_MAPPING" -ne "$GUEST_CPU_LOGICAL_CORES" ]; then
echo " - ERROR! Number of host cores for pinning should be equal to VM core count ($NUM_CORE_MAPPING != $GUEST_CPU_LOGICAL_CORES)"
exit 1
fi
fi
# setup mouse
# @INFO: must be set after usb-controller
if [ "${mouse}" == "usb" ]; then
# shellcheck disable=SC2054
args+=(-device usb-mouse,bus=input.0)
elif [ "${mouse}" == "tablet" ]; then
# shellcheck disable=SC2054
args+=(-device usb-tablet,bus=input.0)
elif [ "${mouse}" == "virtio" ]; then
# shellcheck disable=SC2054
args+=(-device virtio-mouse)
elif [ "${mouse}" == "ps2" ]; then
# add nothing, default is ps/2 mouse
:
else
echo " - WARNING! Unknown mouse value: '${mouse}'; Falling back to ps2"
fi
# setup audio
# @INFO: must be set after usb-controller; in case usb-audio is used
# shellcheck disable=SC2206
args+=(-audiodev ${AUDIO_DEV} ${SOUND})
# $bridge backwards compatibility for Quickemu <= 4.0
if [ -n "${bridge}" ]; then
network="${bridge}"
fi
if [ "${network}" == "none" ]; then
# Disable all networking
echo " - Network: Disabled"
args+=(-nic none)
elif [ "${network}" == "restrict" ]; then
echo " - Network: Restricted (${NET_DEVICE})"
# shellcheck disable=SC2054,SC2206
args+=(-device ${NET_DEVICE},netdev=nic -netdev ${NET},restrict=y,id=nic)
elif [ -n "${network}" ]; then
# Enable bridge mode networking
echo " - Network: Bridged (${network})"
# If a persistent MAC address is provided, use it.
local MAC=""
if [ -n "${macaddr}" ]; then
MAC=",mac=${macaddr}"
fi
# shellcheck disable=SC2054,SC2206
args+=(-nic bridge,br=${network},model=${NET_DEVICE}${MAC})
else
echo " - Network: User (${NET_DEVICE})"
# shellcheck disable=SC2054,SC2206
args+=(-device ${NET_DEVICE},netdev=nic -netdev ${NET},id=nic)
fi
# Add the disks
# - https://turlucode.com/qemu-disk-io-performance-comparison-native-or-threads-windows-10-version/
# Optimise disk I/O: enable TRIM/discard, zero detection for thin provisioning,
# writeback caching and threaded async I/O
DRIVE_OPTIMISATIONS="discard=unmap,detect-zeroes=unmap,cache=writeback,aio=threads"
if [[ "${boot}" == *"efi"* ]]; then
QCOW2CODE=$(is_firmware_qcow2 "${EFI_CODE}")
QCOW2VARS=$(is_firmware_qcow2 "${EFI_VARS}")
if [ "${QCOW2CODE}" = "true" ]; then EFI_CODE_FORMAT="qcow2"; else EFI_CODE_FORMAT="raw"; fi
if [ "${QCOW2VARS}" = "true" ]; then EFI_VARS_FORMAT="qcow2"; else EFI_VARS_FORMAT="raw"; fi
if [ "${ARCH_VM}" == "aarch64" ]; then
# ARM64 uses blockdev with named nodes referenced by machine pflash parameters
# Do NOT use -global cfi.pflash01 secure property - that's x86 SMM-specific
# shellcheck disable=SC2054
args+=(-blockdev node-name=rom,driver=file,filename="${EFI_CODE}",read-only=true
-blockdev node-name=efivars,driver=file,filename="${EFI_VARS}")
else
# x86 uses traditional pflash drives with secure boot support
# shellcheck disable=SC2054
args+=(-global driver=cfi.pflash01,property=secure,value=on
-drive if=pflash,format="${EFI_CODE_FORMAT}",unit=0,file="${EFI_CODE}",readonly=on
-drive if=pflash,format="${EFI_VARS_FORMAT}",unit=1,file="${EFI_VARS}")
fi
fi
if [ -n "${iso}" ] && [ "${guest_os}" == "freedos" ]; then
# FreeDOS reboots after partitioning the disk, and QEMU tries to boot from disk after first restart
# This flag sets the boot order to cdrom,disk. It will persist until powering down the VM
args+=(-boot order=dc)
elif [ -n "${iso}" ] && [ "${guest_os}" == "kolibrios" ]; then
# Since there is bug (probably) in KolibriOS: cdrom indexes 0 or 1 make system show an extra unexisting iso, so we use index=2
# shellcheck disable=SC2054
args+=(-drive media=cdrom,index=2,file="${iso}")
iso=""
elif [ -n "${iso}" ] && [ "${guest_os}" == "reactos" ]; then
# https://reactos.org/wiki/QEMU
# shellcheck disable=SC2054
args+=(-boot order=d
-drive if=ide,index=2,media=cdrom,file="${iso}")
iso=""
elif [ -n "${iso}" ] && [ "${guest_os}" == "windows" ] && [ -e "${VMDIR}/unattended.iso" ]; then
# Attach the unattended configuration to Windows guests when booting from ISO
# shellcheck disable=SC2054
args+=(-drive media=cdrom,index=2,file="${VMDIR}/unattended.iso")
fi
if [ -n "${floppy}" ]; then
# shellcheck disable=SC2054
args+=(-drive if=floppy,format=raw,file="${floppy}")
fi
# ARM64: create virtio-scsi controller if any CD-ROM ISOs are present
# (virt machine has no IDE controller)
if [ "${ARCH_VM}" == "aarch64" ] && { [ -n "${iso}" ] || [ -n "${fixed_iso}" ]; }; then
# shellcheck disable=SC2054
args+=(-device virtio-scsi-pci,id=scsi0)
fi
if [ -n "${iso}" ]; then
if [ "${ARCH_VM}" == "aarch64" ]; then
# ARM64: bootindex=1 ensures UEFI boots from CD-ROM first during installation
# shellcheck disable=SC2054
args+=(-device scsi-cd,drive=cd0,bus=scsi0.0,bootindex=1
-drive id=cd0,if=none,format=raw,media=cdrom,readonly=on,file="${iso}")
else
# shellcheck disable=SC2054
args+=(-drive media=cdrom,index=0,file="${iso}")
fi
fi
if [ -n "${fixed_iso}" ]; then
if [ "${ARCH_VM}" == "aarch64" ]; then
# ARM64: attach second ISO to virtio-scsi controller
# shellcheck disable=SC2054
args+=(-device scsi-cd,drive=cd1,bus=scsi0.0,bootindex=3
-drive id=cd1,if=none,format=raw,media=cdrom,readonly=on,file="${fixed_iso}")
else
# shellcheck disable=SC2054
args+=(-drive media=cdrom,index=1,file="${fixed_iso}")
fi
fi
if [ "${guest_os}" == "macos" ]; then
# shellcheck disable=SC2054
args+=(-device ahci,id=ahci
-device ide-hd,bus=ahci.0,drive=BootLoader,bootindex=0
-drive id=BootLoader,if=none,format=qcow2,file="${MAC_BOOTLOADER}")
if [ -n "${img}" ]; then
# shellcheck disable=SC2054
args+=(-device ide-hd,bus=ahci.1,drive=RecoveryImage
-drive id=RecoveryImage,if=none,format=raw,file="${img}")
fi
# shellcheck disable=SC2054,SC2206
args+=(-device ${MAC_DISK_DEV},drive=SystemDisk
-drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}",${DRIVE_OPTIMISATIONS} ${STATUS_QUO})
elif [ "${guest_os}" == "kolibrios" ]; then
# shellcheck disable=SC2054,SC2206
args+=(-device ahci,id=ahci
-device ide-hd,bus=ahci.0,drive=SystemDisk
-drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}",${DRIVE_OPTIMISATIONS} ${STATUS_QUO})
elif [ "${guest_os}" == "batocera" ] ; then
# shellcheck disable=SC2054,SC2206
args+=(-device virtio-blk-pci,drive=BootDisk
-drive id=BootDisk,if=none,format=raw,file="${img}"
-device virtio-blk-pci,drive=SystemDisk
-drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}",${DRIVE_OPTIMISATIONS} ${STATUS_QUO})
elif [ "${guest_os}" == "reactos" ]; then
# https://reactos.org/wiki/QEMU
# shellcheck disable=SC2054,SC2206
args+=(-drive if=ide,index=0,media=disk,file="${disk_img}")
elif [ "${guest_os}" == "windows-server" ]; then
# shellcheck disable=SC2054,SC2206
args+=(-device ide-hd,drive=SystemDisk
-drive id=SystemDisk,if=none,format=qcow2,file="${disk_img}",${DRIVE_OPTIMISATIONS} ${STATUS_QUO})
else
if [ "${ARCH_VM}" == "aarch64" ]; then
# ARM64: bootindex=2 ensures disk boots after CD-ROM (bootindex=1) during installation
# shellcheck disable=SC2054,SC2206
args+=(-device virtio-blk-pci,drive=SystemDisk,bootindex=2
-drive id=SystemDisk,if=none,format=${disk_format},file="${disk_img}",${DRIVE_OPTIMISATIONS} ${STATUS_QUO})
else
# shellcheck disable=SC2054,SC2206
args+=(-device virtio-blk-pci,drive=SystemDisk
-drive id=SystemDisk,if=none,format=${disk_format},file="${disk_img}",${DRIVE_OPTIMISATIONS} ${STATUS_QUO})
fi
fi
# https://wiki.qemu.org/Documentation/9psetup
# https://askubuntu.com/questions/772784/9p-libvirt-qemu-share-modes
if [ "${guest_os}" != "windows" ] || [ "${guest_os}" == "windows-server" ] && [ -n "${PUBLIC}" ]; then
# shellcheck disable=SC2054
args+=(-fsdev local,id=fsdev0,path="${PUBLIC}",security_model=mapped-xattr
-device virtio-9p-pci,fsdev=fsdev0,mount_tag="${PUBLIC_TAG}")
fi
if [ -n "${USB_PASSTHROUGH}" ]; then
# shellcheck disable=SC2054,SC2206
args+=(-device ${USB_HOST_PASSTHROUGH_CONTROLLER},id=hostpass
${USB_PASSTHROUGH})
fi
if [ "${tpm}" == "on" ] && [ -S "${VMDIR}/${VMNAME}.swtpm-sock" ]; then
# shellcheck disable=SC2054
if [ "${ARCH_VM}" == "aarch64" ]; then
# ARM64 uses tpm-tis-device (system bus) instead of tpm-tis (ISA/LPC bus)
args+=(-chardev socket,id=chrtpm,path="${VMDIR}/${VMNAME}.swtpm-sock"
-tpmdev emulator,id=tpm0,chardev=chrtpm
-device tpm-tis-device,tpmdev=tpm0)
else
args+=(-chardev socket,id=chrtpm,path="${VMDIR}/${VMNAME}.swtpm-sock"
-tpmdev emulator,id=tpm0,chardev=chrtpm
-device tpm-tis,tpmdev=tpm0)
fi
fi
if [ "${monitor}" == "none" ]; then
args+=(-monitor none)
echo " - Monitor: (off)"
elif [ "${monitor}" == "telnet" ]; then
# Find a free port to expose monitor-telnet to the guest
TEMP_PORT="$(get_port "${monitor_telnet_port}" 9)"
if [ -z "${TEMP_PORT}" ]; then
echo " - Monitor: All Monitor-Telnet ports have been exhausted."
else
monitor_telnet_port="${TEMP_PORT}"
# shellcheck disable=SC2054
args+=(-monitor telnet:"${monitor_telnet_host}:${monitor_telnet_port}",server,nowait)
echo " - Monitor: On host: telnet ${monitor_telnet_host} ${monitor_telnet_port}"
echo "monitor-telnet,${monitor_telnet_port},${monitor_telnet_host}" >> "${VMDIR}/${VMNAME}.ports"
fi
elif [ "${monitor}" == "socket" ]; then
# shellcheck disable=SC2054,SC2206
args+=(-monitor unix:${SOCKET_MONITOR},server,nowait)
if command -v socat &>/dev/null; then
echo " - Monitor: On host: socat -,echo=0,icanon=0 unix-connect:${SOCKET_MONITOR}"
elif command -v nc &>/dev/null; then
echo " - Monitor: On host: nc -U \"${SOCKET_MONITOR}\""
fi
else
echo "ERROR! \"${monitor}\" is an unknown monitor option."
exit 1
fi
if [ "${serial}" == "none" ]; then
args+=(-serial none)
# No log output when serial is disabled - it's the default for macOS/Windows
# and provides no useful information to the user
elif [ "${serial}" == "telnet" ]; then
# Find a free port to expose serial-telnet to the guest
TEMP_PORT="$(get_port "${serial_telnet_port}" 9)"
if [ -z "${TEMP_PORT}" ]; then
echo " - Serial: All Serial Telnet ports have been exhausted."
else
serial_telnet_port="${TEMP_PORT}"
# shellcheck disable=SC2054,SC2206
args+=(-serial telnet:${serial_telnet_host}:${serial_telnet_port},server,nowait)
echo " - Serial: On host: telnet ${serial_telnet_host} ${serial_telnet_port}"
echo "serial-telnet,${serial_telnet_port},${serial_telnet_host}" >> "${VMDIR}/${VMNAME}.ports"
fi
elif [ "${serial}" == "socket" ]; then
# shellcheck disable=SC2054,SC2206
args+=(-serial unix:${SOCKET_SERIAL},server,nowait)
if command -v socat &>/dev/null; then
echo " - Serial: On host: socat -,echo=0,icanon=0 unix-connect:${SOCKET_SERIAL}"
elif command -v nc &>/dev/null; then
echo " - Serial: On host: nc -U \"${SOCKET_SERIAL}\""
fi
else
echo "ERROR! \"${serial}\" is an unknown serial option."
exit 1
fi
if [ -n "${extra_args}" ]; then
# shellcheck disable=SC2206
args+=(${extra_args})
fi
# The OSK parameter contains parenthesis, they need to be escaped in the shell
# scripts. The vendor name, Quickemu Project, contains a space. It needs to be
# double-quoted.
SHELL_ARGS="${args[*]}"
SHELL_ARGS="${SHELL_ARGS//\(/\\(}"
SHELL_ARGS="${SHELL_ARGS//)/\\)}"
SHELL_ARGS="${SHELL_ARGS//Quickemu Project/\"Quickemu Project\"}"
if [ -z "${VM_PID}" ]; then
echo "${QEMU}" "${SHELL_ARGS}" "2>/dev/null" >> "${VMDIR}/${VMNAME}.sh"
sed -i -e 's/ -/ \\\n -/g' "${VMDIR}/${VMNAME}.sh"
${QEMU} "${args[@]}" &> "${VMDIR}/${VMNAME}.log" &
VM_PID=$!
sleep 0.25
if kill -0 "${VM_PID}" 2>/dev/null; then
echo " - Process: Started ${VM} as ${VMNAME} (${VM_PID})"
configure_cpu_pinning
else
echo " - Process: ERROR! Failed to start ${VM} as ${VMNAME}"
rm -f "${VMDIR}/${VMNAME}.pid"
rm -f "${VMDIR}/${VMNAME}.spice"
rm -f "${VMDIR}/${VMNAME}.sock"
echo && cat "${VMDIR}/${VMNAME}.log"
exit 1
fi
fi
}
function start_viewer {
# Exit early if viewer is disabled or display is not SPICE
if [ "${viewer}" == "none" ] || [ "${display}" != "spice" ]; then
return
fi
# Build viewer arguments based on connection mode (Unix socket or TCP)
local viewer_args=()
local viewer_uri=""
local errno=0
# Determine connection mode from .spice file content
# - Unix socket mode: file contains a path (with /)
# - TCP mode: file contains just a port number
local spice_info=""
if [ -r "${VMDIR}/${VMNAME}.spice" ]; then
spice_info=$(cat "${VMDIR}/${VMNAME}.spice")
fi
if [[ "${spice_info}" == */* ]]; then
# Unix socket mode (path contains /)
local SPICE_SOCKET="${spice_info}"
if [ "${viewer}" == "spicy" ]; then
viewer_args+=("--uri=spice+unix://${SPICE_SOCKET}")
else
viewer_uri="spice+unix://${SPICE_SOCKET}"
fi
elif [ -n "${spice_info}" ]; then
# TCP mode (port number)
if [ "${viewer}" == "spicy" ]; then
viewer_args+=("--port" "${spice_info}")
else
viewer_uri="spice://localhost:${spice_info}"
fi
else
# Fallback: no .spice file, use ACCESS variable to determine mode
if [ -z "${ACCESS}" ] || [ "${ACCESS}" == "local" ]; then
# Unix socket mode
local SPICE_SOCKET="${VMDIR}/${VMNAME}.sock"
if [ "${viewer}" == "spicy" ]; then
viewer_args+=("--uri=spice+unix://${SPICE_SOCKET}")
else
viewer_uri="spice+unix://${SPICE_SOCKET}"
fi
else
# TCP mode for remote access
if [ "${viewer}" == "spicy" ]; then
viewer_args+=("--port" "${spice_port}")
else
viewer_uri="spice://localhost:${spice_port}"
fi
fi
fi
# Add common arguments
viewer_args+=("--title" "${VMNAME}")
# Add shared directory if configured (not for macOS guests)
if [ "${guest_os}" != "macos" ] && [ -n "${PUBLIC}" ]; then
viewer_args+=("--spice-shared-dir" "${PUBLIC}")
fi
# Add fullscreen if requested
if [ -n "${FULLSCREEN}" ]; then
viewer_args+=("${FULLSCREEN}")
fi
# Add URI for remote-viewer (spicy uses --uri= in the args already)
if [ "${viewer}" == "remote-viewer" ] && [ -n "${viewer_uri}" ]; then
viewer_args+=("${viewer_uri}")
fi
# Launch the viewer
echo " - Viewer: ${viewer} ${viewer_args[*]} >/dev/null 2>&1 &"
"${viewer}" "${viewer_args[@]}" >/dev/null 2>&1 &
errno=$?
if [ ${errno} -ne 0 ]; then
echo "WARNING! Could not start viewer (${viewer}) Err: ${errno}"
fi
}
function shortcut_create {
local dirname="${HOME}/.local/share/applications"
local filename="${HOME}/.local/share/applications/${VMNAME}.desktop"
echo "Creating ${VMNAME} desktop shortcut file"
if [ ! -d "${dirname}" ]; then
mkdir -p "${dirname}"
fi
cat << EOF > "${filename}"
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=$(basename "${0}") --vm ${VM} ${SHORTCUT_OPTIONS}
Path=${VMPATH}
Name=${VMNAME}
Icon=qemu
EOF
echo " - ${filename} created."
}
function usage() {
echo " _ _"
echo " __ _ _ _(_) ___| | _____ _ __ ___ _ _"
echo " / _' | | | | |/ __| |/ / _ \ '_ ' _ \| | | |"
echo "| (_| | |_| | | (__| < __/ | | | | | |_| |"
echo " \__, |\__,_|_|\___|_|\_\___|_| |_| |_|\__,_|"
echo " |_| v${VERSION}, using qemu ${QEMU_VER_LONG}"
echo "--------------------------------------------------------------------------------"
echo " Project - https://github.com/quickemu-project/quickemu"
echo " Discord - https://wimpysworld.io/discord"
echo "--------------------------------------------------------------------------------"
echo
echo "Usage"
echo " ${LAUNCHER} --vm ubuntu.conf "
echo
echo "Arguments"
echo " --access : Enable remote spice access support. 'local' (default), 'remote', 'clientipaddress'"
echo " --braille : Enable braille support. Requires SDL."
echo " --cpu-pinning : Choose which host cores correspond to which guest cores."
echo " --delete-disk : Delete the disk image and EFI variables"
echo " --delete-vm : Delete the entire VM and its configuration"
echo " --display : Select display backend. 'gtk' (default), 'sdl', 'cocoa', 'none', 'spice' or 'spice-app'"
echo " --fullscreen : Starts VM in full screen mode (Ctl+Alt+f to exit)"
echo " --ignore-msrs-always : Configure KVM to always ignore unhandled machine-specific registers"
echo " --ignore-tsc-warning : Skip TSC stability warning for macOS VMs on AMD"
echo " --kill : Kill the VM process if it is running"
echo " --offline : Override all network settings and start the VM offline"
echo " --shortcut : Create a desktop shortcut"
echo " --snapshot apply : Apply/restore a snapshot."
echo " --snapshot create : Create a snapshot."
echo " --snapshot delete : Delete a snapshot."
echo " --snapshot info : Show disk/snapshot info."
echo " --status-quo : Do not commit any changes to disk/snapshot."
echo " --viewer : Choose an alternative viewer. @Options: 'spicy' (default), 'remote-viewer', 'none'"
echo " --width : Set VM screen width; requires '--height'"
echo " --height : Set VM screen height; requires '--width'"
echo " --ssh-port : Set SSH port manually"
echo " --spice-port : Set SPICE port manually"
echo " --public-dir : Expose share directory. @Options: '' (default: xdg-user-dir PUBLICSHARE), '', 'none'"
echo " --monitor : Set monitor connection type. @Options: 'socket' (default), 'telnet', 'none'"
echo " --monitor-telnet-host : Set telnet host for monitor. (default: 'localhost')"
echo " --monitor-telnet-port : Set telnet port for monitor. (default: '4440')"
echo " --monitor-cmd : Send command to monitor if available. (Example: system_powerdown)"
echo " --serial : Set serial connection type. @Options: 'socket' (default), 'telnet', 'none'"
echo " --serial-telnet-host : Set telnet host for serial. (default: 'localhost')"
echo " --serial-telnet-port : Set telnet port for serial. (default: '6660')"
echo " --keyboard : Set keyboard. @Options: 'usb' (default), 'ps2', 'virtio'"
echo " --keyboard_layout : Set keyboard layout: 'en-us' (default)"
echo " --mouse : Set mouse. @Options: 'tablet' (default), 'ps2', 'usb', 'virtio'"
echo " --usb-controller : Set usb-controller. @Options: 'ehci' (default), 'xhci', 'none'"
echo " --sound-card : Set sound card. @Options: 'intel-hda' (default), 'ac97', 'es1370', 'sb16', 'usb-audio', 'virtio-sound-pci', 'none'"
echo " --sound-duplex : Set sound card duplex. @Options: 'hda-micro' (default: speaker/mic), 'hda-duplex' (line-in/line-out), 'hda-output' (output-only)"
echo " --extra_args : Pass additional arguments to qemu"
echo " --version : Print version"
}
function display_param_check() {
# Braille support requires SDL. Override $display if braille was requested.
if [ -n "${BRAILLE}" ]; then
display="sdl"
# XHCI supports USB 1.1/2.0/3.0; required for full-speed braille devices
usb_controller="xhci"
fi
# Fallback to SDL if GTK display is not available
if [ "${display}" == "gtk" ]; then
if ! "${QEMU}" -display help 2>&1 | grep -q "^gtk$"; then
echo " - NOTE: GTK display not available, falling back to SDL"
display="sdl"
fi
fi
if [ "${OS_KERNEL}" == "Darwin" ]; then
if [ "${display}" != "cocoa" ] && [ "${display}" != "none" ]; then
echo "ERROR! Requested output '${display}' but only 'cocoa' and 'none' are avalible on macOS."
exit 1
fi
else
if [ "${display}" != "gtk" ] && [ "${display}" != "none" ] && [ "${display}" != "sdl" ] && [ "${display}" != "spice" ] && [ "${display}" != "spice-app" ]; then
echo "ERROR! Requested output '${display}' is not recognised."
exit 1
fi
fi
# Set the default 3D acceleration.
if [ -z "${gl}" ]; then
if command -v glxinfo &>/dev/null; then
GLSL_VER=$(glxinfo | grep "OpenGL ES GLSL" | awk '{print $NF}')
case ${GLSL_VER} in
1*|2*) gl="off";;
*) gl="on";;
esac
else
gl="on"
fi
fi
# Enable grab-on-hover for SDL: https://github.com/quickemu-project/quickemu/issues/541
case "${display}" in
sdl) export SDL_MOUSE_FOCUS_CLICKTHROUGH=1;;
esac
}
function ports_param_check() {
if [ -n "${ssh_port}" ] && ! is_numeric "${ssh_port}"; then
echo "ERROR: ssh_port must be a number!"
exit 1
fi
if [ -n "${spice_port}" ] && ! is_numeric "${spice_port}"; then
echo "ERROR: spice_port must be a number!"
exit 1
fi
if [ -n "${monitor_telnet_port}" ] && ! is_numeric "${monitor_telnet_port}"; then
echo "ERROR: telnet port must be a number!"
exit 1
fi
if [ -n "${serial_telnet_port}" ] && ! is_numeric "${serial_telnet_port}"; then
echo "ERROR: serial port must be a number!"
exit 1
fi
}
function sound_card_param_check() {
if [ "${sound_card}" != "ac97" ] && [ "${sound_card}" != "es1370" ] && [ "${sound_card}" != "ich9-intel-hda" ] && [ "${sound_card}" != "intel-hda" ] && [ "${sound_card}" != "sb16" ] && [ "${sound_card}" != "usb-audio" ] && [ "${sound_card}" != "virtio-sound-pci" ] && [ "${sound_card}" != "none" ]; then
echo "ERROR! Requested sound card '${sound_card}' is not recognised."
exit 1
fi
# USB audio requires xhci controller
if [ "${sound_card}" == "usb-audio" ]; then
usb_controller="xhci";
fi
#name "hda-duplex", bus HDA, desc "HDA Audio Codec, duplex (line-out, line-in)"
#name "hda-micro", bus HDA, desc "HDA Audio Codec, duplex (speaker, microphone)"
#name "hda-output", bus HDA, desc "HDA Audio Codec, output-only (line-out)"
if [ "${sound_duplex}" != "hda-duplex" ] && [ "${sound_duplex}" != "hda-micro" ] && [ "${sound_duplex}" != "hda-output" ]; then
echo "ERROR! Requested sound duplex '${sound_duplex}' is not recognised."
exit 1
fi
}
function tpm_param_check() {
if [ "${tpm}" == "on" ]; then
SWTPM=$(command -v swtpm)
if [ ! -e "${SWTPM}" ]; then
echo "ERROR! TPM is enabled, but swtpm was not found."
exit 1
fi
fi
}
function viewer_param_check() {
if [ "${OS_KERNEL}" == "Darwin" ]; then
return
fi
if [ "${viewer}" != "none" ] && [ "${viewer}" != "spicy" ] && [ "${viewer}" != "remote-viewer" ]; then
echo "ERROR! Requested viewer '${viewer}' is not recognised."
exit 1
fi
if [ "${viewer}" == "spicy" ] && ! command -v spicy &>/dev/null; then
echo "ERROR! Requested 'spicy' as viewer, but 'spicy' is not installed."
exit 1
elif [ "${viewer}" == "remote-viewer" ] && ! command -v remote-viewer &>/dev/null; then
echo "ERROR! Requested 'remote-viewer' as viewer, but 'remote-viewer' is not installed."
exit 1
fi
}
function fileshare_param_check() {
if [ "${PUBLIC}" == "none" ]; then
PUBLIC=""
else
# PUBLICSHARE is the only directory exposed to guest VMs for file
# sharing via 9P, spice-webdavd and Samba. This path is not configurable.
if [ -z "${PUBLIC}" ]; then
if command -v xdg-user-dir &>/dev/null; then
PUBLIC=$(xdg-user-dir PUBLICSHARE)
elif [ -d "${HOME}/Public" ]; then
PUBLIC="${HOME}/Public"
fi
fi
if [ ! -d "${PUBLIC}" ]; then
echo " - WARNING! Public directory: '${PUBLIC}' doesn't exist!"
PUBLIC=""
else
PUBLIC_TAG="Public-${USER,,}"
PUBLIC_PERMS=$(${STAT} -c "%A" "${PUBLIC}")
fi
fi
}
function parse_ports_from_file {
local FILE="${VMDIR}/${VMNAME}.ports"
local host_name=""
local port_name=""
local port_number=""
# Loop over each line in the file
while IFS= read -r CONF || [ -n "${CONF}" ]; do
# parse ports
port_name=$(echo "${CONF}" | cut -d',' -f 1)
port_number=$(echo "${CONF}" | cut -d',' -f 2)
host_name=$(echo "${CONF}" | awk 'FS="," {print $3,"."}')
if [ "${port_name}" == "ssh" ]; then
ssh_port="${port_number}"
elif [ "${port_name}" == "spice" ]; then
spice_port="${port_number}"
elif [ "${port_name}" == "monitor-telnet" ]; then
monitor_telnet_port="${port_number}"
monitor_telnet_host="${host_name}"
elif [ "${port_name}" == "serial-telnet" ]; then
serial_telnet_port="${port_number}"
serial_telnet_host="${host_name}"
fi
done < "${FILE}"
}
function is_numeric {
[[ "$1" =~ ^[0-9]+$ ]]
}
function monitor_send_cmd {
local MSG="${1}"
if [ -z "${MSG}" ]; then
echo "WARNING! Send to QEMU-Monitor: Message empty!"
return 1
fi
case "${monitor}" in
socket)
echo -e " - Sending: via socket ${MSG}"
echo -e "${MSG}" | socat -,shut-down unix-connect:"${SOCKET_MONITOR}" > /dev/null 2>&1;;
telnet)
echo -e " - Sending: via telnet ${MSG}"
echo -e "${MSG}" | socat - tcp:"${monitor_telnet_host}":"${monitor_telnet_port}" > /dev/null 2>&1;;
*)
echo "WARNING! No qemu-monitor channel available - Couldn't send message to monitor!"
return 1;;
esac
return 0
}
### MAIN
# Lowercase variables are used in the VM config file only
boot="efi"
cpu_cores=""
disk_format="${disk_format:-qcow2}"
disk_img="${disk_img:-}"
disk_size="${disk_size:-16G}"
display="${display:-gtk}"
extra_args="${extra_args:-}"
fixed_iso=""
floppy=""
guest_os="linux"
img=""
iso=""
macaddr=""
macos_release=""
network=""
port_forwards=()
preallocation="off"
ram=""
secureboot="off"
tpm="off"
usb_devices=()
viewer="${viewer:-spicy}"
width="${width:-}"
height="${height:-}"
ssh_port="${ssh_port:-}"
spice_port="${spice_port:-}"
monitor="${monitor:-socket}"
monitor_telnet_port="${monitor_telnet_port:-4440}"
monitor_telnet_host="${monitor_telnet_host:-localhost}"
# Serial default is set later based on guest_os (after config is sourced)
serial="${serial:-}"
serial_telnet_port="${serial_telnet_port:-6660}"
serial_telnet_host="${serial_telnet_host:-localhost}"
# options: ehci (USB2.0), xhci (USB3.0)
usb_controller="${usb_controller:-ehci}"
keyboard="${keyboard:-usb}"
keyboard_layout="${keyboard_layout:-en-us}"
mouse="${mouse:-tablet}"
sound_card="${sound_card:-intel-hda}"
sound_duplex="${sound_duplex:-hda-micro}"
ACCESS=""
ACTIONS=()
BRAILLE=""
IGNORE_TSC_WARNING=""
CPU_PINNING=""
FULLSCREEN=""
MONITOR_CMD=""
PUBLIC=""
PUBLIC_PERMS=""
PUBLIC_TAG=""
SHORTCUT_OPTIONS=""
SNAPSHOT_ACTION=""
SNAPSHOT_TAG=""
SOCKET_MONITOR=""
SOCKET_SERIAL=""
STATUS_QUO=""
USB_PASSTHROUGH=""
VM=""
VMDIR=""
VMNAME=""
VMPATH=""
# CPU flag tracking map for deduplication and conflict detection
declare -A CPU_FLAG_MAP
# shellcheck disable=SC2155
readonly LAUNCHER=$(basename "${0}")
readonly DISK_MIN_SIZE=$((197632 * 8))
readonly VERSION="4.9.9"
# Default architecture is x86_64, can be overridden by config file (arch="aarch64")
arch="${arch:-x86_64}"
ARCH_VM="${arch}"
ARCH_HOST=$(uname -m)
QEMU=$(command -v "qemu-system-${ARCH_VM}")
QEMU_IMG=$(command -v qemu-img)
if [ ! -x "${QEMU}" ] || [ ! -x "${QEMU_IMG}" ]; then
echo "ERROR! QEMU not found. Please make sure 'qemu-system-${ARCH_VM}' and 'qemu-img' are installed."
exit 1
fi
# Check for gnu tools on macOS
STAT="stat"
if command -v gstat &>/dev/null; then
STAT="gstat"
fi
OS_KERNEL=$(uname -s)
if [ "${OS_KERNEL}" == "Darwin" ]; then
display="cocoa"
fi
QEMU_VER_LONG=$(${QEMU_IMG} --version | head -n 1 | awk '{print $3}')
# strip patch version and remove dots. 6.0.0 => 60 / 10.0.0 => 100
QEMU_VER_SHORT="${QEMU_VER_LONG%.*}"
QEMU_VER_SHORT="${QEMU_VER_SHORT/./}"
if [ "${QEMU_VER_SHORT}" -lt 61 ]; then
echo "ERROR! QEMU 6.1.0 or newer is required, detected ${QEMU_VER_LONG}."
exit 1
fi
# Take command line arguments
if [ $# -lt 1 ]; then
usage
exit 1
else
while [ $# -gt 0 ]; do
case "${1}" in
-access|--access)
SHORTCUT_OPTIONS+="--access ${2} "
ACCESS="${2}"
shift 2;;
-braille|--braille)
SHORTCUT_OPTIONS+="--braille "
BRAILLE="on"
shift;;
-cpu-pinning|--cpu-pinning)
SHORTCUT_OPTIONS+="--cpu-pinning ${2} "
CPU_PINNING=${2}
shift 2;;
-delete|--delete|-delete-disk|--delete-disk)
ACTIONS+=(delete_disk)
shift;;
-delete-vm|--delete-vm)
ACTIONS+=(delete_vm)
shift;;
-display|--display)
SHORTCUT_OPTIONS+="--display ${2} "
display="${2}"
display_param_check
shift 2;;
-fullscreen|--fullscreen|-full-screen|--full-screen)
SHORTCUT_OPTIONS+="--fullscreen "
FULLSCREEN="--full-screen"
shift;;
-ignore-msrs-always|--ignore-msrs-always)
ignore_msrs_always
exit;;
-ignore-tsc-warning|--ignore-tsc-warning)
IGNORE_TSC_WARNING="1"
shift;;
-kill|--kill)
ACTIONS+=(kill_vm)
shift;;
-offline|--offline)
SHORTCUT_OPTIONS+="--offline "
network="none"
shift;;
-snapshot|--snapshot)
if [ -z "${2}" ]; then
echo "ERROR! '--snapshot' needs an action to perform."
exit 1
fi
SNAPSHOT_ACTION="${2}"
if [ -z "${3}" ] && [ "${SNAPSHOT_ACTION}" != "info" ]; then
echo "ERROR! '--snapshot ${SNAPSHOT_ACTION}' needs a tag."
exit 1
fi
SNAPSHOT_TAG="${3}"
if [ "${SNAPSHOT_ACTION}" == "info" ]; then
shift 2
else
shift 3
fi;;
-status-quo|--status-quo)
STATUS_QUO="-snapshot"
shift;;
-shortcut|--shortcut)
ACTIONS+=(shortcut_create)
shift;;
-vm|--vm)
VM="${2}"
shift 2;;
-viewer|--viewer)
SHORTCUT_OPTIONS+="--viewer ${2} "
viewer="${2}"
shift 2;;
-width|--width)
SHORTCUT_OPTIONS+="--width ${2} "
width="${2}"
shift 2;;
-height|--height)
SHORTCUT_OPTIONS+="--height ${2} "
height="${2}"
shift 2;;
-ssh-port|--ssh-port)
SHORTCUT_OPTIONS+="--ssh-port ${2} "
ssh_port="${2}"
shift 2;;
-spice-port|--spice-port)
SHORTCUT_OPTIONS+="--spice-port ${2} "
spice_port="${2}"
shift 2;;
-public-dir|--public-dir)
SHORTCUT_OPTIONS+="--public-dir ${2} "
PUBLIC="${2}"
shift 2;;
-monitor|--monitor)
SHORTCUT_OPTIONS+="--monitor ${2} "
monitor="${2}"
shift 2;;
-monitor-cmd|--monitor-cmd)
SHORTCUT_OPTIONS+="--monitor-cmd ${2} "
MONITOR_CMD="${2}"
shift 2;;
-monitor-telnet-host|--monitor-telnet-host)
SHORTCUT_OPTIONS+="--monitor-telnet-host ${2} "
monitor_telnet_host="${2}"
shift 2;;
-monitor-telnet-port|--monitor-telnet-port)
SHORTCUT_OPTIONS+="--monitor-telnet-port ${2} "
monitor_telnet_port="${2}"
shift 2;;
-serial|--serial)
SHORTCUT_OPTIONS+="--serial ${2} "
serial="${2}"
shift 2;;
-serial-telnet-host|--serial-telnet-host)
SHORTCUT_OPTIONS+="--serial-telnet-host ${2} "
serial_telnet_host="${2}"
shift 2;;
-serial-telnet-port|--serial-telnet-port)
SHORTCUT_OPTIONS+="--serial-telnet-port ${2} "
serial_telnet_port="${2}"
shift 2;;
-keyboard|--keyboard)
SHORTCUT_OPTIONS+="--keyboard ${2} "
keyboard="${2}"
shift 2;;
-keyboard_layout|--keyboard_layout)
SHORTCUT_OPTIONS+="--keyboard_layout ${2} "
keyboard_layout="${2}"
shift 2;;
-mouse|--mouse)
SHORTCUT_OPTIONS+="--mouse ${2} "
mouse="${2}"
shift 2;;
-usb-controller|--usb-controller)
SHORTCUT_OPTIONS+="--usb-controller ${2} "
usb_controller="${2}"
shift 2;;
-extra_args|--extra_args)
SHORTCUT_OPTIONS+="--extra_args ${2} "
extra_args+="${2}"
shift 2;;
-sound-card|--sound-card)
SHORTCUT_OPTIONS+="--sound-card ${2} "
sound_card="${2}"
shift 2;;
-sound-duplex|--sound-duplex)
SHORTCUT_OPTIONS+="--sound-duplex ${2} "
sound_duplex="${2}"
shift 2;;
-version|--version)
echo "${VERSION}"
exit;;
-h|--h|-help|--help)
usage
exit 0;;
*)
echo "ERROR! \"${1}\" is not a supported parameter."
usage
exit 1;;
esac
done
fi
if [ -n "${VM}" ] && [ -e "${VM}" ]; then
# shellcheck source=/dev/null
source "${VM}"
PUBLIC="${public_dir:-${PUBLIC}}"
# Re-detect architecture and QEMU binary after sourcing config
# Config file can set arch="aarch64" to override the default
ARCH_VM="${arch:-x86_64}"
QEMU=$(command -v "qemu-system-${ARCH_VM}")
if [ ! -x "${QEMU}" ]; then
echo "ERROR! qemu-system-${ARCH_VM} not found."
echo " Please install QEMU for ${ARCH_VM} architecture."
exit 1
fi
VMDIR=$(dirname "${disk_img}") # directory the VM disk and state files are stored
VMNAME=$(basename "${VM}" .conf) # name of the VM
VMPATH=$(realpath "$(dirname "${VM}")") # path to the top-level VM directory
SOCKET_MONITOR="${VMDIR}/${VMNAME}-monitor.socket"
SOCKET_SERIAL="${VMDIR}/${VMNAME}-serial.socket"
# Set serial default based on guest_os if not explicitly configured.
# macOS and Windows guests don't output anything useful to serial by default,
# so disable it to reduce clutter. Users can still override with --serial.
if [ -z "${serial}" ]; then
case "${guest_os}" in
macos|windows|windows-server)
serial="none"
;;
*)
serial="socket"
;;
esac
fi
# if disk_img is not configured, do the right thing.
if [ -z "${disk_img}" ]; then
disk_img="${VMDIR}/disk.${disk_format}"
fi
# Fixes running VMs when PWD is not relative to the VM directory
# https://github.com/quickemu-project/quickemu/pull/875
if [ ! -f "${disk_img}" ]; then
pushd "${VMPATH}" >/dev/null || exit
fi
# Check if VM is already running
VM_PID=""
if [ -r "${VMDIR}/${VMNAME}.pid" ]; then
VM_PID=$(head -n 1 "${VMDIR}/${VMNAME}.pid")
if ! kill -0 "${VM_PID}" > /dev/null 2>&1; then
#VM is not running, cleaning up.
VM_PID=""
rm -f "${VMDIR}/${VMNAME}.pid"
rm -f "${VMDIR}/${VMNAME}.spice"
rm -f "${VMDIR}/${VMNAME}.sock"
fi
fi
# Iterate over any actions and exit.
if [ ${#ACTIONS[@]} -ge 1 ]; then
for ACTION in "${ACTIONS[@]}"; do
${ACTION}
done
exit
fi
if [ -n "${SNAPSHOT_ACTION}" ]; then
case ${SNAPSHOT_ACTION} in
apply)
snapshot_apply "${SNAPSHOT_TAG}"
snapshot_info
exit;;
create)
snapshot_create "${SNAPSHOT_TAG}"
snapshot_info
exit;;
delete)
snapshot_delete "${SNAPSHOT_TAG}"
snapshot_info
exit;;
info)
echo "Snapshot information ${disk_img}"
snapshot_info
exit;;
*)
echo "ERROR! \"${SNAPSHOT_ACTION}\" is not a supported snapshot action."
usage
exit 1;;
esac
fi
else
echo "ERROR! Virtual machine configuration not found."
usage
exit 1
fi
display_param_check
ports_param_check
sound_card_param_check
tpm_param_check
viewer_param_check
fileshare_param_check
if [ -z "${VM_PID}" ]; then
vm_boot
start_viewer
# If the VM being started is an uninstalled Windows VM then auto-skip the press-any key prompt.
if [ -n "${iso}" ] && [[ "${guest_os}" == "windows"* ]]; then
# shellcheck disable=SC2034
for LOOP in {1..5}; do
sleep 1
monitor_send_cmd "sendkey ret"
done
fi
else
echo "${VMNAME}"
echo " - Process: Already running ${VM} as ${VMNAME} (${VM_PID})"
parse_ports_from_file
# Auto-detect SPICE if .spice file exists and display is a default GUI type
if [ -r "${VMDIR}/${VMNAME}.spice" ]; then
if [ "${display}" == "sdl" ] || [ "${display}" == "cocoa" ] || [ "${display}" == "gtk" ]; then
display="spice"
spice_port=$(cat "${VMDIR}/${VMNAME}.spice")
fi
fi
start_viewer
fi
if [ -n "${MONITOR_CMD}" ]; then
monitor_send_cmd "${MONITOR_CMD}"
fi
# vim:tabstop=4:shiftwidth=4:expandtab
================================================
FILE: quickget
================================================
#!/usr/bin/env bash
# SC2317: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
# - https://www.shellcheck.net/wiki/SC2317
# - Disable globally because many functions are called indirectly
# shellcheck disable=SC2317
export LC_ALL=C
# Detect host OS for checksum tool compatibility
HOST_OS=$(uname -s)
# Default architecture based on host
HOST_ARCH=$(uname -m)
case "${HOST_ARCH}" in
aarch64|arm64) ARCH="arm64";;
*) ARCH="amd64";;
esac
function arch_suffix() {
# Return architecture suffix for foreign architectures, empty for native
if [ "${ARCH}" != "${NORMALISED_HOST_ARCH}" ]; then
echo "-${ARCH}"
fi
}
function cleanup() {
if [ -n "$(jobs -p)" ]; then
kill "$(jobs -p)" 2>/dev/null
fi
}
function os_info() {
local SIMPLE_NAME=""
local INFO=""
SIMPLE_NAME="${1}"
case ${SIMPLE_NAME} in
#name) INFO="PrettyName|Credentials|Homepage|Info";;
alma) INFO="AlmaLinux|-|https://almalinux.org/|Community owned and governed, forever-free enterprise Linux distribution, focused on long-term stability, providing a robust production-grade platform. AlmaLinux OS is binary compatible with RHEL®.";;
alpine) INFO="Alpine Linux|-|https://alpinelinux.org/|Security-oriented, lightweight Linux distribution based on musl libc and busybox.";;
android) INFO="Android x86|-|https://www.android-x86.org/|Port Android Open Source Project to x86 platform.";;
antix) INFO="Antix|-|https://antixlinux.com/|Fast, lightweight and easy to install systemd-free linux live CD distribution based on Debian Stable for Intel-AMD x86 compatible systems.";;
archcraft) INFO="Archcraft|-|https://archcraft.io/|Yet another minimal Linux distribution, based on Arch Linux.";;
archlinux) INFO="Arch Linux|-|https://archlinux.org/|Lightweight and flexible Linux® distribution that tries to Keep It Simple.";;
artixlinux) INFO="Artix Linux|-|https://artixlinux.org/|The Art of Linux. Simple. Fast. Systemd-free.";;
azurelinux) INFO="Azure Linux|-|https://github.com/microsoft/azurelinux|Microsoft's internal Linux distribution for cloud infrastructure and edge.";;
batocera) INFO="Batocera|-|https://batocera.org/|Retro-gaming distribution with the aim of turning any computer/nano computer into a gaming console during a game or permanently.";;
bazzite) INFO="Bazzite|-|https://github.com/ublue-os/bazzite/|Container native gaming and a ready-to-game SteamOS like.";;
biglinux) INFO="BigLinux|-|https://www.biglinux.com.br/|Is the right choice if you want to have an easy and enriching experience with Linux. It has been perfected over more than 19 years, following our motto: 'In search of the perfect system'.";;
blendos) INFO="BlendOS|-|https://blendos.co/|A seamless blend of all Linux distributions. Allows you to have an immutable, atomic and declarative Arch Linux system, with application support from several Linux distributions & Android.";;
bodhi) INFO="Bodhi|-|https://www.bodhilinux.com/|Lightweight distribution featuring the fast & fully customizable Moksha Desktop.";;
bunsenlabs) INFO="BunsenLabs|-|https://www.bunsenlabs.org/|Light-weight and easily customizable Openbox desktop. The project is a community continuation of CrunchBang Linux.";;
cachyos) INFO="CachyOS|-|https://cachyos.org/|Designed to deliver lightning-fast speeds and stability, ensuring a smooth and enjoyable computing experience every time you use it.";;
centos-stream) INFO="CentOS Stream|-|https://www.centos.org/centos-stream/|Continuously delivered distro that tracks just ahead of Red Hat Enterprise Linux (RHEL) development, positioned as a midstream between Fedora Linux and RHEL.";;
chimeralinux) INFO="Chimera Linux|anon:chimera root:chimera|https://chimera-linux.org/|Modern, general-purpose non-GNU Linux distribution.";;
crunchbang++) INFO="Crunchbangplusplus|-|https://www.crunchbangplusplus.org/|The classic minimal crunchbang feel, now with debian 12 bookworm.";;
debian) INFO="Debian|-|https://www.debian.org/|Complete Free Operating System with perfect level of ease of use and stability.";;
deepin) INFO="Deepin|-|https://www.deepin.org/|Beautiful UI design, intimate human-computer interaction, and friendly community environment make you feel at home.";;
devuan) INFO="Devuan|-|https://www.devuan.org/|Fork of Debian without systemd that allows users to reclaim control over their system by avoiding unnecessary entanglements and ensuring Init Freedom.";;
dragonflybsd) INFO="DragonFlyBSD|-|https://www.dragonflybsd.org/|Provides an opportunity for the BSD base to grow in an entirely different direction from the one taken in the FreeBSD, NetBSD, and OpenBSD series.";;
easyos) INFO="EasyOS|-|https://easyos.org/|Experimental distribution designed from scratch to support containers.";;
edubuntu) INFO="Edubuntu|-|https://www.edubuntu.org/|Stable, secure and privacy conscious option for schools.";;
elementary) INFO="elementary OS|-|https://elementary.io/|Thoughtful, capable, and ethical replacement for Windows and macOS.";;
endeavouros) INFO="EndeavourOS|-|https://endeavouros.com/|Provides an Arch experience without the hassle of installing it manually for both x86_64 and ARM systems.";;
endless) INFO="Endless OS|-|https://www.endlessos.org/os|Completely Free, User-Friendly Operating System Packed with Educational Tools, Games, and More.";;
fedora) INFO="Fedora|-|https://www.fedoraproject.org/|Innovative platform for hardware, clouds, and containers, built with love by you.";;
freebsd) INFO="FreeBSD|-|https://www.freebsd.org/|Operating system used to power modern servers, desktops, and embedded platforms.";;
freedos) INFO="FreeDOS|-|https://freedos.org/|DOS-compatible operating system that you can use to play classic DOS games, run legacy business software, or develop embedded systems.";;
garuda) INFO="Garuda Linux|-|https://garudalinux.org/|Feature rich and easy to use Linux distribution.";;
gentoo) INFO="Gentoo|-|https://www.gentoo.org/|Highly flexible, source-based Linux distribution.";;
ghostbsd) INFO="GhostBSD|-|https://www.ghostbsd.org/|Simple, elegant desktop BSD Operating System.";;
gnomeos) INFO="GNOME OS|-|https://os.gnome.org/|Alpha nightly bleeding edge distro of GNOME";;
guix) INFO="Guix|-|https://guix.gnu.org/|Distribution of the GNU operating system developed by the GNU Project—which respects the freedom of computer users.";;
haiku) INFO="Haiku|-|https://www.haiku-os.org/|Specifically targets personal computing. Inspired by the BeOS, Haiku is fast, simple to use, easy to learn and yet very powerful.";;
kali) INFO="Kali|-|https://www.kali.org/|The most advanced Penetration Testing Distribution.";;
kdeneon) INFO="KDE Neon|-|https://neon.kde.org/|Latest and greatest of KDE community software packaged on a rock-solid base.";;
kolibrios) INFO="KolibriOS|-|https://kolibrios.org/en/|Tiny yet incredibly powerful and fast operating system.";;
kubuntu) INFO="Kubuntu|-|https://kubuntu.org/|Free, complete, and open-source alternative to Microsoft Windows and Mac OS X which contains everything you need to work, play, or share.";;
linuxlite) INFO="Linux Lite|-|https://www.linuxliteos.com/|Your first simple, fast and free stop in the world of Linux.";;
linuxmint) INFO="Linux Mint|-|https://linuxmint.com/|Designed to work out of the box and comes fully equipped with the apps most people need.";;
lmde) INFO="Linux Mint Debian Edition|-|https://www.linuxmint.com/download_lmde.php|Aims to be as similar as possible to Linux Mint, but without using Ubuntu. The package base is provided by Debian instead.";;
lubuntu) INFO="Lubuntu|-|https://lubuntu.me/|Complete Operating System that ships the essential apps and services for daily use: office applications, PDF reader, image editor, music and video players, etc. Using lightwave lxde/lxqt.";;
maboxlinux) INFO="Mabox Linux|-|https://maboxlinux.org/|Lightweight, functional and easy to customize Openbox desktop";;
mageia) INFO="Mageia|-|https://www.mageia.org/|Stable, secure operating system for desktop & server.";;
manjaro) INFO="Manjaro|-|https://manjaro.org/|Versatile, free, and open-source Linux operating system designed with a strong focus on safeguarding user privacy and offering extensive control over hardware.";;
mxlinux) INFO="MX Linux|-|https://mxlinux.org/|Designed to combine elegant and efficient desktops with high stability and solid performance.";;
netboot) INFO="netboot.xyz|-|https://netboot.xyz/|Your favorite operating systems in one place.";;
netbsd) INFO="NetBSD|-|https://www.netbsd.org/|Free, fast, secure, and highly portable Unix-like Open Source operating system. It is available for a wide range of platforms, from large-scale servers and powerful desktop systems to handheld and embedded devices.";;
nitrux) INFO="Nitrux|-|https://nxos.org/|Powered by Debian, KDE Plasma and Frameworks, and AppImages.";;
nixos) INFO="NixOS|-|https://nixos.org/|Linux distribution based on Nix package manager, tool that takes a unique approach to package management and system configuration.";;
nwg-shell) INFO="nwg-shell|nwg:nwg|https://nwg-piotr.github.io/nwg-shell/|Arch Linux ISO with nwg-shell for sway and Hyprland";;
macos) INFO="macOS|-|https://www.apple.com/macos/|Work and play on your Mac are even more powerful. Elevate your presence on video calls. Access information in all-new ways. Boost gaming performance. And discover even more ways to personalize your Mac.";;
openbsd) INFO="OpenBSD|-|https://www.openbsd.org/|FREE, multi-platform 4.4BSD-based UNIX-like operating system. Our efforts emphasize portability, standardization, correctness, proactive security and integrated cryptography.";;
openindiana) INFO="OpenIndiana|-|https://www.openindiana.org/|Community supported illumos-based operating system.";;
opensuse) INFO="openSUSE|-|https://www.opensuse.org/|The makers choice for sysadmins, developers and desktop users.";;
oraclelinux) INFO="Oracle Linux|-|https://www.oracle.com/linux/|Linux with everything required to deploy, optimize, and manage applications on-premises, in the cloud, and at the edge.";;
parrotsec) INFO="Parrot Security|parrot:parrot|https://www.parrotsec.org/|Provides a huge arsenal of tools, utilities and libraries that IT and security professionals can use to test and assess the security of their assets in a reliable, compliant and reproducible way.";;
pclinuxos) INFO="PCLinuxOS|-|https://www.pclinuxos.com/|PCLinuxOS is a free easy to use Linux-based Operating System for x86_64 desktops or laptops.";;
peppermint) INFO="PeppermintOS|-|https://peppermintos.com/|Provides a user with the opportunity to build the system that best fits their needs. While at the same time providing a functioning OS with minimum hassle out of the box.";;
popos) INFO="Pop!_OS|-|https://pop.system76.com/|Operating system for STEM and creative professionals who use their computer as a tool to discover and create.";;
porteus) INFO="Porteus|-|http://www.porteus.org/|Complete linux operating system that is optimized to run from CD, USB flash drive, hard drive, or other bootable storage media.";;
primtux) INFO="PrimTux|-|https://primtux.fr/|A complete and customizable GNU/Linux operating system intended for primary school students and suitable even for older hardware.";;
proxmox-ve) INFO="Proxmox VE|-|https://proxmox.com/en/proxmox-virtual-environment/|Proxmox Virtual Environment is a complete, open-source server management platform for enterprise virtualization.";;
pureos) INFO="PureOS|-|https://www.pureos.net/|A fully free/libre and open source GNU/Linux operating system, endorsed by the Free Software Foundation.";;
reactos) INFO="ReactOS|-|https://reactos.org/|Imagine running your favorite Windows applications and drivers in an open-source environment you can trust.";;
rebornos) INFO="RebornOS|-|https://rebornos.org/|Aiming to make Arch Linux as user friendly as possible by providing interface solutions to things you normally have to do in a terminal.";;
rockylinux) INFO="Rocky Linux|-|https://rockylinux.org/|Open-source enterprise operating system designed to be 100% bug-for-bug compatible with Red Hat Enterprise Linux®.";;
siduction) INFO="Siduction|-|https://siduction.org/|Operating system based on the Linux kernel and the GNU project. In addition, there are applications and libraries from Debian.";;
slackware) INFO="Slackware|-|http://www.slackware.com/|Advanced Linux operating system, designed with the twin goals of ease of use and stability as top priorities.";;
slax) INFO="Slax|-|https://www.slax.org/|Compact, fast, and modern Linux operating system that combines sleek design with modular approach. With the ability to run directly from a USB flash drive without the need for installation, Slax is truly portable and fits easily in your pocket.";;
slint) INFO="Slint|-|https://slint.fr/|Slint is an easy-to-use, versatile, blind-friendly Linux distribution for 64-bit computers. Slint is based on Slackware and borrows tools from Salix. Maintainer: Didier Spaier.";;
slitaz) INFO="SliTaz|-|https://www.slitaz.org/en/|Simple, fast and low resource Linux OS for servers & desktops.";;
solus) INFO="Solus|-|https://getsol.us/|Designed for home computing. Every tweak enables us to deliver a cohesive computing experience.";;
sparkylinux) INFO="SparkyLinux|-|https://sparkylinux.org/|Fast, lightweight and fully customizable operating system which offers several versions for different use cases.";;
spirallinux) INFO="SpiralLinux|-|https://spirallinux.github.io/|Selection of Linux spins built from Debian GNU/Linux, with a focus on simplicity and out-of-the-box usability across all the major desktop environments.";;
tails) INFO="Tails|-|https://tails.net/|Portable operating system that protects against surveillance and censorship.";;
tinycore) INFO="Tiny Core Linux|-|http://www.tinycorelinux.net/|Highly modular based system with community build extensions.";;
trisquel) INFO="Trisquel|-|https://trisquel.info/|Fully free operating system for home users, small enterprises and educational centers.";;
tuxedo-os) INFO="Tuxedo OS|-|https://www.tuxedocomputers.com/en/|KDE Ubuntu LTS designed to go with their Linux hardware.";;
ubuntu) INFO="Ubuntu|-|https://ubuntu.com/|Complete desktop Linux operating system, freely available with both community and professional support.";;
ubuntu-budgie) INFO="Ubuntu Budgie|-|https://ubuntubudgie.org/|Community developed distribution, integrating the Budgie Desktop Environment with Ubuntu at its core.";;
ubuntucinnamon) INFO="Ubuntu Cinnamon|-|https://ubuntucinnamon.org/|Community-driven, featuring Linux Mint’s Cinnamon Desktop with Ubuntu at the core, packed fast and full of features, here is the most traditionally modern desktop you will ever love.";;
ubuntukylin) INFO="Ubuntu Kylin|-|https://ubuntukylin.com/|Universal desktop operating system for personal computers, laptops, and embedded devices. It is dedicated to bringing a smarter user experience to users all over the world.";;
ubuntu-mate) INFO="Ubuntu MATE|-|https://ubuntu-mate.org/|Stable, easy-to-use operating system with a configurable desktop environment. It is ideal for those who want the most out of their computers and prefer a traditional desktop metaphor. Using Mate desktop.";;
ubuntu-server) INFO="Ubuntu Server|-|https://ubuntu.com/server|Brings economic and technical scalability to your datacentre, public or private. Whether you want to deploy an OpenStack cloud, a Kubernetes cluster or a 50,000-node render farm, Ubuntu Server delivers the best value scale-out performance available.";;
ubuntustudio) INFO="Ubuntu Studio|-|https://ubuntustudio.org/|Comes preinstalled with a selection of the most common free multimedia applications available, and is configured for best performance for various purposes: Audio, Graphics, Video, Photography and Publishing.";;
ubuntu-unity) INFO="Ubuntu Unity|-|https://ubuntuunity.org/|Flavor of Ubuntu featuring the Unity7 desktop environment (the default desktop environment used by Ubuntu from 2010-2017).";;
vanillaos) INFO="Vanilla OS|-|https://vanillaos.org/|Designed to be a reliable and productive operating system for your daily work.";;
void) INFO="Void Linux|anon:voidlinux|https://voidlinux.org/|General purpose operating system. Its package system allows you to quickly install, update and remove software; software is provided in binary packages or can be built directly from sources.";;
windows) INFO="Windows|-|https://www.microsoft.com/en-us/windows/|Whether you’re gaming, studying, running a business, or running a household, Windows helps you get it done.";;
windows-server) INFO="Windows Server|-|https://www.microsoft.com/en-us/windows-server/|Platform for building an infrastructure of connected applications, networks, and web services.";;
xubuntu) INFO="Xubuntu|-|https://xubuntu.org/|Elegant and easy to use operating system. Xubuntu comes with Xfce, which is a stable, light and configurable desktop environment.";;
zorin) INFO="Zorin OS|-|https://zorin.com/os/|Alternative to Windows and macOS designed to make your computer faster, more powerful, secure, and privacy-respecting.";;
esac
echo "${INFO}"
}
function show_os_info() {
echo
echo -e "$(os_info "${1}" | cut -d'|' -f 1)"
echo -e " - Credentials:\t$(os_info "${1}" | cut -d'|' -f 2)"
echo -e " - Website:\t$(os_info "${1}" | cut -d'|' -f 3)"
echo -e " - Description:\t$(os_info "${1}" | cut -d'|' -f 4)"
}
function pretty_name() {
os_info "${1}" | cut -d'|' -f 1
}
# Just in case quickget want use it
function os_homepage() {
os_info "${1}" | cut -d'|' -f 3
}
function error_specify_os() {
echo "ERROR! You must specify an operating system."
echo "- Supported Operating Systems:"
os_support | fmt -w 80
echo -e "\nTo see all possible arguments, use:\n quickget -h or quickget --help"
exit 1
}
function os_supported() {
if [[ ! " $(os_support) " =~ \ "${OS}"\ ]]; then
echo -e "ERROR! ${OS} is not a supported OS.\n"
os_support | fmt -w 80
exit 1
fi
}
function error_specify_release() {
show_os_info "${OS}"
case ${OS} in
*ubuntu-server*)
echo -en " - Releases:\t"
releases_ubuntu-server
echo -en " - Archs:\t"
get_supported_archs "${OS}"
;;
*ubuntu*)
echo -en " - Releases:\t"
releases_ubuntu
echo -en " - Archs:\t"
get_supported_archs "${OS}"
;;
*windows*)
echo -en " - Releases:\t"
"releases_${OS}"
echo -en " - Languages:\t"
"languages_${OS}"
echo "${I18NS[@]}"
# Windows uses multi-arch ISOs, skip architecture display
;;
*)
echo -en " - Releases:\t"
"releases_${OS}" | fmt -w 80
if [[ $(type -t "editions_${OS}") == function ]]; then
echo -en " - Editions:\t"
"editions_${OS}" | fmt -w 80
fi
echo -en " - Archs:\t"
get_supported_archs "${OS}"
;;
esac
echo -e "\nERROR! You must specify a release."
exit 1
}
function error_not_supported_release() {
if [[ ! " ${RELEASES[*]} " =~ \ "${RELEASE}"\ ]]; then
echo -e "ERROR! ${DISPLAY_NAME} ${RELEASE} is not a supported release.\n"
echo -n ' - Supported releases: '
"releases_${OS}"
exit 1
fi
}
function error_not_supported_lang() {
echo -e "ERROR! ${I18N} is not a supported $(pretty_name "${OS}") language\n"
echo -n ' - Editions: '
for I18N in "${I18NS[@]}"; do
echo -n "${I18N} "
done
exit 1
}
function error_not_supported_argument() {
echo "ERROR! Not supported argument"
echo "To see all possible arguments, use:"
echo " quickget -h or quickget --help"
exit 1
}
function require_qemu_img() {
QEMU_IMG=$(command -v qemu-img)
if [ ! -x "${QEMU_IMG}" ]; then
echo "ERROR! qemu-img not found. Please make sure qemu-img is installed."
exit 1
fi
}
function is_valid_language() {
local I18N=""
local PASSED_I18N="${1}"
for I18N in "${I18NS[@]}"; do
if [[ "${I18N}" == "${PASSED_I18N}" ]]; then
return 0
fi
done
return 1
}
function handle_missing() {
# Handle odd missing Fedora combinations
case "${OS}" in
fedora)
# First we need to handle the Beta naming kludge
if [[ "${RELEASE}" == *"_Beta" ]]; then
NRELEASE="${RELEASE/_Beta/}"
else
NRELEASE="${RELEASE}"
fi
if [[ "${NRELEASE}" -lt 40 && "${EDITION}" == "Onyx" ]] || [[ "${NRELEASE}" -lt 40 && "${EDITION}" == "Sericea" ]]; then
echo "ERROR! Unsupported combination"
echo " Fedora ${RELEASE} ${EDITION} is not available, please choose another Release or Edition"
exit 1
fi;;
esac
}
function validate_release() {
local DISPLAY_NAME=""
local RELEASE_GENERATOR=""
local RELEASES=""
DISPLAY_NAME="$(pretty_name "${OS}")"
case ${OS} in
*ubuntu-server*) RELEASE_GENERATOR="releases_ubuntu-server";;
*ubuntu*) RELEASE_GENERATOR="releases_ubuntu";;
*) RELEASE_GENERATOR="${1}";;
esac
RELEASES=$(${RELEASE_GENERATOR})
error_not_supported_release
}
function list_json() {
# Reference: https://stackoverflow.com/a/67359273
list_csv | jq -R 'split(",") as $h|reduce inputs as $in ([]; . += [$in|split(",")|. as $a|reduce range(0,length) as $i ({};.[$h[$i]]=$a[$i])])'
exit 0
}
function list_csv() {
CSV_DATA="$(csv_data)"
echo "Display Name,OS,Release,Option,Downloader,PNG,SVG"
sort -t',' -k2,2 <<<"${CSV_DATA}"
exit 0
}
function csv_data() {
local DISPLAY_NAME
local DL=""
local DOWNLOADER
local FUNC
local OPTION
local OS
local PNG
local RELEASE
local SVG
local HAS_ZSYNC=0
# Check if zsync is available
if command -v zsync &>/dev/null; then
HAS_ZSYNC=1
fi
for OS in $(os_support); do
local EDITIONS=""
DISPLAY_NAME="$(pretty_name "${OS}")"
case ${OS} in
*ubuntu-server*) FUNC="ubuntu-server";;
*ubuntu*) FUNC="ubuntu";;
*) FUNC="${OS}";;
esac
PNG="https://quickemu-project.github.io/quickemu-icons/png/${FUNC}/${FUNC}-quickemu-white-pinkbg.png"
SVG="https://quickemu-project.github.io/quickemu-icons/svg/${FUNC}/${FUNC}-quickemu-white-pinkbg.svg"
if [[ $(type -t "editions_${OS}") == function ]]; then
EDITIONS=$(editions_"${OS}")
fi
for RELEASE in $("releases_${FUNC}"); do
if [[ "${OS}" == *"ubuntu"* ]] && [[ ${RELEASE} == *"daily"* ]] && [ ${HAS_ZSYNC} -eq 1 ]; then
DOWNLOADER="zsync"
else
DOWNLOADER="${DL}"
fi
# If the OS has an editions_() function, use it.
if [[ ${EDITIONS} ]]; then
for OPTION in ${EDITIONS}; do
echo "${DISPLAY_NAME},${OS},${RELEASE},${OPTION},${DOWNLOADER},${PNG},${SVG}"
done
elif [[ "${OS}" == "windows"* ]]; then
"languages_${OS}"
for I18N in "${I18NS[@]}"; do
echo "${DISPLAY_NAME},${OS},${RELEASE},${I18N},${DOWNLOADER},${PNG},${SVG}"
done
else
echo "${DISPLAY_NAME},${OS},${RELEASE},,${DOWNLOADER},${PNG},${SVG}"
fi
done &
done
wait
}
function list_supported() {
list_csv | cut -d ',' -f2,3,4 | tr ',' ' '
exit 0
}
function test_result() {
local OS="${1}"
local RELEASE="${2}"
local EDITION="${3:-}"
local URL="${4:-}"
local RESULT="${5:-}"
local REASON="${6:-}"
if [ -n "${EDITION}" ]; then
OS="${OS}-${RELEASE}-${EDITION}"
else
OS="${OS}-${RELEASE}"
fi
if [ -n "${RESULT}" ]; then
# Pad the OS string for consistent output
OS=$(printf "%-35s" "${OS}")
if [ -n "${REASON}" ]; then
echo -e "${RESULT}: ${OS} ${REASON}"
else
echo -e "${RESULT}: ${OS} ${URL}"
fi
else
OS=$(printf "%-36s" "${OS}:")
echo -e "${OS} ${URL}"
fi
}
function test_all() {
OS="${1}"
os_supported
local CHECK=""
local FUNC="${OS}"
if [[ "${OS}" == *ubuntu* && "${OS}" != "ubuntu-server" ]]; then
FUNC="ubuntu"
fi
local URL=""
for RELEASE in $("releases_${FUNC}"); do
if [[ $(type -t "editions_${OS}") == function ]]; then
for EDITION in $(editions_"${OS}"); do
# Check architecture support before generating URL
if ! is_arch_supported "${OS}" "${ARCH}"; then
test_result "${OS}" "${RELEASE}" "${EDITION}" "" "SKIP" "(not available for ${ARCH})"
continue
fi
validate_release releases_"${OS}"
URL=$(get_"${OS}" | cut -d' ' -f1 | head -n 1)
if [ "${OPERATION}" == "show" ]; then
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}"
elif [ "${OPERATION}" == "test" ]; then
CHECK=$(web_check "${URL}" && echo "PASS" || echo "FAIL")
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
fi
done
elif [[ "${OS}" == "windows"* ]]; then
"languages_${OS}"
for I18N in "${I18NS[@]}"; do
validate_release releases_"${OS}"
if [ "${OPERATION}" == "show" ]; then
test_result "${OS}" "${RELEASE}" "${I18N}" ""
elif [ "${OPERATION}" == "test" ]; then
test_result "${OS}" "${RELEASE}" "${I18N}" "${URL}" "SKIP"
fi
done
elif [[ "${OS}" == "macos" ]]; then
validate_release releases_macos
(get_macos)
elif [ "${OS}" == "ubuntu-server" ]; then
# Check architecture support before generating URL
if ! is_arch_supported "${OS}" "${ARCH}"; then
test_result "${OS}" "${RELEASE}" "" "" "SKIP" "(not available for ${ARCH})"
continue
fi
validate_release releases_ubuntu-server
(get_ubuntu-server)
elif [[ "${OS}" == *ubuntu* ]]; then
# Ubuntu desktop is amd64 only (no arch function = amd64 default)
if ! is_arch_supported "${OS}" "${ARCH}"; then
test_result "${OS}" "${RELEASE}" "" "" "SKIP" "(not available for ${ARCH})"
continue
fi
validate_release releases_ubuntu
(get_ubuntu)
else
# Check architecture support before generating URL
if ! is_arch_supported "${OS}" "${ARCH}"; then
test_result "${OS}" "${RELEASE}" "" "" "SKIP" "(not available for ${ARCH})"
continue
fi
validate_release releases_"${OS}"
URL=$(get_"${OS}" | cut -d' ' -f1 | head -n 1)
if [ "${OPERATION}" == "show" ]; then
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}"
elif [ "${OPERATION}" == "test" ]; then
CHECK=$(web_check "${URL}" && echo "PASS" || echo "FAIL")
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
fi
fi
done
}
function os_support() {
echo alma \
alpine \
android \
antix \
archcraft \
archlinux \
artixlinux \
azurelinux \
batocera \
bazzite \
biglinux \
blendos \
bodhi \
bunsenlabs \
cachyos \
centos-stream \
chimeralinux \
crunchbang++ \
debian \
deepin \
devuan \
dragonflybsd \
easyos \
edubuntu \
elementary \
endeavouros \
endless \
fedora \
freebsd \
freedos \
garuda \
gentoo \
ghostbsd \
gnomeos \
guix \
haiku \
kali \
kdeneon \
kolibrios \
kubuntu \
linuxlite \
linuxmint \
lmde \
lubuntu \
maboxlinux \
macos \
mageia \
manjaro \
mxlinux \
netboot \
netbsd \
nitrux \
nixos \
nwg-shell \
openbsd \
openindiana \
opensuse \
oraclelinux \
parrotsec \
pclinuxos \
peppermint \
popos \
porteus \
primtux \
proxmox-ve \
pureos \
reactos \
rebornos \
rockylinux \
siduction \
slackware \
slax \
slint \
slitaz \
solus \
sparkylinux \
spirallinux \
tails \
tinycore \
trisquel \
tuxedo-os \
ubuntu \
ubuntu-budgie \
ubuntu-mate \
ubuntu-server \
ubuntu-unity \
ubuntucinnamon \
ubuntukylin \
ubuntustudio \
vanillaos \
void \
windows \
windows-server \
xubuntu \
zorin
}
function releases_alma() {
echo 9 8
}
function editions_alma() {
echo boot minimal dvd
}
function releases_alpine() {
local REL=""
local RELS=""
RELS=$(web_pipe "https://dl-cdn.alpinelinux.org/alpine/" | grep '"v' | cut -d'"' -f2 | tr -d / | sort -Vr | head -n 10)
for REL in ${RELS}; do
if web_check "https://dl-cdn.alpinelinux.org/alpine/${REL}/releases/x86_64/"; then
echo -n "${REL} "
fi
done
}
function releases_android() {
echo 9.0 8.1 7.1
}
function editions_android() {
echo x86_64 x86
}
function releases_antix() {
echo 23.1 23 22 21
}
function editions_antix() {
echo net-sysv core-sysv base-sysv full-sysv net-runit core-runit base-runit full-runit
}
function releases_archcraft() {
echo latest
}
function releases_archlinux() {
echo latest
}
function releases_artixlinux() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://mirror1.artixlinux.org/iso/" | grep "artix-" | cut -d'"' -f2 | grep -v sig | cut -d'-' -f 4 | sort -ru | tail -n 1)
}
function editions_artixlinux() {
#shellcheck disable=SC2046,SC2005
# Extract edition-init combinations (e.g., base-dinit, plasma-openrc, community-gtk-openrc)
echo $(web_pipe "https://mirror1.artixlinux.org/iso/" | grep "artix-" | cut -d'"' -f2 | grep -v sig | sed 's/artix-//' | sed 's/-[0-9]\{8\}-x86_64.iso//' | sort -u)
}
function releases_azurelinux() {
echo 3.0
}
function releases_batocera() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://mirrors.o2switch.fr/batocera/x86_64/stable/" | grep ^\' -f 9 | cut -d'/' -f 1)
echo -n "${NEW}"
MAJ=$(echo "${NEW}" | cut -d'.' -f 1)
# Get archive versions that have -live directories (live images available)
ARCHIVE="$(web_pipe "https://cdimage.debian.org/cdimage/archive/" | grep folder | grep -v NEVER | grep '\-live/' | cut -d'"' -f 6 | sed 's/-live\///')"
for i in {1..2}; do
CUR=$((MAJ - i))
OLD=$(grep ^"${CUR}" <<< "${ARCHIVE}" | tail -n 1 | tr -d '/')
echo -n " ${OLD}"
done
echo
}
function editions_debian() {
echo standard cinnamon gnome kde lxde lxqt mate xfce netinst
}
function releases_deepin() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://mirrors.kernel.org/deepin-cd/" | grep "href=" | cut -d'"' -f2 | grep -v "\.\." | grep -v nightly | grep -v preview | sed 's|/||g' | tail -n 10 | sort -r)
}
function releases_devuan() {
echo daedalus chimaera
}
function releases_dragonflybsd() {
# If you remove "".bz2" from the end of the searched URL, you will get only the current release - currently 6.4.0
# We could add a variable so this behaviour is optional/switchable (maybe from option or env)
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://mirror-master.dragonflybsd.org/iso-images/" | grep -E -o '"dfly-x86_64-.*_REL.iso.bz2"' | grep -o -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+')
}
function releases_easyos() {
local ALL_RELEASES=""
local YEAR=""
# get the latest 2 years of releases so that when we hit next year we still have the latest 2 years
TWO_YEARS=$(web_pipe https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/ | grep -o -E '[[:digit:]]{4}/' | sort -nr | tr -d / | head -n 2 )
for YEAR in ${TWO_YEARS} ; do
ALL_RELEASES="${ALL_RELEASES} $(web_pipe "https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/${YEAR}/" | grep -o -E '[[:digit:]]+(\.[[:digit:]])+/' | tr -d / | sort -nr)"
done
echo "${ALL_RELEASES}"
}
function releases_elementary() {
echo 8.1 8.0 7.1 7.0
}
function releases_endeavouros() {
local ENDEAVOUR_RELEASES=""
ENDEAVOUR_RELEASES="$(web_pipe "https://mirror.alpix.eu/endeavouros/iso/" | grep -o '' | sed 's/^.*//' | grep -v 'x86_64' | LC_ALL="en_US.UTF-8" sort -Mr | cut -c 13- | head -n 5 | tr '\n' ' ')"
echo "${ENDEAVOUR_RELEASES,,}"
}
function releases_endless() {
echo 6.0.4
}
function editions_endless() {
echo base en fr pt_BR es
}
function releases_fedora() {
#shellcheck disable=SC2046,SC2005
# Filter out EOL release 41
echo $(web_pipe "https://getfedora.org/releases.json" | jq -r 'map(.version) | unique | .[]' | sed 's/ /_/g' | sort -r | grep -v '^41$')
}
function editions_fedora() {
#shellcheck disable=SC2046,SC2005
if [[ -z ${RELEASE} ]]; then
echo $(web_pipe "https://getfedora.org/releases.json" | jq -r "map(select(.arch==\"x86_64\" and .variant!=\"Labs\" and .variant!=\"IoT\" and .variant!=\"Container\" and .variant!=\"Cloud\" and .variant!=\"Everything\" and .subvariant!=\"Security\" and .subvariant!=\"Server_KVM\" and .subvariant!=\"SoaS\")) | map(.subvariant) | unique | .[]")
else
echo $(web_pipe "https://getfedora.org/releases.json" | jq -r "map(select(.arch==\"x86_64\" and .version==\"${RELEASE/_/ }\" and .variant!=\"Labs\" and .variant!=\"IoT\" and .variant!=\"Container\" and .variant!=\"Cloud\" and .variant!=\"Everything\" and .subvariant!=\"Security\" and .subvariant!=\"Server_KVM\" and .subvariant!=\"SoaS\")) | map(.subvariant) | unique | .[]")
fi
}
function releases_freebsd() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://download.freebsd.org/ftp/releases/amd64/amd64/" | grep -Eo "href=\"[0-9\.]+-RELEASE" | grep -oE '[0-9\.]+' | sort -r)
}
function editions_freebsd() {
echo disc1 dvd1
}
function releases_freedos() {
echo 1.4 1.3 1.2
}
function releases_garuda() {
echo latest
}
function editions_garuda() {
echo cinnamon dr460nized dr460nized-gaming gnome hyprland i3 kde-lite mokka sway xfce
}
function releases_gentoo() {
echo latest
}
function editions_gentoo() {
echo minimal livegui
}
function releases_ghostbsd() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://download.ghostbsd.org/releases/amd64/" | grep "href" | cut -d'"' -f2 | cut -d'/' -f1 | sort -r | tail -n +3 | head -n 3)
}
function editions_ghostbsd() {
echo mate xfce
}
function releases_gnomeos() {
#shellcheck disable=SC2046,SC2005
# Filter out alpha/beta/rc pre-releases, keep only stable versions and nightly
echo "nightly" $(web_pipe "https://download.gnome.org/gnomeos/" | grep "title=" | awk -F'"' '{print $4}' | tr -d '/' | grep -E '^[0-9]+\.[0-9]+$' | sort -nr)
}
function releases_guix() {
echo 1.5.0 1.4.0
}
function releases_haiku() {
echo r1beta5 r1beta4 r1beta3
}
function editions_haiku() {
echo x86_64 x86_gcc2h
}
function releases_kali() {
echo current kali-weekly
}
function releases_kdeneon() {
echo user testing unstable
}
function releases_kolibrios() {
echo latest
}
function editions_kolibrios() {
echo en_US ru_RU es_ES
}
function releases_linuxlite() {
echo 6.6 6.4 6.2 6.0
}
function releases_linuxmint() {
echo 22.1 22 21.3 21.2 21.1 21 20.3 20.2
}
function editions_linuxmint() {
echo cinnamon mate xfce
}
function editions_lmde() {
echo cinnamon
}
function releases_lmde() {
echo 6
}
function releases_maboxlinux() {
echo latest
}
function releases_macos() {
echo mojave catalina big-sur monterey ventura sonoma sequoia tahoe
}
function releases_mageia() {
echo 9
}
function editions_mageia() {
echo Plasma GNOME Xfce
}
function editions_manjaro() {
echo full minimal
}
function releases_manjaro() {
echo xfce gnome plasma cinnamon i3 sway
}
function releases_mxlinux() {
# needs header, so not web_pipe:
curl --disable -Ils "https://sourceforge.net/projects/mx-linux/files/latest/download" | grep -i 'location:' | cut -d? -f1 | cut -d_ -f1 | cut -d- -f3
}
function editions_mxlinux() {
echo Xfce KDE Fluxbox
}
function releases_netboot() {
echo latest
}
function releases_netbsd() {
# V8 is EOL so filter it out
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://cdn.netbsd.org/pub/NetBSD/iso/" | grep -o -E '"[[:digit:]]+\.[[:digit:]]+/"' | tr -d '"/' | grep -v ^8 | sort -nr | head -n 4)
}
function releases_nitrux() {
echo latest
}
function releases_nixos() {
# Lists unstable plus the most recent release
#shellcheck disable=SC2046
echo unstable $(web_pipe "https://nix-channels.s3.amazonaws.com/?delimiter=/" | grep -o -E 'nixos-[[:digit:]]+\.[[:digit:]]+' | cut -d- -f2 | sort -nru | head -n +1)
}
function editions_nixos() {
echo minimal graphical
}
function releases_nwg-shell() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://sourceforge.net/projects/nwg-iso/rss?path=/" | grep 'url=' | grep '64.iso' | cut -d'/' -f12 | cut -d'-' -f3)
}
function releases_openbsd() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://mirror.leaseweb.com/pub/OpenBSD/" | grep -e '6\.[8-9]/' -e '[7-9]\.' | cut -d\" -f4 | tr -d '/' | sort -r)
}
function releases_openindiana() {
#shellcheck disable=SC2046,SC2005
#echo $(web_pipe "https://dlc.openindiana.org/isos/hipster/" | grep link | cut -d'/' -f 1 | cut -d '"' -f4 | sort -r | tail -n +2 | head -n 5)
echo $(web_pipe "https://dlc.openindiana.org/isos/hipster/" | grep 'href="./2' | cut -d'/' -f 2 | sort -r | head -n 5)
}
function editions_openindiana() {
echo gui text minimal
}
function releases_opensuse() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://download.opensuse.org/distribution/leap/" | grep 'class="name"' | cut -d '/' -f2 | grep -v 42 | sort -r) microos tumbleweed
}
function releases_oraclelinux() {
echo 9.3 9.2 9.1 9.0 8.9 8.8 8.7 8.6 8.5 8.4 7.9 7.8 7.7
}
function releases_parrotsec() {
#shellcheck disable=SC2046,SC2005
# Only return releases that have ISO files available
local RELEASES=""
for REL in $(web_pipe "https://deb.parrot.sh/parrot/iso/" | grep -o -E 'href="([[:digit:]]+\.)+[[:digit:]]+/' | sort -Vr | head -n 5 | cut -d\" -f 2 | cut -d'/' -f 1); do
if web_pipe "https://download.parrot.sh/parrot/iso/${REL}/" | grep -q '\.iso"'; then
RELEASES="${RELEASES} ${REL}"
fi
done
echo "${RELEASES}"
}
function editions_parrotsec() {
# htb edition was discontinued after 6.x series
echo home security
}
function releases_pclinuxos() {
# Use 'latest' as different editions have different release dates
echo latest
}
function editions_pclinuxos() {
echo kde kde-darkstar mate xfce
}
function releases_peppermint() {
echo latest
}
function editions_peppermint() {
echo devuan-xfce devuan-gnome debian-xfce debian-gnome
}
function releases_popos() {
echo 22.04 20.04 24.04
}
function editions_popos() {
echo intel nvidia
}
function releases_porteus() {
echo 5.01
}
function editions_porteus() {
echo cinnamon gnome kde lxde lxqt mate openbox xfce
}
function releases_primtux() {
echo 7
}
function editions_primtux() {
echo 2022-10
}
function releases_proxmox-ve() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe https://enterprise.proxmox.com/iso/ | grep proxmox-ve | grep -E -o '[0-9]+\.[0-9]+-[0-9]\.iso' | uniq | sort -ru | cut -d'.' -f 1-2)
}
function releases_pureos() {
web_pipe "https://www.pureos.net/download/" | grep -m 1 "downloads.puri" | cut -d '"' -f 2 | cut -d '-' -f 4
}
function editions_pureos() {
echo gnome plasma
}
function releases_reactos() {
echo latest
}
function releases_rebornos() {
echo latest
}
function releases_rockylinux() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "http://dl.rockylinux.org/vault/rocky/" | grep "class=\"link" | grep -v -e 'full' -e 'RC' -e 'ISO' -e 'Parent' | cut -d'"' -f4 | tr -d / | sort -ru)
}
function editions_rockylinux() {
echo minimal dvd boot
}
function releases_siduction() {
echo latest
}
function editions_siduction() {
#shellcheck disable=SC2046,SC2005
NAME=$(web_pipe "https://mirror.math.princeton.edu/pub/siduction/iso/" | grep folder | cut -d'"' -f8 | tr -d '/')
web_pipe "https://mirror.math.princeton.edu/pub/siduction/iso/${NAME}/" | grep folder | cut -d'"' -f8 | tr -d '/' | sort -u
}
function releases_slackware() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://slackware.nl/slackware/slackware-iso/" | grep "slackware-" | cut -d'<' -f7 | cut -d'-' -f2 | sort -ru | head -n 5)
}
function releases_slax() {
echo latest
}
function editions_slax() {
echo debian slackware
}
function releases_slint() {
echo "15.0-10"
}
function releases_slitaz() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://mirror.slitaz.org/iso/rolling/" | grep "class='iso'" | cut -d"'" -f4 | cut -d'-' -f3- | grep iso | cut -d'.' -f1 | sort -u)
}
function releases_solus() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe_json "https://downloads.getsol.us/isos/" | jq -r '.[].name[:-1]' | grep -E "^[0-9-]+$" | sort -u)
}
function editions_solus() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe_json "https://downloads.getsol.us/isos/$(IFS=' '; releases_solus | tail -n1)/" | jq -r '.[].name | select(endswith("iso")) | sub("Solus-(?.*)-Release-.*"; "\(.e)")' | sort -u)
}
function releases_sparkylinux() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://sparkylinux.org/download/stable/" | grep -E -o "sparkylinux-.*\.iso\"" | cut -d'-' -f2 | sort -ru)
}
function editions_sparkylinux() {
#shellcheck disable=SC2046,SC2005
if [ -z "${RELEASE}" ]; then
echo $(web_pipe "https://sparkylinux.org/download/stable/" | grep -E -o "sparkylinux-.*\.iso\"" | cut -d'-' -f4 | cut -d'.' -f1 | sort -u)
else
echo $(web_pipe "https://sparkylinux.org/download/stable/" | grep -E -o "sparkylinux-${RELEASE}-.*\.iso\"" | cut -d'-' -f4 | cut -d'.' -f1 | sort -u)
fi
}
function releases_spirallinux() {
echo latest
}
function editions_spirallinux() {
echo Plasma XFCE Mate LXQt Gnome Budgie Cinnamon Builder
}
function releases_tails() {
echo stable
}
function releases_tinycore() {
echo 15 14
}
function editions_tinycore() {
echo Core TinyCore CorePlus CorePure64 TinyCorePure64
}
function releases_trisquel() {
echo 11.0 10.0.1
}
function editions_trisquel() {
echo mate lxde kde sugar
}
function releases_tuxedo-os() {
echo current
}
function releases_ubuntu() {
local VERSION_DATA=""
local SUPPORTED_VERSIONS=()
VERSION_DATA="$(IFS=$'\n' web_pipe https://api.launchpad.net/devel/ubuntu/series | jq -r '.entries[]')"
# shellcheck disable=SC2207
SUPPORTED_VERSIONS=($(IFS=$'\n' jq -r 'select(.status=="Supported" or .status=="Current Stable Release") | .version' <<<"${VERSION_DATA}" | sort))
case "${OS}" in
ubuntu)
echo "${SUPPORTED_VERSIONS[@]}" daily-live;;
kubuntu|lubuntu|ubuntukylin|ubuntu-mate|ubuntustudio|xubuntu)
# after 16.04
echo "${SUPPORTED_VERSIONS[@]:1}" daily-live;;
ubuntu-budgie)
# after 18.04
echo "${SUPPORTED_VERSIONS[@]:2}" daily-live;;
edubuntu|ubuntu-unity|ubuntucinnamon)
# after 23.10
echo "${SUPPORTED_VERSIONS[@]:5}" daily-live;;
esac
}
function releases_ubuntu-server() {
local ALL_VERSIONS=()
# shellcheck disable=SC2207
ALL_VERSIONS=($(IFS=$'\n' web_pipe http://releases.ubuntu.com/streams/v1/com.ubuntu.releases:ubuntu-server.json | jq -r '.products[] | select(.arch=="amd64") | .version' | sort -rV))
echo daily-live "${ALL_VERSIONS[@]}"
}
function releases_vanillaos() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://api.github.com/repos/Vanilla-OS/live-iso/releases" | grep 'download_url' | cut -d'/' -f8 | sort -ru)
}
function releases_void() {
# List directories that contain standard ISO files (base.iso), not just enterprise editions
#shellcheck disable=SC2046,SC2005
local DIRS=""
DIRS=$(web_pipe "https://repo-default.voidlinux.org/live/" | grep "^/dev/null; then
hash_cmd=gmd5sum
else
# MD5 not directly supported by shasum; use native md5 command
hash_cmd="md5 -r"
fi;;
sha1sum)
if command -v gsha1sum &>/dev/null; then
hash_cmd=gsha1sum
else
hash_cmd="shasum -a 1"
fi;;
sha256sum)
if command -v gsha256sum &>/dev/null; then
hash_cmd=gsha256sum
else
hash_cmd="shasum -a 256"
fi;;
sha512sum)
if command -v gsha512sum &>/dev/null; then
hash_cmd=gsha512sum
else
hash_cmd="shasum -a 512"
fi;;
b2sum)
if command -v gb2sum &>/dev/null; then
hash_cmd=gb2sum
else
echo "WARNING! b2sum not available on macOS without GNU coreutils, not checking ${iso} hash."
return
fi;;
esac
fi
echo -n "Checking ${iso} with ${hash_cmd}... "
# Handle MD5 on macOS specially (md5 -r outputs "hash filename" format)
if [ "${hash_cmd}" = "md5 -r" ]; then
local computed_hash
computed_hash=$(md5 -r "${iso}" | cut -d' ' -f1)
if [ "${computed_hash}" != "${hash}" ]; then
echo "ERROR!"
echo "${iso} doesn't match ${hash}. Try running 'quickget' again."
exit 1
else
echo "Good!"
fi
elif ! printf '%s %s\n' "${hash}" "${iso}" | ${hash_cmd} --check --status; then
echo "ERROR!"
echo "${iso} doesn't match ${hash}. Try running 'quickget' again."
exit 1
else
echo "Good!"
fi
}
# Download a file from the web and pipe it to stdout
function web_pipe() {
curl --disable --silent --location "${1}"
}
# Download a JSON file from the web and pipe it to stdout
function web_pipe_json() {
curl --disable --silent --location --header "Accept: application/json" "${1}"
}
# Download a file from the web
function web_get() {
local CHECK=""
local HEADERS=()
local URL="${1}"
local DIR="${2}"
local FILE=""
local USER_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
if [ -n "${3}" ]; then
FILE="${3}"
else
FILE="${URL##*/}"
fi
# Process any URL redirections after the file name has been extracted
URL=$(web_redirect "${URL}")
# Process any headers
while (( "$#" )); do
if [ "${1}" == "--header" ]; then
HEADERS+=("${1}" "${2}")
shift 2
else
shift
fi
done
# Test mode for ISO
if [ "${OPERATION}" == "show" ]; then
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}"
exit 0
elif [ "${OPERATION}" == "test" ]; then
# Check architecture support before testing URL
if ! is_arch_supported "${OS}" "${ARCH}"; then
test_result "${OS}" "${RELEASE}" "${EDITION}" "" "SKIP" "(not available for ${ARCH})"
exit 0
fi
CHECK=$(web_check "${URL}" && echo "PASS" || echo "FAIL")
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
exit 0
elif [ "${OPERATION}" == "download" ]; then
DIR="$(pwd)"
fi
if [ "${DIR}" != "$(pwd)" ] && ! mkdir -p "${DIR}" 2>/dev/null; then
echo "ERROR! Unable to create directory ${DIR}"
exit 1
fi
if [[ ${OS} != windows && ${OS} != macos && ${OS} != windows-server ]]; then
echo "Downloading $(pretty_name "${OS}") ${RELEASE} ${EDITION}"
echo "- URL: ${URL}"
fi
if ! curl --disable --progress-bar --location --output "${DIR}/${FILE}" --continue-at - --user-agent "${USER_AGENT}" "${HEADERS[@]}" -- "${URL}"; then
echo "ERROR! Failed to download ${URL} with curl."
rm -f "${DIR}/${FILE}"
exit 1
fi
}
# checks if a URL needs to be redirected and returns the final URL
function web_redirect() {
local REDIRECT_URL=""
local URL="${1}"
# Check for URL redirections
# Output to nonexistent directory so the download fails fast
REDIRECT_URL=$(curl --disable --silent --location --fail --write-out '%{url_effective}' --output /var/cache/${RANDOM}/${RANDOM} "${URL}" )
if [ "${REDIRECT_URL}" != "${URL}" ]; then
echo "${REDIRECT_URL}"
else
echo "${URL}"
fi
}
# checks if a URL is reachable
function web_check() {
local HEADERS=()
local URL="${1}"
# Process any headers
while (( "$#" )); do
if [ "${1}" == "--header" ]; then
HEADERS+=("${1}" "${2}")
shift 2
else
shift
fi
done
curl --disable --silent --location --head --output /dev/null --fail --connect-timeout 30 --max-time 30 --retry 3 "${HEADERS[@]}" "${URL}"
}
function zsync_get() {
local CHECK=""
local DIR="${2}"
local FILE="${1##*/}"
local OUT=""
local URL="${1}"
# Test mode for ISO
if [ "${OPERATION}" == "show" ]; then
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}"
exit 0
elif [ "${OPERATION}" == "test" ]; then
# Check architecture support before testing URL
if ! is_arch_supported "${OS}" "${ARCH}"; then
test_result "${OS}" "${RELEASE}" "${EDITION}" "" "SKIP" "(not available for ${ARCH})"
exit 0
fi
CHECK=$(web_check "${URL}" && echo "PASS" || echo "FAIL")
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
exit 0
elif command -v zsync &>/dev/null; then
if [ -n "${3}" ]; then
OUT="${3}"
else
OUT="${FILE}"
fi
if ! mkdir -p "${DIR}" 2>/dev/null; then
echo "ERROR! Unable to create directory ${DIR}"
exit 1
fi
echo "Downloading $(pretty_name "${OS}") ${RELEASE} ${EDITION} from ${URL}"
# Only force http for zsync - not earlier because we might fall through here
if ! zsync "${URL/https/http}.zsync" -i "${DIR}/${OUT}" -o "${DIR}/${OUT}" 2>/dev/null; then
echo "ERROR! Failed to download ${URL/https/http}.zsync"
exit 1
fi
if [ -e "${DIR}/${OUT}.zs-old" ]; then
rm "${DIR}/${OUT}.zs-old"
fi
else
echo "INFO: zsync not found, falling back to curl"
if [ -n "${3}" ]; then
web_get "${1}" "${2}" "${3}"
else
web_get "${1}" "${2}"
fi
fi
}
function make_vm_config() {
local CONF_FILE=""
local IMAGE_FILE=""
local ISO_FILE=""
local IMAGE_TYPE=""
local GUEST=""
if [ "${OPERATION}" == "download" ]; then
exit 0
fi
IMAGE_FILE="${1}"
ISO_FILE="${2}"
case "${OS}" in
batocera)
GUEST="batocera"
IMAGE_TYPE="img";;
custom)
GUEST="${CUSTOM_OS}"
IMAGE_TYPE="${CUSTOM_IMAGE_TYPE}";;
dragonflybsd)
GUEST="dragonflybsd"
IMAGE_TYPE="iso";;
easyos)
GUEST="linux"
IMAGE_TYPE="img";;
freebsd|ghostbsd)
GUEST="freebsd"
IMAGE_TYPE="iso";;
haiku)
GUEST="haiku"
IMAGE_TYPE="iso";;
freedos)
GUEST="freedos"
IMAGE_TYPE="iso";;
kolibrios)
GUEST="kolibrios"
IMAGE_TYPE="iso";;
macos)
GUEST="macos"
IMAGE_TYPE="img";;
netbsd)
GUEST="netbsd"
IMAGE_TYPE="iso";;
openbsd)
GUEST="openbsd"
IMAGE_TYPE="iso";;
openindiana)
GUEST="solaris"
IMAGE_TYPE="iso";;
reactos)
GUEST="reactos"
IMAGE_TYPE="iso";;
ubuntu*)
GUEST="linux"
IMAGE_TYPE="iso"
# If there is a point in the release, check if it is less than 16.04
if [[ "${RELEASE}" != *"daily"* ]]; then
if [ "${RELEASE//./}" -lt 1604 ]; then
GUEST="linux_old"
fi
fi
;;
windows)
GUEST="windows"
IMAGE_TYPE="iso";;
windows-server)
GUEST="windows-server"
IMAGE_TYPE="iso";;
*)
GUEST="linux"
IMAGE_TYPE="iso";;
esac
CONF_FILE="${VM_PATH}.conf"
if [ ! -e "${CONF_FILE}" ]; then
echo "Making ${CONF_FILE}"
local ARCH_LINE=""
if [ "${ARCH}" != "${NORMALISED_HOST_ARCH}" ]; then
if [ "${ARCH}" == "arm64" ]; then
ARCH_LINE="arch=\"aarch64\""
else
ARCH_LINE="arch=\"x86_64\""
fi
fi
cat << EOF > "${CONF_FILE}"
#!${QUICKEMU} --vm
guest_os="${GUEST}"
${ARCH_LINE:+${ARCH_LINE}
}disk_img="${VM_PATH}/disk.qcow2"
${IMAGE_TYPE}="${VM_PATH}/${IMAGE_FILE}"
EOF
echo " - Setting ${CONF_FILE} executable"
chmod u+x "${CONF_FILE}"
if [ -n "${ISO_FILE}" ]; then
echo "fixed_iso=\"${VM_PATH}/${ISO_FILE}\"" >> "${CONF_FILE}"
fi
# OS specific tweaks
case ${OS} in
alma|centos-stream|endless|garuda|gentoo|kali|nixos|oraclelinux|popos|rockylinux)
echo "disk_size=\"32G\"" >> "${CONF_FILE}";;
openindiana)
echo "boot=\"legacy\"" >> "${CONF_FILE}"
echo "disk_size=\"32G\"" >> "${CONF_FILE}";;
batocera)
echo "disk_size=\"8G\"" >> "${CONF_FILE}";;
bazzite)
echo "disk_size=\"64G\"" >> "${CONF_FILE}";;
dragonflybsd|haiku|openbsd|netbsd|slackware|slax|tinycore)
echo "boot=\"legacy\"" >> "${CONF_FILE}";;
deepin)
echo "disk_size=\"64G\"" >> "${CONF_FILE}"
echo "ram=\"4G\"" >> "${CONF_FILE}"
;;
freedos)
echo "boot=\"legacy\"" >> "${CONF_FILE}"
echo "disk_size=\"4G\"" >> "${CONF_FILE}"
echo "ram=\"256M\"" >> "${CONF_FILE}"
;;
kolibrios)
echo "boot=\"legacy\"" >> "${CONF_FILE}"
echo "disk_size=\"2G\"" >> "${CONF_FILE}"
echo "ram=\"128M\"" >> "${CONF_FILE}"
;;
slint)
echo "disk_size=\"50G\"" >> "${CONF_FILE}"
;;
slitaz)
echo "boot=\"legacy\"" >> "${CONF_FILE}"
echo "disk_size=\"4G\"" >> "${CONF_FILE}"
echo "ram=\"512M\"" >> "${CONF_FILE}"
;;
ubuntu-server)
# 22.04+ fails on LVM build if disk size is < 10G
# 22.04.1 fails on auto-install if TPM is disabled
echo "disk_size=\"10G\"" >> "${CONF_FILE}"
echo "ram=\"4G\"" >> "${CONF_FILE}"
if [[ "${RELEASE}" == *"22.04"* ]]; then
echo "tpm=\"on\"" >> "${CONF_FILE}"
fi
;;
vanillaos)
## Minimum is 50G for abroot, but a 64GB is allocated to give some headroom
echo "disk_size=\"64G\"" >> "${CONF_FILE}"
;;
zorin)
case ${EDITION} in
education64|edulite64) echo "disk_size=\"32G\"" >> "${CONF_FILE}";;
esac;;
reactos)
echo "boot=\"legacy\"" >> "${CONF_FILE}"
echo "disk_size=\"12G\"" >> "${CONF_FILE}"
echo "ram=\"2048M\"" >> "${CONF_FILE}"
;;
macos)
echo "disk_size=\"128G\"" >> "${CONF_FILE}"
echo "macos_release=\"${RELEASE}\"" >> "${CONF_FILE}"
# https://github.com/quickemu-project/quickemu/issues/438
if [ "${RELEASE}" == "monterey" ]; then
echo "cpu_cores=2" >> "${CONF_FILE}"
fi
;;
elementary)
case "${RELEASE}" in
8.1)
echo "display=\"spice\"" >> "${CONF_FILE}"
;;
esac
;;
proxmox-ve)
echo "disk_size=\"20G\"" >> "${CONF_FILE}"
echo "ram=\"4G\"" >> "${CONF_FILE}"
;;
esac
if [ "${OS}" == "ubuntu" ] && [[ ${RELEASE} == *"daily"* ]]; then
# Minimum to install lobster testing is 18GB but 32GB are allocated for headroom
echo "disk_size=\"32G\"" >> "${CONF_FILE}"
fi
if [[ "${OS}" == "windows"* ]]; then
echo "disk_size=\"64G\"" >> "${CONF_FILE}"
fi
# Enable TPM for Windows 11 and Windows Server 2022
if [[ "${OS}" == "windows" && "${RELEASE}" == "11" || "${OS}" == "windows-server" && "${RELEASE}" == "2022" ]]; then
echo "tpm=\"on\"" >> "${CONF_FILE}"
echo "secureboot=\"off\"" >> "${CONF_FILE}"
fi
fi
echo -e "\nTo start your $(pretty_name "${OS}") virtual machine run:"
if [ "${OS}" == "slint" ]; then
echo -e " quickemu --vm ${CONF_FILE}\nTo start Slint with braille support run:\n quickemu --vm --braille --display sdl ${CONF_FILE}"
else
echo " quickemu --vm ${CONF_FILE}"
fi
echo
exit 0
}
function get_alma() {
local HASH=""
local QEMU_ARCH="x86_64"
[ "${ARCH}" == "arm64" ] && QEMU_ARCH="aarch64"
local ISO="AlmaLinux-${RELEASE}-latest-${QEMU_ARCH}-${EDITION}.iso"
local URL="https://repo.almalinux.org/almalinux/${RELEASE}/isos/${QEMU_ARCH}"
HASH="$(web_pipe "${URL}/CHECKSUM" | grep "(${ISO}" | cut -d' ' -f4)"
echo "${URL}/${ISO} ${HASH}"
}
function get_alpine() {
local HASH=""
local ISO=""
local QEMU_ARCH="x86_64"
[ "${ARCH}" == "arm64" ] && QEMU_ARCH="aarch64"
local URL="https://dl-cdn.alpinelinux.org/alpine/${RELEASE}/releases/${QEMU_ARCH}"
local VERSION=""
VERSION=$(web_pipe "${URL}/latest-releases.yaml" | awk '/"Xen"/{found=0} {if(found) print} /"Virtual"/{found=1}' | grep 'version:' | head -1 | awk '{print $2}')
ISO="alpine-virt-${VERSION}-${QEMU_ARCH}.iso"
HASH=$(web_pipe "${URL}/latest-releases.yaml" | awk '/"Xen"/{found=0} {if(found) print} /"Virtual"/{found=1}' | grep 'sha256:' | head -1 | awk '{print $2}')
echo "${URL}/${ISO} ${HASH}"
}
function get_android() {
local HASH=""
local ISO=""
local JSON_ALL=""
local JSON_REL=""
local URL="https://mirrors.gigenet.com/OSDN/android-x86"
JSON_ALL=$(web_pipe "https://www.fosshub.com/Android-x86-old.html" | grep "var settings =" | cut -d'=' -f2-)
JSON_REL=$(echo "${JSON_ALL}" | jq --arg ver "${OS}-${EDITION}-${RELEASE}" 'first(.pool.f[] | select((.n | startswith($ver)) and (.n | endswith(".iso"))))')
ISO=$(echo "${JSON_REL}" | jq -r .n)
HASH=$(echo "${JSON_REL}" | jq -r .hash.sha256)
# Traverse the directories to find the .iso location
for DIR in $(web_pipe "${URL}" | grep -o -E '[0-9]{5}' | sort -ur); do
if web_pipe "${URL}/${DIR}" | grep "${ISO}" &>/dev/null; then
URL="${URL}/${DIR}"
break
fi
done
echo "${URL}/${ISO} ${HASH}"
}
function get_antix() {
local HASH=""
local ISO="antiX-${RELEASE}"
local README="README"
local URL="https://sourceforge.net/projects/antix-linux/files/Final/antiX-${RELEASE}"
# antiX uses a different URL and ISO naming for runit editions
if [[ "${EDITION}" == *"runit"* ]];then
ISO+="-runit"
README="README2"
case ${RELEASE} in
21) URL+="/runit-bullseye";;
*) URL+="/runit-antiX-${RELEASE}";;
esac
fi
case ${EDITION} in
base-*) ISO+="_x64-base.iso";;
core-*) ISO+="_x64-core.iso";;
full-*) ISO+="_x64-full.iso";;
net-*) ISO+="-net_x64-net.iso";;
esac
HASH=$(web_pipe "${URL}/${README}.txt" | grep "${ISO}" | cut -d' ' -f1 | head -n 1)
echo "${URL}/${ISO} ${HASH}"
}
function get_archcraft() {
local HASH=""
local ISO=""
local URL=""
local VERSION_FOLDER=""
URL="https://sourceforge.net/projects/archcraft/files/${RELEASE}/download"
URL="$(web_redirect "${URL}" | cut -d? -f1)"
ISO="$(basename "${URL}")"
VERSION_FOLDER="$(dirname "${URL}" | xargs basename)"
HASH=$(web_pipe "https://sourceforge.net/projects/archcraft/files/${VERSION_FOLDER}/${ISO}.sha256sum" | cut -d' ' -f1)
echo "${URL} ${HASH}"
}
function get_archlinux() {
local HASH=""
local ISO=""
local URL="https://geo.mirror.pkgbuild.com/"
ISO=$(web_pipe "https://archlinux.org/releng/releases/json/" | jq -r '.releases[0].iso_url')
HASH=$(web_pipe "https://archlinux.org/releng/releases/json/" | jq -r '.releases[0].sha256_sum')
echo "${URL}${ISO} ${HASH}"
}
function get_artixlinux() {
local HASH=""
local ISO=""
local URL="https://iso.artixlinux.org/iso"
ISO="artix-${EDITION}-${RELEASE}-x86_64.iso"
HASH=$(web_pipe "${URL}/sha256sums" | grep "${ISO}")
echo "${URL}/${ISO} ${HASH}"
}
function get_azurelinux() {
local QEMU_ARCH="x86_64"
[ "${ARCH}" == "arm64" ] && QEMU_ARCH="aarch64"
local URL="https://aka.ms/azurelinux-${RELEASE}-${QEMU_ARCH}.iso"
local ISO
ISO="$(web_redirect "${URL}")"
echo "${ISO}"
}
function get_batocera() {
local HASH=""
local ISO=""
local URL="https://mirrors.o2switch.fr/batocera/x86_64/stable/${RELEASE}"
ISO="$(web_pipe "${URL}/" | grep -e 'batocera.*img.gz'| cut -d'"' -f2)"
echo "${URL}/${ISO} ${HASH}"
}
function get_bazzite() {
local HASH=""
local ISO=""
local URL="https://download.bazzite.gg"
case ${EDITION} in
gnome) ISO="bazzite-gnome-stable-amd64.iso";;
plasma) ISO="bazzite-stable-amd64.iso";;
deck-gnome) ISO="bazzite-deck-gnome-stable-amd64.iso";;
deck-plasma) ISO="bazzite-deck-stable-amd64.iso";;
esac
HASH=$(web_pipe "${URL}/${ISO}-CHECKSUM" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_biglinux() {
local HASH=""
local ISO="biglinux_${RELEASE}_${EDITION}.iso"
local URL="https://iso.biglinux.com.br"
HASH=$(web_pipe "${URL}/${ISO}.md5" | grep -Eo '[[:alnum:]]{32}')
echo "${URL}/${ISO} ${HASH}"
}
function get_blendos() {
local HASH=""
local ISO="blendOS.iso"
# Use the official GitLab build server
local URL="https://git.blendos.co/api/v4/projects/32/jobs/artifacts/main/raw/blendOS.iso?job=build-job"
HASH=$(web_pipe "https://git.blendos.co/api/v4/projects/32/jobs/artifacts/main/raw/checksum?job=build-job" | cut -d' ' -f1)
echo "${URL} ${HASH}"
}
function get_bodhi() {
local HASH=""
local ISO=""
local URL="https://sourceforge.net/projects/bodhilinux/files/${RELEASE}"
case ${EDITION} in
standard) ISO="bodhi-${RELEASE}-64.iso";;
*) ISO="bodhi-${RELEASE}-64-${EDITION}.iso";;
esac
HASH=$(web_pipe "${URL}/${ISO}.sha256" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_bunsenlabs() {
local HASH=""
local ISO="boron-1-240123-amd64.hybrid.iso"
local URL="https://ddl.bunsenlabs.org/ddl"
HASH=$(web_pipe "${URL}/release.sha256.txt" | head -n 1 | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_cachyos() {
local HASH=""
local URL=""
URL="$(web_pipe "https://cachyos.org/download/" | tr '&' '\n' | grep "ISO/${EDITION}" | grep -v 'iso.sha' | grep -v 'iso.sig' | cut -d';' -f2)"
HASH=$(web_pipe "${URL}.sha256" | cut -d' ' -f1)
echo "${URL} ${HASH}"
}
function get_centos-stream() {
local HASH=""
local ISO="CentOS-Stream-${RELEASE}-latest-x86_64-${EDITION}.iso"
local URL="https://linuxsoft.cern.ch/centos-stream/${RELEASE}-stream/BaseOS/x86_64/iso"
HASH=$(web_pipe "${URL}/${ISO}.SHA256SUM" | grep "SHA256 (${ISO}" | cut -d' ' -f4)
echo "${URL}/${ISO} ${HASH}"
}
function get_chimeralinux() {
local DATE=""
local HASH=""
local URL="https://repo.chimera-linux.org/live/${RELEASE}"
DATE=$(web_pipe "${URL}/sha256sums.txt" | head -n1 | cut -d'-' -f5)
local ISO="chimera-linux-x86_64-LIVE-${DATE}-${EDITION}.iso"
HASH=$(web_pipe "${URL}/sha256sums.txt" | grep 'x86_64-LIVE' | grep "${EDITION}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_crunchbang++() {
local HASH=""
local ISO=""
ISO=$(web_pipe "https://api.github.com/repos/CBPP/cbpp/releases" | grep 'download_url' | grep amd64 | grep "${RELEASE}" | cut -d'"' -f4)
echo "${ISO} ${HASH}"
}
function get_debian() {
local DEBIAN_ARCH="${ARCH}"
local DEBCURRENT=""
local HASH=""
local ISO="debian-live-${RELEASE}-${DEBIAN_ARCH}-${EDITION}.iso"
local URL="https://cdimage.debian.org/cdimage/archive/${RELEASE}-live/${DEBIAN_ARCH}/iso-hybrid"
# Debian only provides netinst images for ARM64
if [ "${DEBIAN_ARCH}" == "arm64" ] && [ "${EDITION}" != "netinst" ]; then
echo "ERROR! Debian ${EDITION} is not available for ARM64. Use 'netinst' edition."
exit 1
fi
DEBCURRENT=$(web_pipe "https://cdimage.debian.org/debian-cd/" | grep '\.[0-9]/' | cut -d'>' -f 9 | cut -d'/' -f 1)
case "${RELEASE}" in
"${DEBCURRENT}") URL="https://cdimage.debian.org/debian-cd/${RELEASE}-live/${DEBIAN_ARCH}/iso-hybrid";;
esac
if [ "${EDITION}" == "netinst" ]; then
URL="${URL/-live/}"
URL="${URL/hybrid/cd}"
ISO="${ISO/-live/}"
fi
HASH=$(web_pipe "${URL}/SHA512SUMS" | grep "${ISO}" | cut -d' ' -f1 | head -n 1)
echo "${URL}/${ISO} ${HASH}"
}
function get_deepin() {
local HASH=""
local REV=${RELEASE}
# deepin-desktop-community-20.3-amd64.iso
local URL="https://cdimage.deepin.com/releases/"${RELEASE}
# Correct URL for 23-RC onwards which has architecture directories
if [ "${RELEASE}" != "20.9" ]; then
URL+="/amd64"
fi
local ISO="deepin-desktop-community-${REV}-amd64.iso"
HASH=$(web_pipe "${URL}/SHA256SUMS" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_devuan() {
local HASH=""
local ISO=""
local URL="https://files.devuan.org/devuan_${RELEASE}/desktop-live"
local VER=""
case ${RELEASE} in
beowulf) VER="3.1.1";;
chimaera) VER="4.0.3";;
daedalus) VER="5.0.0";;
esac
ISO="devuan_${RELEASE}_${VER}_amd64_desktop-live.iso"
HASH=$(web_pipe "${URL}/SHASUMS.txt" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_dragonflybsd() {
local HASH=""
local ISO="dfly-x86_64-${RELEASE}_REL.iso.bz2"
local URL="http://mirror-master.dragonflybsd.org/iso-images"
HASH=$(web_pipe "${URL}/md5.txt" | grep "(${ISO})" | cut -d' ' -f4)
echo "${URL}/${ISO} ${HASH}"
}
function get_easyos() {
local HASH=""
local URL=""
local ISO=""
local YEAR=""
ISO="easy-${RELEASE}-amd64.img"
TWO_YEARS=$(web_pipe https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/ | grep -o -E '[[:digit:]]{4}/' | sort -nr | tr -d / | head -n 2 )
for YEAR in ${TWO_YEARS} ; do
if web_check "https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/${YEAR}/${RELEASE}/" ; then
URL="https://distro.ibiblio.org/easyos/amd64/releases/kirkstone/${YEAR}/${RELEASE}"
HASH=$(web_pipe "${URL}/md5.sum.txt" | cut -d' ' -f1)
break
fi
done
echo "${URL}/${ISO} ${HASH}"
}
function get_elementary() {
# Hash and ISO filename can be obtained from the below URL
# https://elementary.io/docs/installation#verify-your-download
local HASH=""
local STAMP
case ${RELEASE} in
7.0) STAMP=".20230129rc";;
7.1) STAMP=".20230926rc";;
8.0) STAMP=".20241122rc";;
8.1)
STAMP="-amd64.20251211"
HASH="eee6cad081664717681bec767fbfe1aa1fd920938fedad6c83b41fd341e8f306"
;;
esac
local ISO="elementaryos-${RELEASE}-stable${STAMP}.iso"
local URL="https://ams3.dl.elementary.io/download"
echo "${URL}/$(date +%s | base64)/${ISO} ${HASH}"
}
function get_endeavouros() {
local ENDEAVOUR_RELEASES=""
local HASH=""
local ISO=""
local URL="https://mirror.alpix.eu/endeavouros/iso"
# Find EndeavourOS releases from mirror, pick one matching release
ENDEAVOUR_RELEASES="$(web_pipe "${URL}/" | grep -o '' | sed 's/^.*//' | grep -v 'x86_64')"
ISO="$(echo "${ENDEAVOUR_RELEASES}" | grep -i "${RELEASE}").iso"
HASH=$(web_pipe "${URL}/${ISO}.sha512sum" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_endless() {
local HASH="" # No hash - there is a signature in .asc signed by
#https://d1anzknqnc1kmb.cloudfront.net/eos-image-keyring.gpg
# (4096R: CB50 0F7B C923 3FAD 32B4 E720 9E0C 1250 587A 279C)
local FILE_TS=""
# https://support.endlessos.org/en/installation/direct-download gives the info but computes the URLS in js
# so parsing out the useful info is not happening tonight
# Endless edition names are "base" for the small minimal one or the Language for the large full release
# The isos are stamped as they are finished so ....
case ${EDITION} in
base) FILE_TS="241023-183516";;
en) FILE_TS="241023-200926";;
es) FILE_TS="241023-184649";;
fr) FILE_TS="241023-191212";;
pt_BR) FILE_TS="241023-191427";;
esac
URL="https://images-dl.endlessm.com/release/${RELEASE}/eos-amd64-amd64/${EDITION}"
ISO="eos-eos${RELEASE:0:3}-amd64-amd64.${FILE_TS}.${EDITION}.iso"
echo "${URL}/${ISO} ${HASH}"
}
function get_fedora() {
local FEDORA_ARCH="x86_64"
local HASH=""
local ISO=""
local JSON=""
local URL=""
local VARIANT=""
[ "${ARCH}" == "arm64" ] && FEDORA_ARCH="aarch64"
case ${EDITION} in
Server|Kinoite|Onyx|Silverblue|Sericea|Workstation|KDE) VARIANT="${EDITION}";;
*) VARIANT="Spins";;
esac
# Handle KDE as a proper edition from 42 but a spin prior to 42
# Stripping eventual _Beta suffix from the RELEASE variable in the check
if [[ "${VARIANT}" == "KDE" && "${RELEASE/_Beta/}" -lt 42 ]]; then
VARIANT="Spins"
fi
# The naming of 41 Beta with a space is problematic so we replaced it with an underscore
# but we need to convert it back to a space for the URL search in the JSON
#shellcheck disable=SC2086
# if RELEASE contains an underscore, replace it with a space
if [[ "${RELEASE}" == *"_"* ]]; then
RELEASE="${RELEASE/_/ }"
fi
# shellcheck disable=SC2086
# Fedora may promote variants from Spins to Editions, in which case we want to accept either "Spins" or the specific edition name to preserve backwards compatibility
# For example, Fedora 42 KDE is now an edition, while previous releases are spins
JSON=$(web_pipe "https://getfedora.org/releases.json" | jq '.[] | select((.variant=="'"${VARIANT}"'" or .variant=="'"${EDITION}"'") and .subvariant=="'"${EDITION}"'" and .arch=="'"${FEDORA_ARCH}"'" and .version=="'"${RELEASE}"'" and (.link | endswith(".iso")))')
URL=$(echo "${JSON}" | jq -r '.link' | head -n1)
HASH=$(echo "${JSON}" | jq -r '.sha256' | head -n1)
echo "${URL} ${HASH}"
}
function get_freebsd() {
local HASH=""
local ISO="FreeBSD-${RELEASE}-RELEASE-amd64-${EDITION}.iso"
local URL="https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/${RELEASE}"
HASH=$(web_pipe "${URL}/CHECKSUM.SHA256-FreeBSD-${RELEASE}-RELEASE-amd64" | grep "${ISO}" | grep -v ".xz" | cut -d' ' -f4)
echo "${URL}/${ISO} ${HASH}"
}
function get_freedos() {
local HASH=""
local ISO=""
local BASE_URL="https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/${RELEASE}"
local URL=""
case ${RELEASE} in
1.2) URL="${BASE_URL}/official"
ISO="FD12CD.iso"
HASH=$(web_pipe "${URL}/FD12.sha" | grep "${ISO}" | cut -d' ' -f1);;
1.3) URL="${BASE_URL}/official"
ISO="FD13-LiveCD.zip"
HASH=$(web_pipe "${URL}/verify.txt" | grep -A 8 "sha256sum" | grep "${ISO}" | cut -d' ' -f1);;
1.4) URL="${BASE_URL}"
ISO="FD14-LiveCD.zip"
HASH=$(web_pipe "${URL}/verify.txt" | grep -A 8 "sha256sum" | grep "${ISO}" | cut -d' ' -f1);;
esac
echo "${URL}/${ISO} ${HASH}"
}
function get_garuda() {
local HASH=""
local ISO=""
local URL="https://iso.builds.garudalinux.org/iso/latest/garuda"
ISO=${EDITION}/latest.iso
HASH="$(web_pipe "${URL}/${ISO}.sha256" | cut -d' ' -f1)"
echo "${URL}/${ISO} ${HASH}"
}
function get_gentoo() {
local HASH=""
local ISO=""
local URL="https://mirrors.kernel.org/gentoo/releases/amd64/autobuilds"
case ${EDITION} in
minimal) ISO=$(web_pipe "${URL}/${RELEASE}-iso.txt" | grep install | cut -d' ' -f1);;
livegui) ISO=$(web_pipe "${URL}/${RELEASE}-iso.txt" | grep livegui | cut -d' ' -f1);;
esac
HASH=$(web_pipe "${URL}/${ISO}.DIGESTS" | grep -A 1 SHA512 | grep iso | grep -v CONTENTS | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_ghostbsd() {
local ISO=""
local URL="https://download.ghostbsd.org/releases/amd64/${RELEASE}"
local HASH=""
case ${EDITION} in
mate) ISO="GhostBSD-${RELEASE}.iso";;
xfce) ISO="GhostBSD-${RELEASE}-XFCE.iso";;
esac
HASH=$(web_pipe "${URL}/${ISO}.sha256" | grep "${ISO}" | cut -d' ' -f4)
echo "${URL}/${ISO} ${HASH}"
}
function get_gnomeos() {
local HASH=""
local ISO="gnome_os_installer_${RELEASE}.iso"
local URL="https://download.gnome.org/gnomeos/${RELEASE}"
case ${RELEASE} in
nightly)
ISO="gnome_os_installer.iso"
URL="https://os.gnome.org/download/latest";;
46.0) ISO="gnome_os_installer_46.iso";;
3*) ISO="gnome_os_installer.iso";;
esac
# Process the URL redirections; required for GNOME
ISO=$(web_redirect "${URL}/${ISO}")
echo "${ISO} ${HASH}"
}
function get_guix() {
local HASH=""
local ISO="guix-system-install-${RELEASE}.x86_64-linux.iso"
local URL="https://ftpmirror.gnu.org/gnu/guix/"
echo "${URL}/${ISO} ${HASH}"
}
function get_haiku() {
local ISO="haiku-${RELEASE}-${EDITION}-anyboot.iso"
local URL="http://mirror.rit.edu/haiku/${RELEASE}"
HASH=$(web_pipe "${URL}/${ISO}.sha256" | grep "${ISO}" | cut -d' ' -f4)
echo "${URL}/${ISO} ${HASH}"
}
function get_kali() {
local HASH=""
local ISO=""
local URL="https://cdimage.kali.org/${RELEASE}"
ISO=$(web_pipe "${URL}/?C=M;O=D" | grep -o ">kali-linux-.*-installer-amd64.iso" | head -n 1 | cut -c 2-)
HASH=$(web_pipe "${URL}/SHA256SUMS" | grep -v torrent | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_kdeneon() {
local HASH=""
local ISO=""
local URL="https://files.kde.org/neon/images/${RELEASE}/current"
ISO=$(web_pipe "${URL}/neon-${RELEASE}-current.sha256sum" | cut -d' ' -f3-)
HASH=$(web_pipe "${URL}/neon-${RELEASE}-current.sha256sum" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_kolibrios() {
local HASH=""
local ISO="latest-iso.7z"
local URL="http://builds.kolibrios.org/${EDITION}"
HASH=$(web_pipe "${URL}/sha256sums.txt" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_linuxlite() {
local HASH=""
local ISO="linux-lite-${RELEASE}-64bit.iso"
local URL="https://sourceforge.net/projects/linux-lite/files/${RELEASE}"
HASH=$(web_pipe "${URL}/${ISO}.sha256" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_linuxmint() {
local HASH=""
local ISO="linuxmint-${RELEASE}-${EDITION}-64bit.iso"
local URL="https://mirrors.kernel.org/linuxmint/stable/${RELEASE}"
HASH=$(web_pipe "${URL}/sha256sum.txt" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_lmde() {
local HASH=""
local ISO="lmde-${RELEASE}-${EDITION}-64bit.iso"
local URL="https://mirrors.kernel.org/linuxmint/debian"
HASH=$(web_pipe "${URL}/sha256sum.txt" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_maboxlinux() {
local HASH=""
local ISO=""
local URL=""
URL="https://sourceforge.net/projects/mabox-linux/files/${RELEASE}/download"
URL="$(web_redirect "${URL}" | cut -d? -f1)"
ISO="$(basename "${URL}")"
HASH=$(web_pipe "https://repo.maboxlinux.org/iso/${ISO}.md5" | cut -d' ' -f1)
echo "${URL} ${HASH}"
}
function generate_id() {
local macRecoveryID=""
local TYPE="${1}"
local valid_chars=("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "A" "B" "C" "D" "E" "F")
for ((i=0; i&1 | tr ';' '\n' | awk -F'session=|;' '{print $2}' | grep 1)
info=$(curl --disable -s -X POST -H "Host: osrecovery.apple.com" \
-H "Connection: close" \
-A "InternetRecovery/1.0" \
-b "session=\"${appleSession}\"" \
-H "Content-Type: text/plain" \
-d $'cid='"$(generate_id 16)"$'\nsn='${MLB}$'\nbid='${BOARD_ID}$'\nk='"$(generate_id 64)"$'\nfg='"$(generate_id 64)"$'\nos='${OS_TYPE} \
https://osrecovery.apple.com/InstallationPayload/RecoveryImage | tr ' ' '\n')
downloadLink=$(echo "$info" | grep 'oscdn' | grep 'dmg')
downloadSession=$(echo "$info" | grep 'expires' | grep 'dmg')
chunkListLink=$(echo "$info" | grep 'oscdn' | grep 'chunklist')
chunkListSession=$(echo "$info" | grep 'expires' | grep 'chunklist')
if [ "${OPERATION}" == "show" ]; then
test_result "${OS}" "${RELEASE}" "" "${downloadLink}"
exit 0
elif [ "${OPERATION}" == "test" ]; then
CHECK=$(web_check "${downloadLink}" --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${downloadSession}" && echo "PASS" || echo "FAIL")
test_result "${OS}" "${RELEASE}" "" "${downloadLink}" "${CHECK}"
exit 0
elif [ "${OPERATION}" == "download" ]; then
echo "Downloading macOS (${RELEASE^}) RecoveryImage"
echo " - URL: ${downloadLink}"
web_get "${downloadLink}" "${VM_PATH}" RecoveryImage.dmg --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${downloadSession}"
web_get "${chunkListLink}" "${VM_PATH}" RecoveryImage.chunklist --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${chunkListSession}"
VM_PATH="$(pwd)"
else
if [ ! -e "${VM_PATH}/RecoveryImage.chunklist" ]; then
echo "Downloading macOS (${RELEASE^}) RecoveryImage"
echo " - URL: ${downloadLink}"
web_get "${downloadLink}" "${VM_PATH}" RecoveryImage.dmg --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${downloadSession}"
web_get "${chunkListLink}" "${VM_PATH}" RecoveryImage.chunklist --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${chunkListSession}"
if ! "${CHUNKCHECK}" "${VM_PATH}" 2> /dev/null; then
echo " - WARNING! Verification failed, continuing anyway"
else
echo " - Verification passed"
fi
if [ -e "${VM_PATH}/RecoveryImage.dmg" ] && [ ! -e "${VM_PATH}/RecoveryImage.img" ]; then
require_qemu_img
echo " - Converting RecoveryImage.dmg"
${QEMU_IMG} convert "${VM_PATH}/RecoveryImage.dmg" -O raw "${VM_PATH}/RecoveryImage.img" 2>/dev/null
fi
rm "${VM_PATH}/RecoveryImage.dmg" "${VM_PATH}/RecoveryImage.chunklist"
echo " - RecoveryImage.img is ready."
fi
echo "Downloading OpenCore & UEFI firmware"
# Pin to last known-good commit; OVMF_CODE.fd was removed from master on 26 Jan 2026
local OSX_KVM_COMMIT="da4b23b5e92c5b939568700034367e8b7649fe90"
web_get "https://github.com/kholia/OSX-KVM/raw/${OSX_KVM_COMMIT}/OpenCore/OpenCore.qcow2" "${VM_PATH}"
web_get "https://github.com/kholia/OSX-KVM/raw/${OSX_KVM_COMMIT}/OVMF_CODE.fd" "${VM_PATH}"
if [ ! -e "${VM_PATH}/OVMF_VARS-1920x1080.fd" ]; then
web_get "https://github.com/kholia/OSX-KVM/raw/${OSX_KVM_COMMIT}/OVMF_VARS-1920x1080.fd" "${VM_PATH}"
fi
fi
make_vm_config RecoveryImage.img
}
function get_mageia() {
local HASH=""
local ISO=""
ISO=$(web_pipe https://www.mageia.org/en/downloads/get/?q="Mageia-${RELEASE}-Live-${EDITION}-x86_64.iso" | grep 'click here'| grep -o 'href=.*\.iso'|cut -d\" -f2)
HASH=$(web_pipe "${ISO}.sha512" | cut -d' ' -f1)
echo "${ISO} ${HASH}"
}
function get_manjaro() {
local HASH=""
local ISO=""
local MANIFEST=""
local URL=""
local TYPE="official"
MANIFEST="$(web_pipe https://gitlab.manjaro.org/web/iso-info/-/raw/master/file-info.json)"
case "${RELEASE}" in
sway)
MANIFEST="$(web_pipe https://mirror.manjaro-sway.download/manjaro-sway/release.json)"
TYPE="sway"
;;
cinnamon|i3) TYPE="community";;
esac
if [ "${EDITION}" == "minimal" ] && [ "${TYPE}" != "sway" ]; then
EDITION=".minimal"
else
EDITION=""
fi
if [ "${RELEASE}" == "sway" ]; then
URL=$(echo "${MANIFEST}" | jq -r '.[] | select(.name|test("^manjaro-sway-.*[.]iso$")) | .url')
else
URL="$(echo "${MANIFEST}" | jq -r ."${TYPE}.${RELEASE}${EDITION}".image)"
fi
HASH=$(web_pipe "${URL}.sha512" | cut -d' ' -f1)
echo "${URL} ${HASH}"
}
function get_mxlinux() {
local HASH=""
local ISO=""
local URL="https://sourceforge.net/projects/mx-linux/files/Final/${EDITION}"
case ${EDITION} in
Xfce) ISO="MX-${RELEASE}_Xfce_x64.iso";;
KDE) ISO="MX-${RELEASE}_KDE_x64.iso";;
Fluxbox) ISO="MX-${RELEASE}_fluxbox_x64.iso";;
esac
HASH=$(web_pipe "${URL}/${ISO}.sha256" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_netboot() {
local HASH=""
local ISO="netboot.xyz.iso"
local URL="https://boot.netboot.xyz/ipxe"
HASH=$(web_pipe "${URL}/netboot.xyz-sha256-checksums.txt" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_netbsd() {
local HASH=""
local ISO="NetBSD-${RELEASE}-amd64.iso"
local URL="https://cdn.netbsd.org/pub/NetBSD/NetBSD-${RELEASE}/images"
HASH=$(web_pipe "${URL}/MD5" | grep "${ISO}" | cut -d' ' -f4)
echo "${URL}/${ISO} ${HASH}"
}
function get_nitrux() {
local HASH=""
local URLBASE=""
local URL=""
local ISO=""
URLBASE="https://sourceforge.net/projects/nitruxos/files/Release"
URL="${URLBASE}/ISO"
ISO=$(web_pipe 'https://sourceforge.net/projects/nitruxos/rss?path=/Release/ISO' | grep '.iso' | head -n 1 | cut -d']' -f1 | cut -d '/' -f4)
HASH=$(web_pipe "${URLBASE}/MD5/${ISONAME}.md5sum" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_nixos() {
local HASH=""
local ISO="latest-nixos-${EDITION}-x86_64-linux.iso"
local URL="https://channels.nixos.org/nixos-${RELEASE}"
HASH=$(web_pipe "${URL}/${ISO}.sha256" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_nwg-shell() {
local HASH=""
local ISO="nwg-live-${RELEASE}-x86_64.iso"
local URL="https://sourceforge.net/projects/nwg-iso/files"
HASH="$(web_pipe "https://sourceforge.net/projects/nwg-iso/rss?path=/" | grep "${ISO}" | cut -d'>' -f3 | cut -d'<' -f1 | tail -n 1)"
echo "${URL}/${ISO} ${HASH}"
}
function get_openbsd() {
local HASH=""
local ISO="install${RELEASE//\./}.iso"
local URL="https://mirror.leaseweb.com/pub/OpenBSD/${RELEASE}/amd64"
HASH=$(web_pipe "${URL}/SHA256" | grep "${ISO}" | cut -d' ' -f4)
echo "${URL}/${ISO} ${HASH}"
}
function get_openindiana() {
local HASH=""
local ISO=""
local URL=""
URL="https://dlc.openindiana.org/isos/hipster/${RELEASE}"
ISO="OI-hipster-${EDITION}-${RELEASE}.iso"
HASH=$(web_pipe "${URL}/${ISO}.sha256" |cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_opensuse() {
local HASH=""
local ISO=""
local URL=""
if [ "${RELEASE}" == "tumbleweed" ]; then
ISO="openSUSE-Tumbleweed-DVD-x86_64-Current.iso"
URL="https://download.opensuse.org/tumbleweed/iso"
elif [ "${RELEASE}" == "microos" ]; then
ISO="openSUSE-MicroOS-DVD-x86_64-Current.iso"
URL="https://download.opensuse.org/tumbleweed/iso"
elif [ "${RELEASE}" == 15.0 ] || [ "${RELEASE}" == 15.1 ]; then
ISO="openSUSE-Leap-${RELEASE}-DVD-x86_64.iso"
URL="https://download.opensuse.org/distribution/leap/${RELEASE}/iso"
elif [ "${RELEASE}" == 16.0 ]; then
ISO="Leap-${RELEASE}-offline-installer-x86_64.install.iso"
URL="https://download.opensuse.org/distribution/leap/${RELEASE}/offline"
else
ISO="openSUSE-Leap-${RELEASE}-DVD-x86_64-Current.iso"
URL="https://download.opensuse.org/distribution/leap/${RELEASE}/iso"
fi
HASH=$(web_pipe "${URL}/${ISO}.sha256" | awk '{if(NR==4) print $0}' | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_oraclelinux() {
local HASH=""
local ISO=""
local VER_MAJ=${RELEASE::1}
local VER_MIN=${RELEASE:2:1}
local URL="https://yum.oracle.com/ISOS/OracleLinux/OL${VER_MAJ}/u${VER_MIN}/x86_64"
case ${VER_MAJ} in
7) ISO="OracleLinux-R${VER_MAJ}-U${VER_MIN}-Server-x86_64-dvd.iso";;
*) ISO="OracleLinux-R${VER_MAJ}-U${VER_MIN}-x86_64-dvd.iso";;
esac
HASH=$(web_pipe "https://linux.oracle.com/security/gpg/checksum/OracleLinux-R${VER_MAJ}-U${VER_MIN}-Server-x86_64.checksum" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_parrotsec() {
local HASH=""
local ISO=""
local URL=""
ISO="Parrot-${EDITION}-${RELEASE}_amd64.iso"
URL="https://download.parrot.sh/parrot/iso/${RELEASE}"
HASH="$(web_pipe "${URL}/signed-hashes.txt" | grep "${ISO}" | cut -d' ' -f1)"
echo "${URL}/${ISO} ${HASH}"
}
function get_pclinuxos() {
local URL="https://ftp.fau.de/pclinuxos/pclinuxos/iso"
local HASH=""
local ISO=""
# Find the latest ISO for this edition dynamically
ISO=$(web_pipe "${URL}/" | grep -o "pclinuxos64-${EDITION}-[0-9.]\+\.iso" | sort -Vr | head -n 1)
if [ -z "${ISO}" ]; then
echo ""
return
fi
HASH=$(web_pipe "${URL}/${ISO}.md5sum" | head -c 32)
echo "${URL}/${ISO} ${HASH}"
}
function get_peppermint() {
local HASH=""
local ISO=""
local URL="https://sourceforge.net/projects/peppermintos/files/isos"
case ${EDITION} in
devuan-xfce)
ISO="PeppermintOS-devuan_64_xfce.iso"
URL="${URL}/XFCE";;
debian-xfce)
ISO="PeppermintOS-Debian-64.iso"
URL="${URL}/XFCE";;
devuan-gnome)
ISO="PeppermintOS-devuan_64_gfb.iso"
URL="${URL}/Gnome_FlashBack";;
debian-gnome)
ISO="PeppermintOS-Debian_64_gfb.iso"
URL="${URL}/Gnome_FlashBack";;
esac
HASH=$(web_pipe "${URL}/${ISO}-sha512.checksum" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_popos() {
local HASH=""
local ISO=""
local URL=""
URL=$(web_pipe "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq -r .url)
HASH=$(web_pipe "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq -r .sha_sum)
echo "${URL} ${HASH}"
}
function get_porteus() {
local HASH=""
local ISO=""
local URL=""
edition="${EDITION~~}"
ISO="Porteus-${edition}-v${RELEASE}-x86_64.iso"
URL="https://mirrors.dotsrc.org/porteus/x86_64/Porteus-v${RELEASE}"
HASH=$(web_pipe "${URL}/sha256sums.txt" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_primtux() {
local HASH=""
local URL=""
local ISO=""
ISO="PrimTux${RELEASE}-amd64-${EDITION}.iso"
URL="https://sourceforge.net/projects/primtux/files/Distribution"
HASH=$(web_pipe "${URL}/${ISO}.md5" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_proxmox-ve() {
local HASH=""
local ISO=""
local URL=""
ISO="proxmox-ve_${RELEASE}.iso"
URL="https://enterprise.proxmox.com/iso"
HASH=$(web_pipe "${URL}/SHA256SUMS" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_pureos() {
local HASH=""
local ISO=""
local URL=""
local PureName=
PureName="$(web_pipe "https://www.pureos.net/download/" | grep -m 1 "downloads.puri" | cut -d '/' -f 4)"
local PureDate=
PureDate="$(web_pipe "https://www.pureos.net/download/" | grep -m 1 "downloads.puri" | cut -d '/' -f 6)"
local PureDateSquashed="${PureDate//'-'/}"
edition="${EDITION,,}"
URL="https://downloads.puri.sm/${PureName}/${edition}/${PureDate}"
ISO="pureos-${RELEASE}-${edition}-live-${PureDateSquashed}_amd64.iso"
local IsoTrimmed=
IsoTrimmed="${ISO%.*}"
HASH="$(web_pipe "${URL}/${IsoTrimmed}.checksums_sha256.txt" | grep -m 1 '.iso' | cut -d '.' -f 1)"
echo "${URL}/${ISO} ${HASH}"
}
function get_reactos() {
local HASH=""
local URL=""
URL="$(web_redirect "https://sourceforge.net/projects/reactos/files/latest/download")"
echo "${URL} ${HASH}"
}
function get_rebornos() {
local HASH=""
local ISO=""
ISO=$(web_pipe "https://meta.cdn.soulharsh007.dev/RebornOS-ISO?format=json" | jq -r ".url")
HASH=$(web_pipe "https://meta.cdn.soulharsh007.dev/RebornOS-ISO?format=json" | jq -r ".md5")
echo "${ISO} ${HASH}"
}
function get_rockylinux() {
if { [[ "${RELEASE}" =~ ^8. ]] || [[ "${RELEASE}" =~ ^10. ]]; } && [[ "${EDITION}" == "dvd" ]]; then
EDITION="dvd1"
fi
local HASH=""
local ISO="Rocky-${RELEASE}-x86_64-${EDITION}.iso"
local URL="https://dl.rockylinux.org/vault/rocky/${RELEASE}/isos/x86_64"
HASH=$(web_pipe "${URL}/CHECKSUM" | grep "SHA256" | grep "${ISO})" | cut -d' ' -f4)
echo "${URL}/${ISO} ${HASH}"
}
function get_siduction() {
local HASH=""
local DATE=""
local ISO=""
local NAME=""
local URL=""
NAME=$(web_pipe "https://mirror.math.princeton.edu/pub/siduction/iso/" | grep folder | cut -d'"' -f8 | tr -d '/')
URL="https://mirrors.dotsrc.org/siduction/iso/${NAME}/${EDITION}"
DATE=$(web_pipe "${URL}"| grep .iso.md5 | cut -d'-' -f6 | cut -d'.' -f1)
HASH=$(web_pipe "${URL}/${ISO}.md5" | cut -d' ' -f1)
VERSION=$(web_pipe "${URL}"| grep .iso.md5 | cut -d'-' -f2)
ISO="siduction-${VERSION}-${NAME}-${EDITION}-amd64-${DATE}.iso"
echo "${URL}/${ISO} ${HASH}"
}
function get_slackware() {
local HASH=""
local ISO="slackware64-${RELEASE}-install-dvd.iso"
local URL="https://slackware.nl/slackware/slackware-iso/slackware64-${RELEASE}-iso"
HASH=$(web_pipe "${URL}/${ISO}.md5" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_slax() {
local HASH=""
local ISO=""
local URL=""
case ${EDITION} in
debian)
URL="https://ftp.fi.muni.cz/pub/linux/slax/Slax-12.x"
ISO=$(web_pipe "${URL}/md5.txt" | grep '64bit-' | cut -d' ' -f3 | tail -n1);;
slackware)
URL="https://ftp.fi.muni.cz/pub/linux/slax/Slax-15.x"
ISO=$(web_pipe "${URL}/md5.txt" | grep '64bit-' | cut -d' ' -f3 | tail -n1);;
esac
HASH=$(web_pipe "${URL}/md5.txt" | grep '64bit-' | cut -d' ' -f1 | tail -n1)
echo "${URL}/${ISO} ${HASH}"
}
function get_slint() {
local HASH=""
local MAJ_VER=""
local ISO="slint64-${RELEASE}.iso"
MAJ_VER="$(echo "${RELEASE}" | cut -d'-' -f 1)"
local URL="https://slackware.uk/slint/x86_64/slint-${MAJ_VER}/iso"
HASH=$(web_pipe "${URL}/${ISO}.sha256" | cut -d' ' -f4)
echo "${URL}/${ISO}" "${HASH}"
}
function get_slitaz() {
local HASH=""
local ISO="slitaz-rolling-${RELEASE}"
local URL="http://mirror.slitaz.org/iso/rolling"
HASH=$(web_pipe "${URL}/${ISO}.md5" | cut -d' ' -f1)
echo "${URL}/${ISO}.iso ${HASH}"
}
function get_solus() {
local HASH=""
local ISO=""
local URL="https://downloads.getsol.us/isos/${RELEASE}"
# Try standard naming first, then beta naming for Xfce (older releases had Xfce as beta)
ISO="Solus-${EDITION}-Release-${RELEASE}.iso"
if ! web_check "${URL}/${ISO}"; then
# Try uppercase XFCE-Beta naming for older releases
local EDITION_UPPER="${EDITION^^}"
ISO="Solus-${EDITION_UPPER}-Beta-Release-${RELEASE}.iso"
fi
HASH=$(web_pipe "${URL}/${ISO}.sha256sum" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_sparkylinux() {
local HASH=""
local ISO=""
local URL=""
ISO="sparkylinux-${RELEASE}-x86_64-${EDITION}.iso"
case ${EDITION} in
minimalcli) URL="https://sourceforge.net/projects/sparkylinux/files/cli";;
minimalgui) URL="https://sourceforge.net/projects/sparkylinux/files/base";;
*) URL="https://sourceforge.net/projects/sparkylinux/files/${EDITION}";;
esac
HASH=$(web_pipe "${URL}/${ISO}.allsums.txt" | head -n 2 | grep 'iso' | cut -d' ' -f1)
echo "${URL}/${ISO}" "${HASH}"
}
function get_spirallinux() {
local HASH=""
local ISO="SpiralLinux_${EDITION}_12.231005_x86-64.iso"
local URL="https://sourceforge.net/projects/spirallinux/files/12.231005"
HASH=$(web_pipe 'https://sourceforge.net/projects/spirallinux/rss?path=/' | grep "${ISO}" | grep 'md5' | cut -d'<' -f3 | cut -d'>' -f2)
echo "${URL}/${ISO}" "${HASH}"
}
function get_tails() {
local JSON=""
local HASH=""
local URL=""
JSON="$(web_pipe "https://tails.boum.org/install/v2/Tails/amd64/${RELEASE}/latest.json")"
URL=$(echo "${JSON}" | jq -r '.installations[0]."installation-paths"[]|select(.type=="iso")|."target-files"[0].url')
HASH=$(echo "${JSON}" | jq -r '.installations[0]."installation-paths"[]|select(.type=="iso")|."target-files"[0].sha256')
echo "${URL} ${HASH}"
}
function get_tinycore() {
local ARCH="x86"
local HASH=""
local ISO="${EDITION}-${RELEASE}.0.iso"
case "${EDITION}" in
*Pure*) ARCH+="_64";;
esac
local URL="http://www.tinycorelinux.net/${RELEASE}.x/${ARCH}/release"
HASH=$(web_pipe "${URL}/${ISO}.md5.txt" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_trisquel() {
local HASH=""
local ISO=""
local URL="https://mirrors.ocf.berkeley.edu/trisquel-images"
case ${EDITION} in
mate) ISO="trisquel_${RELEASE}_amd64.iso";;
lxde) ISO="trisquel-mini_${RELEASE}_amd64.iso";;
kde) ISO="triskel_${RELEASE}_amd64.iso";;
sugar) ISO="trisquel-sugar_${RELEASE}_amd64.iso";;
esac
HASH=$(web_pipe "${URL}/${ISO}.sha1" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function get_tuxedo-os() {
local HASH=""
local ISO=""
local URL="https://os.tuxedocomputers.com"
ISO="$(web_pipe "https://os.tuxedocomputers.com/" | grep -m 1 current.iso | cut -d '=' -f 4 | cut -d '"' -f 2)"
HASH="$(web_pipe "https://os.tuxedocomputers.com/checksums/${ISO}.sha256" | cut -d ' ' -f 1)"
echo "${URL}/${ISO} ${HASH}"
}
function get_ubuntu-server() {
local DATA=""
local HASH=""
local ISO=""
local NAME="live-server"
local UBUNTU_ARCH="${ARCH}"
local URL=""
if [[ "${RELEASE}" == "daily"* ]]; then
URL="https://cdimage.ubuntu.com/${OS}/${RELEASE}/current"
elif [ "${UBUNTU_ARCH}" == "arm64" ]; then
# ARM64 ISOs are hosted on cdimage.ubuntu.com
URL="https://cdimage.ubuntu.com/releases/${RELEASE}/release"
else
URL="https://releases.ubuntu.com/${RELEASE}"
fi
case "${RELEASE}" in
14*|16*) NAME="server";;
esac
if web_check "${URL}/SHA256SUMS"; then
DATA=$(web_pipe "${URL}/SHA256SUMS" | grep "${NAME}" | grep "${UBUNTU_ARCH}" | grep iso | tail -n 1 )
ISO=$(cut -d'*' -f2 <<<"${DATA}")
HASH=$(cut -d' ' -f1 <<<"${DATA}")
else
DATA=$(web_pipe "${URL}/MD5SUMS" | grep "${NAME}" | grep "${UBUNTU_ARCH}" | grep iso | tail -n 1 )
ISO=$(cut -d' ' -f3 <<<"${DATA}")
HASH=$(cut -d' ' -f1 <<<"${DATA}")
fi
if [[ "${RELEASE}" == "daily"* ]] || [ "${RELEASE}" == "dvd" ]; then
zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso"
make_vm_config "${OS}-devel.iso"
else
web_get "${URL}/${ISO}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}"
fi
}
function get_ubuntu() {
local DATA=""
local HASH=""
local ISO=""
local UBUNTU_ARCH="${ARCH}"
local URL=""
# Validate architecture support now that RELEASE is known
if ! is_arch_supported "${OS}" "${UBUNTU_ARCH}"; then
if [ "${OPERATION}" == "test" ] || [ "${OPERATION}" == "show" ]; then
test_result "${OS}" "${RELEASE}" "" "" "SKIP" "(not available for ${UBUNTU_ARCH})"
exit 0
else
echo "ERROR! $(pretty_name "${OS}") ${RELEASE} is not available for ${UBUNTU_ARCH} architecture."
exit 1
fi
fi
if [[ "${RELEASE}" == "daily"* ]] && [ "${OS}" == "ubuntustudio" ]; then
# Ubuntu Studio daily-live images are in the dvd directory
RELEASE="dvd"
fi
if [[ "${RELEASE}" == "jammy-daily" ]]; then
if [[ "${OS}" == "ubuntustudio" ]]; then
URL="https://cdimage.ubuntu.com/${OS}/jammy/dvd/current"
else
URL="https://cdimage.ubuntu.com/${OS}/jammy/daily-live/current"
fi
VM_PATH="${OS}-jammy-live$(arch_suffix)"
elif [[ "${RELEASE}" == "daily"* ]] || [ "${RELEASE}" == "dvd" ]; then
URL="https://cdimage.ubuntu.com/${OS}/${RELEASE}/current"
VM_PATH="${OS}-${RELEASE}$(arch_suffix)"
elif [ "${OS}" == "ubuntu" ] && [ "${UBUNTU_ARCH}" == "arm64" ]; then
# ARM64 desktop ISOs are hosted on cdimage.ubuntu.com
URL="https://cdimage.ubuntu.com/releases/${RELEASE}/release"
elif [ "${OS}" == "ubuntu" ]; then
URL="https://releases.ubuntu.com/${RELEASE}"
else
URL="https://cdimage.ubuntu.com/${OS}/releases/${RELEASE}/release"
fi
if web_check "${URL}/SHA256SUMS"; then
DATA=$(web_pipe "${URL}/SHA256SUMS" | grep 'desktop\|dvd\|install' | grep "${UBUNTU_ARCH}" | grep iso | grep -v "+mac" | tail -n 1 )
ISO=$(cut -d'*' -f2 <<<"${DATA}" | sed '1q;d')
HASH=$(cut -d' ' -f1 <<<"${DATA}" | sed '1q;d')
else
DATA=$(web_pipe "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep "${UBUNTU_ARCH}" | grep iso | grep -v "+mac" | tail -n 1 )
ISO=$(cut -d'*' -f2 <<<"${DATA}")
HASH=$(cut -d' ' -f1 <<<"${DATA}")
fi
if [ -z "${ISO}" ] || [ -z "${HASH}" ]; then
echo "$(pretty_name "${OS}") ${RELEASE} is currently unavailable. Please select other OS/Release combination"
exit 1
fi
if [[ "${RELEASE}" == "daily"* ]] || [ "${RELEASE}" == "dvd" ]; then
zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso"
make_vm_config "${OS}-devel.iso"
elif [[ "${RELEASE}" == "jammy-daily" ]]; then
zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-jammy-live.iso"
make_vm_config "${OS}-jammy-live.iso"
else
web_get "${URL}/${ISO}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}"
fi
}
function get_vanillaos() {
local HASH=""
local HASH_URL=""
local ISO=""
ISO=$(web_pipe "https://api.github.com/repos/Vanilla-OS/live-iso/releases" | grep 'download_url' | grep "${RELEASE}" | head -n 1 | cut -d'"' -f4)
HASH_URL="${ISO//.iso/.sha256.txt}"
HASH=$(web_pipe "${HASH_URL}" | cut -d' ' -f1)
echo "${ISO} ${HASH}"
}
function get_void() {
local DATE=""
local HASH=""
local ISO=""
local URL="https://repo-default.voidlinux.org/live"
case ${EDITION} in
glibc) ISO="void-live-x86_64-${RELEASE}-base.iso";;
musl) ISO="void-live-x86_64-musl-${RELEASE}-base.iso";;
xfce-glibc) ISO="void-live-x86_64-${RELEASE}-xfce.iso";;
xfce-musl) ISO="void-live-x86_64-musl-${RELEASE}-xfce.iso";;
esac
HASH="$(web_pipe "${URL}/sha256sum.txt" | grep "${ISO}" | cut -d' ' -f4)"
echo "${URL}/${RELEASE}/${ISO} ${HASH}"
}
function get_zorin() {
local HASH=""
local ISO=""
local URL="https://plug-mirror.rcac.purdue.edu/zorin-iso/${RELEASE}"
local EDITION_NAME=""
# Convert edition code to ISO naming
case ${EDITION} in
core64) EDITION_NAME="Core-64-bit";;
lite64) EDITION_NAME="Lite-64-bit";;
education64) EDITION_NAME="Education-64-bit";;
esac
# Find the latest revision (r2, r1, or base)
ISO=$(web_pipe "${URL}/" | grep -o "Zorin-OS-[0-9.]*-${EDITION_NAME}[^\"]*\.iso" | grep -v Beta | sort -Vr | head -n 1)
if [ -z "${ISO}" ]; then
echo ""
return
fi
HASH=$(web_pipe "${URL}/SHA256SUMS.txt" | grep "${ISO}" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}"
}
function unattended_windows() {
mkdir -p "${1}/unattended" 2>/dev/null
cat << 'EOF' > "${1}/unattended/autounattend.xml"
false
*
true
1
true
*
Quickemu Project
Quickemu
24/7
Quickemu Project
https://github.com/quickemu-project/quickemu/issues
Quickemu Project
W269N-WFGWX-YVC9B-4J6C9-T83GX
0
false
0
true
1
Primary
256
2
EFI
128
3
MSR
128
4
Primary
true
1
1
NTFS
DE94BBA4-06D1-4D40-A16A-BFD50179D6AC
2
2
FAT32
3
3
4
4
C
NTFS
true
Never
0
4
false
1
reg add HKLM\System\Setup\LabConfig /v BypassCPUCheck /t REG_DWORD /d 0x00000001 /f
2
reg add HKLM\System\Setup\LabConfig /v BypassRAMCheck /t REG_DWORD /d 0x00000001 /f
3
reg add HKLM\System\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 0x00000001 /f
4
reg add HKLM\System\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 0x00000001 /f
false
Never
true
Quickemu
Quickemu Project
W269N-WFGWX-YVC9B-4J6C9-T83GX
Never
E:\qemufwcfg\w10\amd64
E:\vioinput\w10\amd64
E:\vioscsi\w10\amd64
E:\viostor\w10\amd64
E:\vioserial\w10\amd64
E:\qxldod\w10\amd64
E:\viorng\w10\amd64
E:\NetKVM\w10\amd64
E:\viofs\w10\amd64
E:\Balloon\w10\amd64
quickemu
true
true
Quickemu
false
true
true
true
true
true
Home
3
true
true
true
quickemu
true
Quickemu
Quickemu
Administrators
Quickemu
Quickemu Project
Quickemu
msiexec /i E:\guest-agent\qemu-ga-x86_64.msi /quiet /passive /qn
Install Virtio Guest Agent
1
msiexec /i F:\spice-webdavd-x64-latest.msi /quiet /passive /qn
Install spice-webdavd file sharing agent
2
msiexec /i F:\spice-vdagent-x64-0.10.0.msi /quiet /passive /qn
Install spice-vdagent SPICE agent
3
Cmd /c POWERCFG -H OFF
Disable Hibernation
4
pnputil /add-driver E:\viogpudo\w10\amd64\viogpudo.inf /install
Install viogpudo driver
5
cmd /c net accounts /maxpwage:unlimited
Local account passwords never expire
6
EOF
echo "Downloading Spice drivers..."
web_get https://www.spice-space.org/download/windows/spice-webdavd/spice-webdavd-x64-latest.msi "${VM_PATH}/unattended"
web_get https://www.spice-space.org/download/windows/vdagent/vdagent-win-0.10.0/spice-vdagent-x64-0.10.0.msi "${VM_PATH}/unattended"
echo "Making unattended.iso"
mkisofs -quiet -J -o "${VM_PATH}/unattended.iso" "${VM_PATH}/unattended/"
}
function handle_curl_error() {
local error_code="$1"
local fatal_error_action=2
case "$error_code" in
6)
echo "Failed to resolve Microsoft servers! Is there an Internet connection? Exiting..."
return "$fatal_error_action"
;;
7)
echo "Failed to contact Microsoft servers! Is there an Internet connection or is the server down?"
;;
8)
echo "Microsoft servers returned a malformed HTTP response!"
;;
22)
echo "Microsoft servers returned a failing HTTP status code!"
;;
23)
echo "Failed at writing Windows media to disk! Out of disk space or permission error? Exiting..."
return "$fatal_error_action"
;;
26)
echo "Ran out of memory during download! Exiting..."
return "$fatal_error_action"
;;
36)
echo "Failed to continue earlier download!"
;;
63)
echo "Microsoft servers returned an unexpectedly large response!"
;;
# POSIX defines exit statuses 1-125 as usable by us
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02
$((error_code <= 125)))
# Must be some other server or network error (possibly with this specific request/file)
# This is when accounting for all possible errors in the curl manual assuming a correctly formed curl command and an HTTP(S) request, using only the curl features we're using, and a sane build
echo "Miscellaneous server or network error!"
;;
126 | 127 )
echo "Curl command not found! Please install curl and try again. Exiting..."
return "$fatal_error_action"
;;
# Exit statuses are undefined by POSIX beyond this point
*)
case "$(kill -l "$error_code")" in
# Signals defined to exist by POSIX:
# https://pubs.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html
INT)
echo "Curl was interrupted!"
;;
# There could be other signals but these are most common
SEGV | ABRT )
echo "Curl crashed! Failed exploitation attempt? Please report any core dumps to curl developers. Exiting..."
return "$fatal_error_action"
;;
*)
echo "Curl terminated due to a fatal signal!"
;;
esac
esac
return 1
}
function download_windows_server() {
local iso_download_page_html=""
# Copyright (C) 2024 Elliot Killick
# This function is adapted from the Mido project:
# https://github.com/ElliotKillick/Mido
# Download enterprise evaluation Windows versions
local windows_version="$1"
local enterprise_type="$2"
local PRETTY_RELEASE=""
case "${RELEASE}" in
*) PRETTY_RELEASE="${RELEASE}";;
esac
echo "Downloading $(pretty_name "${OS}") ${PRETTY_RELEASE} (${I18N})"
local url="https://www.microsoft.com/en-us/evalcenter/download-$windows_version"
echo " - Parsing download page: ${url}"
iso_download_page_html="$(curl --disable --silent --location --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url")" || {
handle_curl_error $?
return $?
}
if ! [ "$iso_download_page_html" ]; then
# This should only happen if there's been some change to where this download page is located
echo " - Windows server download page gave us an empty response"
return 1
fi
local CULTURE=""
local COUNTRY=""
case "${I18N}" in
"English (Great Britain)")
CULTURE="en-gb"
COUNTRY="GB";;
"Chinese (Simplified)")
CULTURE="zh-cn"
COUNTRY="CN";;
"Chinese (Traditional)")
CULTURE="zh-tw"
COUNTRY="TW";;
"French")
CULTURE="fr-fr"
COUNTRY="FR";;
"German")
CULTURE="de-de"
COUNTRY="DE";;
"Italian")
CULTURE="it-it"
COUNTRY="IT";;
"Japanese")
CULTURE="ja-jp"
COUNTRY="JP";;
"Korean")
CULTURE="ko-kr"
COUNTRY="KR";;
"Portuguese (Brazil)")
CULTURE="pt-br"
COUNTRY="BR";;
"Spanish")
CULTURE="es-es"
COUNTRY="ES";;
"Russian")
CULTURE="ru-ru"
COUNTRY="RU";;
*)
CULTURE="en-us"
COUNTRY="US";;
esac
echo " - Getting download link.."
iso_download_links="$(echo "$iso_download_page_html" | grep -o "https://go.microsoft.com/fwlink/p/?LinkID=[0-9]\+&clcid=0x[0-9a-z]\+&culture=${CULTURE}&country=${COUNTRY}")" || {
# This should only happen if there's been some change to the download endpoint web address
echo " - Windows server download page gave us no download link"
return 1
}
# Limit untrusted size for input validation
iso_download_links="$(echo "$iso_download_links" | head -c 1024)"
case "$enterprise_type" in
# Select x64 download link
"enterprise") iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1) ;;
# Select x64 LTSC download link
"ltsc") iso_download_link=$(echo "$iso_download_links" | head -n 4 | tail -n 1) ;;
*) iso_download_link="$iso_download_links" ;;
esac
# Follow redirect so proceeding log message is useful
# This is a request we make this Fido doesn't
# We don't need to set "--max-filesize" here because this is a HEAD request and the output is to /dev/null anyway
iso_download_link="$(curl --disable --silent --location --output /dev/null --silent --write-out "%{url_effective}" --head --fail --proto =https --tlsv1.2 --http1.1 -- "$iso_download_link")" || {
# This should only happen if the Microsoft servers are down
handle_curl_error $?
return $?
}
# Limit untrusted size for input validation
iso_download_link="$(echo "$iso_download_link" | head -c 1024)"
echo " - URL: $iso_download_link"
# Download ISO
FILE_NAME="${iso_download_link##*/}"
web_get "${iso_download_link}" "${VM_PATH}" "${FILE_NAME}"
OS="windows-server"
}
function download_windows_workstation() {
local HASH=""
local session_id=""
local iso_download_page_html=""
local product_edition_id=""
local language_skuid_table_json=""
local sku_id=""
local iso_download_link_json=""
local iso_download_link=""
echo "Downloading Windows ${RELEASE} (${I18N})"
# This function is adapted from the Mido project:
# https://github.com/ElliotKillick/Mido
# Download newer consumer Windows versions from behind gated Microsoft API
# Either 10, or 11
local windows_version="$1"
local url="https://www.microsoft.com/en-us/software-download/windows$windows_version"
case "$windows_version" in
10) url="${url}ISO";;
esac
local user_agent="Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0"
session_id="$(uuidgen)"
# Get product edition ID for latest release of given Windows version
# Product edition ID: This specifies both the Windows release (e.g. 22H2) and edition ("multi-edition" is default, either Home/Pro/Edu/etc., we select "Pro" in the answer files) in one number
# This is the *only* request we make that Fido doesn't. Fido manually maintains a list of all the Windows release/edition product edition IDs in its script (see: $WindowsVersions array). This is helpful for downloading older releases (e.g. Windows 10 1909, 21H1, etc.) but we always want to get the newest release which is why we get this value dynamically
# Also, keeping a "$WindowsVersions" array like Fido does would be way too much of a maintenance burden
# Remove "Accept" header that curl sends by default
echo " - Parsing download page: ${url}"
iso_download_page_html="$(curl --disable --silent --user-agent "$user_agent" --header "Accept:" --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url")" || {
handle_curl_error $?
return $?
}
echo -n " - Getting Product edition ID: "
# tr: Filter for only numerics to prevent HTTP parameter injection
# head -c was recently added to POSIX: https://austingroupbugs.net/view.php?id=407
product_edition_id="$(echo "$iso_download_page_html" | grep -Eo '