There are 2 versions of script semi automated and fully automated -> qemu-wayland-gpu-test.sh ( In this one has to manually install the fedora after the VM boats) and setup_wayland_vm.sh ( In this everything is automated , even after the guest vm boats for first time, it will automatically installs fedora for you)
Requirements-: fedora os 41 Live Workstation in Host and stable internet if using live usb as it will install the dependencies. Storage >=30 gb and RAM >=4 , prefer 8gb
- Download the script- setup_wayland_vm.sh
- Make it executable using chmod +x setup_wayland_vm.sh prefered for fully automation.
- open a new terminal run ./setup_wayland_vm.sh and you are all set :)
This repository contains two Bash scripts each having 2 components/parts:
part1.sh– Builds a custom QEMU from source withvirtio-gpu-rutabaga(Rutabaga) support.part2.sh– Sets up, configures, and launches a Fedora 41 VM that uses the newly built QEMU binary, enables Wayland-forwarded graphics via Rutabaga, and installs example Wayland applications (e.g. Foot, Gedit, Firefox) in the guest.
Together, they reproduce a feature similar to Chromium OS’s hardware-accelerated Wayland integration on a “standard” Linux distribution (Fedora 41). You can run them on a fresh Fedora 41 installation or a Fedora 41 Live USB session (as long as you have network access and the standard Fedora repos enabled).
-
Phase 1 (
part1.sh):- Remove any existing QEMU packages or binaries from common system paths.
- Install build dependencies (C toolchain, libraries, Rust/Cargo, etc.).
- Clone the Chromium OS
crosvmrepository, build therutabaga_gfxlibrary from source (so that QEMU can use it). - Clone QEMU from its official GitHub mirror, configure it with
--enable-rutabaga-gfx, along with VirglRenderer, OpenGL, GTK, SDL, SPICE, and other virtualization features. - Compile and install QEMU under
/usr/local. - Verify installation and print out an example QEMU command line using
virtio-gpu-rutabaga.
-
Phase 2 (
part2.sh):-
Detect that you are on Fedora 41 (or at least warn if you are not).
-
Install host-side packages required for virtualization (
qemu-kvm,libvirt,virt-manager, plus development tools, Wayland libraries, Foot, Gedit, Firefox, etc.). -
Confirm that the newly installed (or system) QEMU binary actually has Rutabaga support.
-
Create a VM workspace under
~/wayland-vm/(by default). -
Download the Fedora 41 Workstation Live ISO (if not already present).
-
Create a fresh qcow2 disk (20 GB by default).
-
Generate several helper scripts inside
~/wayland-vm/:guest-autostart.sh– a script meant to run inside the guest on boot, which waits for Wayland and launches Foot, Gedit, Firefox.start-wayland-vm.sh– the QEMU launcher that boots from ISO (on first run) or from disk thereafter, with a fullvirtio-gpu-rutabagacommand line. It also mounts~/wayland-vm/scripts/into the guest via 9p.install-helper.sh– instructions for how to copyguest-autostart.shinto the guest filesystem and register it as a systemd service so it actually executes on first real login.test-wayland.sh– a simple host-side check that verifies QEMU’s Rutabaga support and host Wayland status.README.md– (this file) full documentation of the entire process.
-
Once both scripts have run successfully, you will have:
-
A custom QEMU binary with Rutabaga in
/usr/local/bin/qemu-system-x86_64. -
A self-contained VM workspace in
~/wayland-vm/that can:- Launch a new Fedora 41 install (
start-wayland-vm.sh --install). - After installation, automatically enable
guest-autostart.shinside the VM so that example Wayland apps start at login. - Boot normally from the installed disk, with hardware-accelerated graphics and Wayland forwarding.
- Launch a new Fedora 41 install (
-
Host Operating System
- Fedora 41 Workstation (Live USB or a fresh install).
- Internet access (to fetch packages via
dnfand download the Fedora ISO).
-
Free Disk Space & Memory
- ≥ 30 GB of free space in
$HOME(for QEMU build artifacts and the VM disk). - ≥ 8 GB RAM free (we allocate 4 GB to the VM by default).
- ≥ 30 GB of free space in
-
User Privileges
- Your user must be in the
libvirt(and/orkvm) group so that KVM acceleration can work. - The scripts will escalate with
sudowhere needed (for package installs,make install,ldconfig, etc.).
- Your user must be in the
-
Network Access
- For
part1.sh: togit cloneQEMU andcrosvm, todnf installpackages. - For
part2.sh: todnf installvirtualization/Wayland packages and tocurlthe Fedora ISO.
- For
-
Completely removes any existing QEMU binaries or libraries from your system (via package manager and
/usr/local/bin,/usr/bin,/usr/local/share, etc.). -
Installs all necessary build dependencies (C compiler, development libraries, Rust, Cargo, Python-sphinx, tools like Ninja).
-
Clones and builds Chromium OS’s
rutabaga_gfxlibrary from source (to supply QEMU with the correct version). -
Clones the official QEMU repository at tag
stable-8.2, configures it with support for:- KVM acceleration
- virtio-gpu-rutabaga (Rutabaga)
- virglrenderer & OpenGL
- GTK, SDL, SPICE, VNC, curses, SLIRP networking, vhost, CAP-NG, and a variety of Linux AIO and block/device features
-
Compiles QEMU (
make -j$(nproc)) and installs it under/usr/localby default. -
Creates symlinks so that
/usr/local/bin/qemuandqemu-imgpoint to the newly built binaries. -
Verifies the installation by running
qemu-system-x86_64 --versionand checking forvirtio-gpu-rutabagainqemu-system-x86_64 -device help.
-
Initialize & Color Setup
- Sets
set -e(exit on error). - Defines color codes for informational, warning, and error outputs.
- Detects if running as root (
$EUID == 0) or normal user; if non-root, usessudofor privileged commands.
- Sets
-
Step 1: Remove Existing QEMU
- If
aptis detected (Debian/Ubuntu), runapt remove qemu*; ifdnf(Fedora), rundnf remove qemu*; ifpacman(Arch), runpacman -R qemu*. - Deletes any leftover QEMU files from
/usr/local/bin,/usr/local/share/qemu,/usr/bin/qemu*,/usr/share/qemu, etc. - Deletes the previous build directory (
$WORK_DIR, default is~/qemu-rutabaga-build).
- If
-
Step 2: Install Build Dependencies
-
Detects package manager again and installs a long list of development packages, including:
- Base tools (
git,gcc,g++,make,ninja-build) - Libraries for graphics:
libepoxy-devel,libdrm-devel,mesa-libgbm-devel,virglrenderer-devel, etc. - Wayland support:
wayland-devel,wayland-protocols-devel,libxkbcommon-devel, etc. - Window toolkits:
gtk3-devel,libsdl2-dev,libspice-server-dev, etc. - Storage/net features:
libaio-devel,libcap-ng-devel,libcurl-devel, etc. - Rust toolchain (
cargo,rustc) and Python Sphinx for generating docs if needed.
- Base tools (
-
-
Step 3: Build
rutabaga_gfxLibrary-
Creates
$WORK_DIR(default~/qemu-rutabaga-build) andcdinto it. -
Clones
https://chromium.googlesource.com/chromiumos/platform/crosvm. -
Enters
crosvm/rutabaga_gfxand runs:cargo build --release --no-default-features --features=gfxstream -
If
librutabaga_gfx.soor.ais not produced, tries alternative Cargo features (virgl_renderer, then fallback). -
If successful, copies
librutabaga_gfx.soand/or.ato/usr/local/lib/, and headers (rutabaga_gfx.h,rutabaga_gfx_ffi.h) to/usr/local/include/rutabaga_gfx. -
Runs
sudo ldconfigto update the library cache. -
If all builds fail, sets
SKIP_RUTABAGA_LIB=1so that QEMU’s own built-in Rutabaga fallback is used.
-
-
Step 4: Clone & Build QEMU
-
git clone https://github.com/qemu/qemu.gitandcd qemu && git checkout $QEMU_VERSION(defaultstable-8.2). -
Runs
./configurewith:--prefix=/usr/local --target-list=x86_64-softmmu,aarch64-softmmu --enable-kvm --enable-rutabaga-gfx --enable-virglrenderer --enable-opengl --enable-gtk --enable-sdl --enable-spice --enable-vnc --enable-curses --enable-linux-aio --enable-cap-ng --enable-attr --enable-vhost-net --enable-vhost-crypto --enable-vhost-kernel --enable-vhost-user --enable-vhost-vdpa --enable-slirp --audio-drv-list=pa,alsa --disable-werror -
Runs
make -j$(nproc)to compile.
-
-
Step 5: Install QEMU
-
Runs
sudo make install(installing QEMU into/usr/local/bin, libraries in/usr/local/lib, share files, etc.). -
Creates symlinks:
sudo ln -sf /usr/local/bin/qemu-system-x86_64 /usr/local/bin/qemu sudo ln -sf /usr/local/bin/qemu-img /usr/local/bin/qemu-img -
Runs
sudo ldconfigagain.
-
-
Step 6: Verify Installation
-
Checks that
/usr/local/bin/qemu-system-x86_64exists. -
Prints:
- QEMU version (
qemu-system-x86_64 --version). - Verifies
virtio-gpu-rutabagaappears inqemu-system-x86_64 -device help. - Displays installation paths for the binary,
qemu-img, andlibrutabaga_gfx.so.
- QEMU version (
-
Prints an example VM command line:
qemu-system-x86_64 \ -enable-kvm \ -m 4G \ -smp 4 \ -display gtk,gl=on \ -device virtio-gpu-rutabaga,hostmem=256M,cross-domain=on,wsi=surfaceless \ -netdev user,id=net0 \ -device virtio-net-pci,netdev=net0 \ -drive file=your-disk.qcow2,format=qcow2,if=virtio \ -boot order=c
-
Asks interactively if you want to remove the build directory (
~/qemu-rutabaga-build).
-
-
Make the script executable:
chmod +x part1.sh
-
Run it (as your regular user with sudo privileges):
./part1.sh
- If you’re not root, it will automatically prefix
sudowhere needed. - It may take several minutes, depending on your CPU/RAM, to build Rust libs and QEMU.
- If you’re not root, it will automatically prefix
-
Once complete, confirm:
/usr/local/bin/qemu-system-x86_64 --version qemu-system-x86_64 -device help | grep -i rutabaga
You should see something like:
QEMU emulator version 8.2.0 ... virtio-gpu-rutabaga-pci virtio-gpu-rutabagaThis confirms QEMU has been successfully built with Rutabaga support.
-
Detects you are on Fedora 41 (warns if you are not).
-
Installs all host-side packages you need to run and build VMs with Wayland and Rutabaga (
qemu-kvm,virt-manager,libvirt, plus development, graphics, and Wayland libraries). -
Checks that your system QEMU (or
/usr/local/bin/qemu-system-x86_64) has Rutabaga support. -
Creates a directory structure under
~/wayland-vm/for the new VM. -
Downloads the Fedora 41 Workstation Live ISO to
~/wayland-vm/iso/fedora-41-workstation.iso(if missing). -
Creates a 20 GB qcow2 disk (
~/wayland-vm/wayland-test-vm.qcow2). -
Generates helper scripts inside
~/wayland-vm/:-
scripts/guest-autostart.sh– to be injected or copied into the Fedora guest. When executed in the guest, it waits for a running Wayland socket and then launches Foot, Gedit, Firefox automatically. -
start-wayland-vm.sh– launches QEMU with:-machine type=q35,accel=kvm -cpu host -m 4G -smp 4-virtfs local,path=~/wayland-vm/scripts, …to shareguest-autostart.shinto the guest under/mnt/hostscripts.-device virtio-gpu-rutabaga-pci,hostmem=256M,cross-domain=on,wsi=surfacelessfor hardware-accelerated graphics.- A user-mode network with SSH forwarding from host port 2222 → guest port 22.
- Audio, input (keyboard, mouse), USB tablet, and an interactive monitor.
- Boots from ISO on
--installor from disk otherwise.
-
install-helper.sh– host-side instructions that tell you how, once you’ve finished installing Fedora in the VM, to copyguest-autostart.shinto the guest’s filesystem (/usr/local/bin/guest-autostart.sh) and register a systemd unit (wayland-autostart.service) so that it runs at graphical boot. -
test-wayland.sh– verifies on the host that QEMU has Rutabaga support and that your host is running Wayland.
-
-
Initialize & Color Setup
set -eto exit on errors.- Defines color codes again for consistency (these are reused from
part1.sh).
-
Function:
check_fedora()- Reads
/etc/os-releaseand verifies “Fedora”. - Warns if
VERSION_IDis not exactly"41". - If not Fedora at all, it prints an error and exits.
- Reads
-
Function:
install_packages()-
Updates
dnfrepositories (sudo dnf update -y --skip-unavailable). -
Installs virtualization packages:
sudo dnf install -y qemu-kvm qemu-img libvirt libvirt-daemon-kvm virt-manager bridge-utils curl wget unzip rsync -
Installs development toolchain (GCC, make, CMake, Git, Meson, Ninja).
-
Installs graphics & Wayland packages:
sudo dnf install -y mesa-dri-drivers mesa-vulkan-drivers libdrm wayland-devel wayland-protocols-devel libxkbcommon weston foot gedit firefox gnome-terminal -
Enables and starts
libvirtd(sudo systemctl enable --now libvirtd). -
Adds your user to the
libvirtgroup (sudo usermod -a -G libvirt $(whoami)).
-
-
Function:
check_qemu_rutabaga()-
Tries to detect a QEMU binary at
/usr/local/bin/qemu-system-x86_64(the one built bypart1.sh). -
Falls back to
/usr/bin/qemu-system-x86_64if the custom one isn’t found. -
If neither is found, errors out.
-
Runs
$QEMU_BIN -device help | grep -q "virtio-gpu-rutabaga".- If found, confirms “QEMU has rutabaga support”.
- Otherwise, errors out, telling you to run
part1.shfirst.
-
Lists available Rutabaga devices (
qemu-system-x86_64 -device help | grep rutabaga).
-
-
Function:
setup_vm_directory()-
Creates the following directories under
$HOME/wayland-vm(default):~/wayland-vm/ ├── iso/ ├── scripts/ ├── shared/ ← (for host-guest sharing if needed) └── (VM disk and helper scripts in $HOME/wayland-vm/) -
Prints the base path:
VM directory created at: ~/wayland-vm.
-
-
Function:
download_fedora_iso()-
Checks if
~/wayland-vm/iso/fedora-41-workstation.isoalready exists. If not, runs:curl -L -o ~/wayland-vm/iso/fedora-41-workstation.iso.tmp $FEDORA_ISO_URL mv ~/wayland-vm/iso/fedora-41-workstation.iso.tmp ~/wayland-vm/iso/fedora-41-workstation.iso
-
Prints a confirmation once complete.
-
-
Function:
create_vm_disk()-
Checks if
~/wayland-vm/wayland-test-vm.qcow2already exists.-
If yes, asks interactively if you want to recreate it.
-
If no (or if you confirm recreation), runs:
qemu-img create -f qcow2 ~/wayland-vm/wayland-test-vm.qcow2 20G
-
-
-
Function:
create_guest_autostart()-
Writes
~/wayland-vm/scripts/guest-autostart.shwith content that:- Sleeps 5 s.
- Exports
XDG_RUNTIME_DIR,WAYLAND_DISPLAY,GDK_BACKEND,QT_QPA_PLATFORM,MOZ_ENABLE_WAYLAND. - Waits (up to 30 s) for the Wayland socket to appear (
/run/user/$UID/wayland-0). - Once found, launches (in background)
foot,gedit,firefox(if each is installed). - Prints status messages to stdout.
-
Marks it executable (
chmod +x ...).
-
-
Function:
create_vm_launcher()-
Writes
~/wayland-vm/start-wayland-vm.shas a self-contained QEMU launcher. Key points:-
If you pass
--install(or if the VM disk does not exist), sets-cdrom $FEDORA_ISO -boot dto boot from the Fedora Live ISO. -
Checks for a Wayland socket on the host:
if [[ -n "$WAYLAND_DISPLAY" ]] && [[ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]]; then WAYLAND_ARGS="-display gtk,gl=on" else WAYLAND_ARGS="-display gtk,gl=on" (warning about falling back to X11, though the command is the same) fi
-
Verifies
$QEMU_BINexists and has “virtio-gpu-rutabaga” support. -
Finally,
exec "$QEMU_BIN" \with:-name "$VM_NAME" -machine type=q35,accel=kvm -cpu host -m 4G -smp 4 -enable-kvm $WAYLAND_ARGS -device virtio-gpu-rutabaga-pci,hostmem=256M,cross-domain=on,wsi=surfaceless -drive file="$VM_DISK",format=qcow2,if=virtio,cache=writeback $BOOT_FROM_ISO -netdev user,id=net0,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=net0 -audiodev pa,id=audio0 -device intel-hda -device hda-duplex,audiodev=audio0 -device virtio-keyboard-pci -device virtio-mouse-pci -virtfs local,path="$VM_DIR/scripts",mount_tag=hostscripts,security_model=passthrough,id=hostscripts -rtc base=localtime -usb -device usb-tablet -monitor stdio -
The key is
-virtfs local,path=...,mount_tag=hostscripts,security_model=passthrough,id=hostscripts, which exposes~/wayland-vm/scripts/inside the guest at the mount point you choose (e.g./mnt/hostscripts).
-
-
-
Function:
create_install_helper()-
Writes
~/wayland-vm/install-helper.sh, which contains instructions to be run inside the guest once Fedora is installed:- Copy
/mnt/hostscripts/guest-autostart.sh→/usr/local/bin/guest-autostart.sh. - Make it executable.
- Create a systemd unit (
/etc/systemd/system/wayland-autostart.service) that runs it at graphical-target time. - Enable that service (
systemctl enable wayland-autostart.service). - Reboot the VM.
- Copy
-
You must open a terminal in the guest (or SSH to port 2222) to run this helper.
-
-
Function:
create_test_script()-
Creates
~/wayland-vm/test-wayland.shfor the host. It:- Checks if a QEMU process matching “wayland-test-vm” is running.
- Checks if
/usr/local/bin/qemu-system-x86_64 -device help | grep rutabagasucceeds. - Detects if
$WAYLAND_DISPLAYand$XDG_RUNTIME_DIR/$WAYLAND_DISPLAYexist on the host. - Prints a summary of what the VM should be doing.
-
Marks it executable.
-
-
Function:
create_readme()- Generates
~/wayland-vm/README.mdas a shorter VM-focused README. (You can ignore it or keep it; we are replacing it with this top-level README.)
- Generates
-
main()-
Prints a header and runs, in order:
check_fedorainstall_packagescheck_qemu_rutabagasetup_vm_directorydownload_fedora_isocreate_vm_diskcreate_guest_autostartcreate_vm_launchercreate_install_helpercreate_test_scriptcreate_readme
-
Prints “Setup Complete!” and reminds you how to proceed:
cd ~/wayland-vm./install-helper.sh./start-wayland-vm.sh --install(first-time install)./start-wayland-vm.sh(normal boot)./test-wayland.sh(verify)
-
Optionally, it will immediately prompt “Start VM installation now? (y/N)”. If you press
y, it runs./start-wayland-vm.sh --installautomatically.
-
-
Make the script executable:
chmod +x part2.sh
-
Run it (as your regular user; it will prompt for sudo where necessary):
./part2.sh
-
Follow the output. Once it finishes, you will have a directory structure under
~/wayland-vm/as described below. By default, the script will ask “Start VM installation now? (y/N):”. If you pressy, the VM boots into the Fedora Live ISO automatically. -
Inside the VM (installation phase):
-
After Fedora’s installer finishes, reboot the guest.
-
Open a terminal or use SSH (
ssh -p 2222 user@localhost— replaceuserwith the username you created during Fedora install). -
Run:
sudo ./install-helper.sh
This will:
- Copy
guest-autostart.shfrom the 9p-mounted~/wayland-vm/scripts/into/usr/local/bin/guest-autostart.shinside the guest. - Create and enable
wayland-autostart.serviceso that, on next graphical boot, the script will start Foot, Gedit, and Firefox for you.
- Copy
-
-
Next guest reboot:
- The VM will now boot from the installed disk instead of the ISO.
- On reaching the Fedora desktop (Wayland session), you should see Foot, Gedit, and Firefox launch automatically after a short delay.
-
Subsequent boots:
cd ~/wayland-vm ./start-wayland-vm.sh
– The script will detect that
wayland-test-vm.qcow2exists, skip the ISO, and boot directly from disk with hardware-accelerated Rutabaga graphics. -
Testing from the host:
cd ~/wayland-vm ./test-wayland.sh
– Verifies that:
- The VM process (
wayland-test-vm) is running. - QEMU has Rutabaga support.
- The host is running a Wayland session.
- The VM process (
Once you’ve run both scripts (part1.sh and part2.sh), you will have:
├── part1.sh
├── part2.sh
└── wayland-vm/
├── iso/
│ └── fedora-41-workstation.iso
│
├── scripts/
│ └── guest-autostart.sh
│
├── shared/ # (Empty by default; for future host-guest sharing)
│
├── wayland-test-vm.qcow2 # 20 GB qcow2 disk image
│
├── start-wayland-vm.sh # VM launcher
├── install-helper.sh # Guest instructions to enable autostart
├── test-wayland.sh # Host-side test script
└── README.md # (This file, to be replaced by your top-level README)
part1.sh(lives in your working folder, e.g.~/or wherever you put it).part2.sh(lives alongsidepart1.sh).wayland-vm/is created bypart2.sh. Inside it, all VM-related files appear as above.
Additionally, after part1.sh completes, you will have installed QEMU under /usr/local/.
- Binaries:
/usr/local/bin/qemu-system-x86_64,/usr/local/bin/qemu-img,/usr/local/bin/qemu(symlink). - Libraries:
/usr/local/lib/librutabaga_gfx.so, plus other QEMU-related libs. - Headers (optional):
/usr/local/include/rutabaga_gfx/*.h.
-
part1.shfails during build- Rust/Cargo errors: Make sure
rustcandcargoare installed (dnf install cargo rust). If you have an incompatible Rust version, you may need to update or install viarustup. - Missing dependencies: Double-check that
dnf install …never failed. Look for lines likeError: Package xxx-yyy is unavailable. - Out of disk space: Check
df -h $HOME. Building QEMU + Rutabaga can use several gigabytes.
- Rust/Cargo errors: Make sure
-
After
part1.sh,qemu-system-x86_64 -device helpdoes not listvirtio-gpu-rutabaga-
You might have
SKIP_RUTABAGA_LIB=1, which falls back to QEMU’s built-in support. -
Re-run
part1.shfrom scratch:./part1.sh
Watch carefully for any “Rutaga build failed” warnings.
-
-
part2.sherrors out with “This script is designed for Fedora 41”- Make sure
/etc/os-releasecontainsNAME="Fedora"andVERSION_ID="41". - If you are on Fedora 42 or RHEL/CentOS, you will see that warning—it will continue (with a “will try to work on version X”) but if it cannot find Fedora 41 repos, subsequent
dnf installmay fail.
- Make sure
-
Guest autostart does not run inside the VM
-
Confirm that, after Fedora’s installer, you ran
install-helper.shinside the guest (via a terminal or SSH). -
Inside the guest, check:
systemctl status wayland-autostart.service journalctl -u wayland-autostart.service ls -l /usr/local/bin/guest-autostart.sh
-
Ensure
/mnt/hostscripts/guest-autostart.shactually exists (the 9p mount must be active when the VM is running). If not, checkstart-wayland-vm.shfor the correct-virtfsline.
-
-
Foot/Gedit/Firefox fail to launch inside guest
-
Make sure you installed them via
install-helper.shor manually:sudo dnf install -y foot gedit firefox
-
Check that
/usr/local/bin/guest-autostart.shhas execute permission (chmod +x). -
Manually run
/usr/local/bin/guest-autostart.shinside the guest to see any errors.
-
-
VM window shows a blank screen or black display
-
On the host, verify you have a GPU driver loaded with KMS and that you are running Wayland (e.g. Fedora’s default Gnome Wayland).
-
Run on the host:
echo $WAYLAND_DISPLAY ls -l $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY
If those files don’t exist, confirm you are in a Wayland session (not X11).
-
In
start-wayland-vm.sh, you can force X11 by removing-display gtk,gl=onand substituting-display sdl,gl=onor-display cocoa,gl=on(depending on platform).
-
-
SSH to guest (port 2222) does not work
- Ensure
-netdev user,id=net0,hostfwd=tcp::2222-:22is present. - Inside the guest, check
sudo dnf install -y openssh-server && sudo systemctl enable --now sshd. - Verify Fedora’s firewall (e.g.
sudo firewall-cmd --add-service=ssh --permanent && sudo firewall-cmd --reload) or disable it temporarily (sudo systemctl disable --now firewalld) to allow port 22.
- Ensure
-
Performance is slow / high CPU usage
-
Confirm KVM acceleration is working:
lsmod | grep kvm -
Confirm QEMU is using
-machine type=q35,accel=kvm -cpu host. If not, add-enable-kvmexplicitly. -
You can reduce VM RAM (e.g.
-m 2G) or CPUs (-smp 2) instart-wayland-vm.shif your host is constrained. -
For graphics, check that your host GPU drivers (Mesa/Radeon/Intel) support kms and that you’re running a current kernel.
-
-
Change VM Disk Size or Location
- Edit
VM_DISK_SIZE="20G"orVM_DIR="$HOME/wayland-vm"at the top ofpart2.shbefore running. - You can place the VM directory on any mount point (e.g. an external SSD) by changing
VM_DIR.
- Edit
-
Adjust VM Memory/CPU
-
In
part2.sh, modifyVM_RAM="4G"orVM_CPUS="4". -
In the generated
start-wayland-vm.sh, these values appear under:-m 4G -smp 4
-
After first run, you can also edit
start-wayland-vm.shdirectly to set custom memory/CPU.
-
-
Use a Different Guest Distribution
- Replace
FEDORA_ISO_URLwith the URL for your chosen distro’s Live ISO. - Update
PATHto the ISO accordingly. - Modify
install-helper.shinstructions to match that distro’s package manager (e.g.,aptfor Ubuntu). - Ensure any Wayland apps you want to auto-start are available in that distro’s repo.
- Replace
-
Share Host-Guest Files
-
The
-virtfsline instart-wayland-vm.shexposes the host’s~/wayland-vm/scriptsunder themount_tag=hostscripts. -
Inside the guest, you can mount it at boot by adding to
/etc/fstab(on the installed VM):hostscripts /mnt/hostscripts 9p trans=virtio,version=9p2000.L,rw,_netdev 0 0 -
This lets you edit scripts on the host and have them immediately visible in the guest.
-
-
Switch to virtio-fs (if your Fedora kernel supports it)
-
Replace the
-virtfs local,…line with:-virtio-fs /home/$USER/wayland-vm/scripts,mount_tag=hostscriptsand inside the guest:
sudo mkdir -p /mnt/hostscripts sudo mount -t virtiofs hostscripts /mnt/hostscripts
-
-
Enable SPICE with virtio-gpu
-
In
start-wayland-vm.sh, you could add:-spice port=5930,disable-ticketing,gl=on -device virtio-gpu-pci,virgl=onin place of the Rutabaga line if you prefer a SPICE window instead of GTK.
-
-
Automate Guest Customization (virt-customize / cloud-init)
-
Instead of asking the user to run
install-helper.shmanually inside the guest, you can:-
Install
libguestfs-toolson the host. -
After creating
wayland-test-vm.qcow2, run:sudo virt-customize -a wayland-test-vm.qcow2 \ --copy-in scripts/guest-autostart.sh:/usr/local/bin/guest-autostart.sh \ --run-command 'chmod +x /usr/local/bin/guest-autostart.sh' \ --run-command 'cat << "EOF" > /etc/systemd/system/wayland-autostart.service [Unit] Description=Run Guest Wayland Autostart After=graphical.target [Service] Type=simple ExecStart=/usr/local/bin/guest-autostart.sh [Install] WantedBy=graphical.target EOF' \ --run-command 'systemctl enable wayland-autostart.service'
-
Then your VM is pre-injected with the autostart files before it ever boots.
-
-
-
part1.shbuilds a custom QEMU withvirtio-gpu-rutabagafrom scratch. -
part2.shuses that custom QEMU to create a Fedora 41 VM that boots with hardware-accelerated Wayland graphics. -
You end up with a self-contained workflow:
- Run
part1.sh→ compile/install QEMU + Rutabaga. - Run
part2.sh→ install prerequisites + generate VM files. - Boot VM (
start-wayland-vm.sh --install), install Fedora guest. - Inside guest, run
install-helper.sh→ copyguest-autostart.sh, enable systemd service. - Reboot guest → Foot, Gedit, Firefox launch automatically under Wayland.
- From now on,
start-wayland-vm.shalways resumes the installed guest with accelerated graphics.
- Run
At this point, you have reproduced Chromium OS–style hardware-accelerated Wayland via virtio-gpu-rutabaga on a “normal” Linux distribution (Fedora 41). All steps are fully scripted in Bash, require only Fedora’s official repositories plus direct compilation of Rutabaga and QEMU, and do not depend on libvirt or virt-manager (though those packages are installed for convenience).
Feel free to refer back to this README whenever you need to understand or customize any part of the build or VM setup. Enjoy your accelerated Wayland VM! [email protected]