dnf install mkosi
qemu-system-x86_64
argbash
to generate the argument parser lib (using parser_generator.m4
)You can also git clone https://github.com/systemd/mkosi, symlink to
mkosi.git/bin/mkosi
and run mkosi directly from source. This works out of the box
with git tags v15 and above.
Fedora 39 updates mkosi to 15 (and later) which contains a lot of breaking changes, and indeed breaks various expectations with run_qemu's usage of it.
Fedora 39 and 40 have packaged mkosi 14 separately and in parallel to the latest mkosi. Uninstall the default mkosi package, and install 'mkosi14' to continue using run_qemu on Fedora 39 and 40:
# dnf remove --noautoremove mkosi
# dnf install mkosi14
Fedora 41 has stopped packaging mkosi14.
run_qemu.sh
script into somewhere in your PATH
ln -s ~/git/run_qemu/run_qemu.sh ~/bin/run_qemu.sh
run_qemu
file into the default bash completions dirpkg-config --variable=completionsdir bash-completion
run_qemu.sh --cxl --git-qemu
mkosi
ndctl
), and other convenience operations such as
copying your ~/.ssh/id_rsa.pub
for easy ssh access, and your ~/.bashrc
etc.run_qemu.sh --help
Ctrl-a c
: switch between the qemu monitor prompt (qemu)
and consoleCtrl-a x
: kill qemu and exitmkosi
creates a package cache in mkosi.cache/
If a cache is present,
it will always use only that, and never go over the network even if newer
packages are available. To force re-fetching everything, remove this
directory, or --rebuild=wipe which removes the builddir
entirely.qemu
to use can be overridden from the environment:
qemu=/path/to/qemu/build/qemu-system-x86_64 ./run_qemu.sh [options]
env
:
qemu
gdb
distro
rev
builddir
ndctl
To use the 'hostfwd' network, put this in your .ssh/config
:
Host rq Hostname localhost User root Port 10022 StrictHostKeyChecking no UserKnownHostsFile /dev/null
And then ssh rq
. You may need to open port 10022 on any local firewalls.
root
. The serial console
automatically logs in, and a password isn't required.The script enables generating a sane QEMU commandline for instantiating a basic CXL topology. Since QEMU support for CXL isn't yet upstream, --git-qemu
is additionally required. The CXL related options are:
--cxl
: Enables a simple CXL topology with:
$ grep -i cxl .config
CONFIG_CXL_BUS=y
CONFIG_CXL_PCI=m
CONFIG_CXL_MEM_RAW_COMMANDS=y
CONFIG_CXL_ACPI=m
CONFIG_CXL_PMEM=m
CONFIG_CXL_MEM=m
CONFIG_CXL_PORT=y
CONFIG_CXL_SUSPEND=y
The following is a way to check basic sanity within the QEMU guest:
lspci | grep '3[45]:00'
34:00.0 PCI bridge: Intel Corporation Device 7075
35:00.0 Memory controller [0502]: Intel Corporation Device 0d93 (rev 01)
readlink -f /sys/bus/cxl/devices/mem0
/sys/devices/pci0000:34/0000:34:00.0/0000:35:00.0/mem0