MPV + FFmpeg

MPV 0.32

MPV (license GPLv2, https://github.com/mpv-player) is the first video player with Vulkan support since 0.28. Wayland is supported by default since 0.29.

pacman -Sy mpv

To use Vulkan, you need to run MPV with or modify the start menu entry:

mpv --gpu-api=vulkan --player-operation-mode=pseudo-gui -- %U

At least on Plasma Wayland mpv 0.30 works fine with Vulkan in a Wayland window.

AV1

The AV1(BSD Clause 2, https://aomedia.googlesource.com) media codec has been officially released royalty-free by the Open Media Alliance (https://aomedia.org) on 2018-03-28 with broad support from all the major internet companies, read https://www.phoronix.com/scan.php?page=news_item&px=AV1-Released. On 2018-06-26 the version 1.0 has been released. AV1 claims to offer 30% better compression at 4K then the other media codec’s like VP9.

AV1 Decoding

  • DAV1D 0.1 (license BSD, https://code.videolan.org/videolan/dav1d) is a AV1 decoder from the VLC and ffmpeg communities. The decoding speed has been improved drastically in the last time.
  • FFmpeg 4.2 supports AV1 via DAV1D. FFmpeg added in August 2019 the AMD advanced media framework (AMF) which is based on Vulkan initialization. With 4.3 Vulkan support should be in good shape.

Wayland

Wayland (license MIT, https://gitlab.freedesktop.org/wayland) is the new standard display protocol and consist of the following components:

  • Wayland 1.18 as the display server protocol itself
  • Wayland-Protocols 1.18 extended Wayland protocols
  • Weston 8.0 is the optional reference compositor (not required if you use e.g. Kwin)
  • XWayland 1.20.8 to run legacy X11 only apps in a Wayland environment

Wayland replaces the legacy X11 display and graphic implementation. Wayland is designed as just a protocol and with security in mind. A Wayland application cannot see the content and input devices of another window or of the screen as long as it is not explicitly granted by the compositor. This restricts key loggers and screen monitoring software that could be easily implemented in X11 without permission requests, in fact it was designed like this, any X11 application can read all input and screen content at any time. Wayland is usually installed automatically by distributions. The main Wayland compositors are Kwin from KDE Plasma and Mutter from Gnome.

Toolkits with proper Wayland support are

  • Qt5
  • Gtk3
  • SDL2 + SDL12-compat
  • Clutter
  • EFL
  • GLFW
  • Electron 2.0 will support Gtk3, not yet released.

For more details read https://wiki.archlinux.org/index.php/Wayland#GUI_libraries

Bugs

libinput 1.14

Since some time the libinput is the main driver dealing with all input devices like a mouse, touchpad or touchscreen. For more details read https://wiki.archlinux.org/index.php/Libinput. Libinput is used by Wayland and Xorg and many distributions are in the process to switch over. Except for some corner cases the other drivers are not required.

Check and remove from Arch Linux installs all xf86-input-* drivers except for xf86-input-libinput (required for X11), press 2 times the TAB key to see which package is still installed. Example:

pacman -Rsc xf86-input-synaptics

You may want to clean and remove some config files like:

rm -R /etc/X11/xorg.conf.d/50-synaptics.conf

Pipewire

Pipewire (license LGPL, https://pipewire.org) is a new multimedia framework to replace in the long run JACK and PulseAudio. It was developed mainly with Video routing similar like PulseAudio but with security, Wayland and Flatpak in mind.

Remove legacy tool-kits without Wayland support

Qt4 has been removed successful from Arch Linux.

Gtk2

Gtk2 doesn’t support Wayland, so try to remove it. To see which Gtk2 applications need to be removed or replaced with an alternative, try to remove Gtk2:

 pacman -R gtk2

Add alternatives like KDE Partition Manager.

pacman -Sy partitionmanager

Then remove applications with:

pacman -Rsc gparted

The steam package got rid of this legacy dependency in May 2020.

Python2

Python2 doesn’t support Wayland, so try to remove it, but still several applications make use of it as the transition to Python 3 is not finished yet. To see which Python2 applications need to be removed or replaced with an alternative, try to remove Python2:

pacman -R python2

The issue is that still several software depends from this old toolkit like kodi, getmail, calibre, …

At least some can be removed like the following examples:

pacman -Rsc bzr phantomjs urlgrabber

Some software that doesn’t depend anymore from python2 in Arch Linux (Status: https://www.archlinux.org/todo/die-python2-die/ and https://www.archlinux.org/todo/conversion-of-programs-that-use-python-2-to-python-3/): libvirt, ceph, samba.

SDL1.2

SDL1 doesn’t support Wayland, removing it might break several old games. It is out of maintenance as well.

So hopefully these games get updated soon to SDL2 or will use SDL12-compat. Applications with experimental SDL2 support:

  • dosbox -> dosbox-sdl2 (AUR), but sdl_sound-hg requires still SDL1 as a package dependency

Applications depending from SDL1:

  • steam-native-runtime
  • sdl_sound-hg

SDL12-compat (https://hg.libsdl.org/sdl12-compat) is a library in development as a drop-in replacement for the legacy SDL1.2 that translated everything to SDL2, read https://www.gamingonlinux.com/articles/ryan-gordon-is-re-working-sdl12-compat-a-tool-to-provide-sdl2-to-software-using-sdl12.13744. This offers all the nice features of SDL2 including Wayland support.

yay sdl2_compat12-git
yay lib32-sdl2_compat12-git

Wayland Misconceptions?

Interesting read https://drewdevault.com/2019/02/10/Wayland-misconceptions-debunked.html

Closed Bugs

SDDM 0.18.1 (Wayland Bug)

SDDM (https://github.com/sddm/sddm) is a desktop login manager. In Arch Linux you can install and enable it with the following commands:

sudo pacman -Sy sddm
sudo systemctl enable sddm

Disable any other login manager, then reboot and then you can use SDDM.

Sadly as of version 0.18, SDDM still lacks proper Wayland support in 2020, it is not even available for testing, even though the activity has been started long time ago. SDDM is released infrequent from time to time.

SDDM’s default theme is ugly, so change it to the breeze after installing KDE Plasma via the system settings.

Autologin

sudo nano /etc/sddm.conf.d/autologin.conf

or

sudo nano /etc/sddm.conf
[Autologin]
User=john
Session=plasma.desktop

SDDM-Git

If you have this issues with the stable release or you want to test the development version, you can always try the SDDM-git development code:

yay sddm-git

If SDDM fails to start and you have a black screen, often there is an issue with the graphic driver. Read X.org.log for details.

Bugs

Closed Bugs

  • Very small mouse cursor on 4K screens, it doesn’t scale.

Alternative

If you need a true Wayland display manager or if SDDM refuse to work at all, you can try GDM. Unfortunately it enforces most of the gnome-session as a dependency.

Games – OpenGL OpenSource

There are plenty of games available as free/libre and open source software (FLOSS) for GNU/Linux, thanks to a lot of effort by the community. To get a more complete overview read https://en.wikipedia.org/wiki/List_of_open-source_video_games or https://www.gamingonlinux.com/wiki/Open_Source_Games.

Wayland

0ad

Oad is one of the great examples of open source games. If you add the prefix SDL_VIDEODRIVER=wayland to the start parameter then it will work natively in Wayland. So far it doesn’t auto detect Wayland (bug).

pacman -S 0ad

Screenshot_20170413_150059

Flare

Flare (license BSD, http://flarerpg.org, https://dorkster.itch.io/flare) has released the version 1.0 on 2018-03-30 after it was in development for many years with a campaign mode. It does run via Wayland if you add the prefix SDL_VIDEODRIVER=wayland. So far it doesn’t auto detect Wayland (bug). Flare is available as well on itch.io.

  • .config/flare/settings.txt
    • mouse_move=1 (experimental, doesn’t work well if the enemy walks away then the character continues to fight instead of following the enemy)
Flare

Neverball & Neverputt

pacman -Sy neverball

If you add the prefix SDL_VIDEODRIVER=wayland to the start parameter then it will work natively in Wayland. So far it doesn’t auto detect Wayland (bug).

neverball

SuperTux

Supertux. If you add the prefix SDL_VIDEODRIVER=wayland to the start parameter then it will work natively in Wayland. So far it doesn’t auto detect Wayland (bug).

pacman -Sy supertux

Supertux2

XWayland (X11)

Several open source games do not work yet on Wayland, even if enforcing it e.g. via SDL (SDL_VIDEODRIVER=wayland GAMENAME).

Astromenace

Astromenance (GPLv3)

Communist Dogifest

Communist Dogifest (license GPLv3, https://gitlab.com/joshuagiles/TheCommunistDogifesto) is a 3D game with blocky graphics. You can buy it on itch.io and Steam.

Ebony Spire: Heresy

Ebony Spire: Heresy (license MIT) provides the source code and it is based on OpenGL 4.4. You can buy the game on Steam.

Endless Sky

Endless Sky (license GPLv3, https://endless-sky.github.io, https://github.com/endless-sky/endless-sky) is a 2D space game provides as free and open source software. You can install it via Steam.

FlightGear

FlightGear is a flight simulator and it can be installed from AUR or via flatpak.

First install:

yay flightgear-data

And only then:

yay flightgear

Frogatto

Frogatto (license Zlib/CC-BY, https://frogatto.com, https://github.com/frogatto/frogatto) doesn’t work on Wayland so far (bug).

pacman -S frogatto
Screenshot_20170413_144534

Yorg

Yorg (license GPLv3, http://www.ya2.it, https://github.com/cflavio/yorg) is a free and open source racing game. It is as well on Itch.io.

OpenTTD

OpenTTD is like the transport tycoon game. OpenTTD doesn’t work on Wayland (bug).

pacman -Sy openttd openttd-opengfx openttd-opensfx
openttd

Pioneer

Pioneer (GPLv3)

Red Exclipse 2

Red Exclipse 2 (license , https://www.redeclipse.net

Ryzom

Ryzom (AGPLv3, https://ryzom.com)

You can install the game from AUR. To install all game files run:

ryzom_client_patcher

After downloading all files, you start the game with:

ryzom_client_patcher

You need to create a login to play the game.

Seven Kingdoms Ancient Adversaries

Seven Kingdoms Ancient Adversaries (license GPLv2, https://github.com/the3dfxdude/7kaa) is a classic strategy game that has been released as open source. It supports 64bit and SDL 2.0.8. Build instructions can be found here https://www.7kfans.com/wiki/index.php/Building_From_Source.

Star Ruler II

Star Ruler II (license MIT, https://github.com/BlindMindStudios/StarRuler2-Source) has been released on 2018-07-24 as open source. It includes even the assets except the music. You can compile or buy it on GOG or Steam.

https://www.gog.com/game/star_ruler_2

Superstarfigher

Superstarfighter (license MIT) is available on itch.io. It has been developed with the Godot Engine.

SuperTuxKart

SuperTuxKart (license GPLv3, https://github.com/supertuxkart/stk-code) doesn’t work yet natively on Wayland, at least on Plasma-Wayland it shows  (bug). The game is as well available on itch.io.

pacman -S supertuxkart
Screenshot_20170413_145343

The Dark Mod

The Dark Mod (GPLv3) is a game in the style of The Thief.

Verloren

Verloren (license GPLv3, https://gitlab.com/veloren/veloren, https://veloren.net) is a Minecraft like game writte in RUST. It is playable but still in early stages.

Widelands

Widelands (https://widelands.org) is inspired by the old Settlers game.

Warzone 2100

Warzone 2100 (license GPLv2, https://github.com/Warzone2100/warzone2100, http://wz2100.net) is a real time strategy game that has been released as free and open source in 2004.

First Person Shooters (FPS)

Other Games

  • Lincity
    • yay lincity-ng
    • To play the game, I had to create a empty folder “.lincity-ng”. Otherwise the game didn’t start as it just tried to create a file with this name.
  • Battle for Wesnoth (license GPLv2, https://www.wesnoth.org, https://github.com/wesnoth/wesnoth) is available for Download or on Steam. The game port to the open source game engine Godot is in progress.
  • Extremetuxracer
  • Frozen-bubble
  • Yofrankie
  • speed-dreams
  • stuntrally
  • vdrift

Kodi 18.7

Kodi (license GPLv2+, https://kodi.tv, https://github.com/xbmc) is probably the best media center and it runs on desktop, notebook and mobile clients (like Android). To install it on Arch Linux run:

pacman -Sy kodi libnfs

Kodi did have a Wayland back-end years back, but it has been abandoned after lacking support and maintenance. Now a GSOC student did revive the Wayland backend (https://github.com/pkerling/xbmc) and it got merged to Kodi mainline (available since Kodi 18), see pull request https://github.com/xbmc/xbmc/pull/12664. Especially on slow media center devices Kodi should offer on Wayland smoother animations and video playback.

Kodi-Wayland

In ArchLinux you can install kodi-wayland.

sudo pacman -Sy kodi-wayland

Alternatively you can enable in Kodi-Git Wayland support, it is only available if you compile it specifically for Wayland as it is not yet a run-time switch like in almost all other applications. Make sure Wayland works on your desktop, read KDE Plasma-Wayland.

Then make sure Wayland-protocols are installed.

sudo pacman -Sy wayland-protocols

Install from AUR Waylandpp.

yay waylandpp-git

Now install Kodi-git form AUR (https://aur.archlinux.org/pkgbase/kodi-git/#comment-609300):

yay kodi-git

When you are asked if you want to edit the PKGBUILD, confirm with YES and add 2 new lines (written in bold):

build() {
 cd "$_gitname"
 cmake -DCMAKE_INSTALL_PREFIX=/usr \
   -DCMAKE_INSTALL_LIBDIR=/usr/lib \
   -DENABLE_EVENTCLIENTS=ON \
   -DLIRC_DEVICE=/run/lirc/lircd \
   -DENABLE_INTERNAL_FFMPEG="no" \
   -DWITH_FFMPEG="yes" \
   -DCORE_PLATFORM_NAME=wayland \
   -DWAYLAND_RENDER_SYSTEM=gl \
 .
 make VERBOSE=1
 make preinstall
} 

Kodi-git on Wayland is running very stable. Not sure, if it is possible to build Kodi for Wayland and X11 like most of the other software packages.

Probably there is soon a own package in AUR to make it even more convenient.

Autostart

There are 3 possibilities to autostart:

  • Add e.g. to the KDE Desktop Plasma an auto start application in systemsettings
  • Enable e.g. in SDDM the kodi.desktop and auto login, read SDDM (Wayland Dev)
  • Direct boot to kodi, disable login managers like SDDM and enable the kodi.service (doesn’t work for Wayland yet)

Addons

  • Media Sources
    • Missing Movies
      • Shows you the movies and series with a wrong file name, that cannot be scrapped and added to the library.
  • Script
    • Library Auto Update
      • Automatically updates regularly your library

Exclude Files

 $ nano /home/USERNAME/.kodi/userdata/advancedsettings.xml<advancedsettings>
   <pictureextensions>
     <remove>.nef</remove>
   </pictureextensions>
 </advancedsettings>

Buffer/Caching of Network content

$ nano /home/USERNAME/.kodi/userdata/advancedsettings.xml 
 <advancedsettings>
   <network>
   <!--- The three settings will go in this space, between the two network tags. --->
     <buffermode>0</buffermode>
     <cachemembuffersize>500971520</cachemembuffersize>
     <readbufferfactor>4</readbufferfactor>
   </network>
   <cache>
     <memorysize>500971520</memorysize>
     <buffermode>0</buffermode>
     <readfactor>4.0</readfactor>
   </cache>
 </advancedsettings>

Library Update in Console

Via the webserver component of Kodi you can trigger library updates.

Clean Library in Terminal

$ curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Clean", "id": "mybash"}' -H 'content-type: application/json;' http://<User>:<Password>@<hostname>:<port>/jsonrpc

Update Library in Terminal

$ curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://<User>:<Password>@<hostname>:<port>/jsonrpc

Gaming +MangoHud +GameMode

Linux gaming is growing steadily with a lot of high quality titles. With more games the need for tools and helpers is increasing, luckily there are great applications already.

MangoHud + FPS limiter

MangoHud (license MIT, https://github.com/flightlessmango/MangoHud) is a HUD for Vulkan and OpenGL. On Vulkan it will show as well if the game runs on DXVK.

Since MangoHud 0.3.5 it will show the GPU and driver name. Plus it shows if the application is 64bit or still legacy 32bit.

Bugs:

  • Wayland support missing
  • Doesn’t work yet if the game uses a launch script

Config file example:

--COPY FROM /usr/share/doc/mangohud/MangoHud.conf.example
MangoHud configuration file
Uncomment any options you wish to enable. Default options are left uncommented
Use some_parameter=0 to disable a parameter (only works with on/off parameters)
Everything below can be used / overridden with the environment variable MANGOHUD_CONFIG instead
########## PERFORMANCE
Limit the application FPS
fps_limit=
VSYNC [0-3] 0 = adaptive; 1 = off; 2 = mailbox; 3 = on
vsync=3
OpenGL VSYNC [0-N] 0 = off; >=1 = wait for N v-blanks, N > 1 acts as a fps limiter (fps = display refresh rate / N)
gl_vsync=1
############# VISUAL
Display the current CPU information
cpu_stats
cpu_temp
Display the current GPU information
gpu_stats
gpu_temp
gpu_core_clock
gpu_mem_clock
Display loaded MangoHud architecture
arch
Display the frametime line graph
frame_timing
Display the current system time
time
Time formatting examples
time_format = %H:%M
time_format = [ %T %F ]
time_format = %X # locally formatted time, because of limited glyph range, missing characters may show as '?' (e.g. japanese)
Change the hud font size (default is 24)
font_size=24
Change the hud position (default is top-left)
+rf left
position=top-left
Display the current CPU load & frequency for each core
core_load
IO read and write for the app (not system)
io_read
io_write
Display system ram / vram usage
ram
vram
Disable / hide the hud by deafult
no_display
Hud position offset
offset_x=0
offset_y=20
Hud dimensions
width=
height=
Hud transparency / alpha
+rf 0.5
background_alpha=0.0
alpha=
Color customization
text_color=FFFFFF
gpu_color=2E9762
cpu_color=2E97CB
vram_color=AD64C1
ram_color=C26693
engine_color=EB5B5B
io_color=A491D3
frametime_color=00FF00
background_color=020202
Change default font (set location to .TTF/.OTF file )
font_file
Crosshair overlay (default size is 30)
crosshair
crosshair_size=15
#RRGGBB=Black
crosshair_color=00FF00
Show Spotify metadata
media_player
Specify gpu with pci bus id for amdgpu and NVML stats.
Set to 'domain:bus:slot.function'
pci_dev = 0:0a:0.0
############ INTERACTION
Change toggle keybinds for the hud & logging
toggle_hud=F12
toggle_logging=F2
reload_cfg=F4
############ LOG
Set amount of time in second that the logging will run for
log_duration
Define name and location of the output file (Required for logging)
output_file

GameMode 1.2

Gamemode (license BSD, https://github.com/FeralInteractive/gamemode) has been released by Feral as a library and daemon (based on systemd) to enable game optimizations automatically like the CPU governor “performance” when a game is started and to deactivate them as soon as the game stops. You can install it from AUR

yay gamemode
yay lib32-gamemode

Once you’ve installed gamemode, you can then tell any game to use it by doing this command:

gamemoderun./game

You can also add it as a Steam launch option for each of your games like this

gamemoderun %command%

If you wish to know what current CPU governor is in use, you can run this command in terminal:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

You probably need to enable and start the gamemoded daemon:

systemctl --user enable gamemoded systemctl --user start gamemoded

Global Environment Variables

sudo nano /etc/environment

## Wayland
# Firefox Wayland
export MOZ_ENABLE_WAYLAND=1
# SDL Wayland
#export SDL_VIDEODRIVER=wayland

### Firefox
# Plasma integration 
export GTK_USE_PORTAL=1 
# Firefox Touchscreen support
export MOZ_USE_XINPUT2=1

### Vulkan (default RADV for AMD if nothing is set) ###
# Enable ACO instead of LLVM compiler in RADV
export RADV_PERFTEST=aco
# RADV
#export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json
# AMDVLK
#export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/amd_icd64.json
# AMDVLK-Pro (thanks, TK-Glitch)
#export VK_ICD_FILENAMES=/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd64.json
# AMDVLK Experimental Features
#export AMDVLK_ENABLE_DEVELOPING_EXT="all"

### OpenGL
# Prefer new Intel Iris Gallium driver instead of classic one
### INTEL
#export MESA_LOADER_DRIVER_OVERRIDE=iris
### AMDGPU/MESA Tuning ###
# AMD Debug options
export radeonsi_enable_nir=true

### Wine Variables ###
# Wine Esync
#export WINEESYNC=1
# Wine PBA
#export PBA_ENABLE=1
# DXVK Async
#export DXVK_ASYNC=1

# HUD
# GALLIUM (AMD, Iris) *Only for testing, do not use if your desktop is using OpenGL acceleration*
# export GALLIUM_HUD=simple,cpu,GPU-load,temperature,fps
# Vulkan Overlay doesn't work as an environment variable
#export VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay
#export VK_LAYER_MESA_OVERLAY_CONFIG=submit,draw,pipeline_graphics,position=top-right
# MangHud Vulkan only
MANGOHUD=1
# Wine/Proton DXVK
export DXVK_HUD=devinfo,api

Game Manager

GameHub

GameHub (license GPLv3, https://tkashkin.tk/projects/gamehub, https://github.com/tkashkin/GameHub) is a new Game Manager that allows you to sync Steam (including multiple Steam accounts if Family sharing is active), GOG and even HumbleBundle library. It works great on Wayland. Install it from AUR:

yay gamehub

GameHub scales nicely even on 4k screen and if offers many functions that are missing in Lutris.

Lutris

With Lutris (license GPLv3, https://lutris.net, https://github.com/lutris/lutris) you can manage your game library of locally installed Linux games, Steam and Wine in one overview. Lutris runs natively on Wayland, it is based on Gtk 3.

sudo pacman -Sy lutris python-pyinotify

On the website of Lutris you can create an account and link this to your steam account to automate library sync with Steam.

So far lutris is far away from providing an easy overview about all games. It doesn’t manage multiple Steam accounts, it doesn’t even show all installed games of your Steam account and it doesn’t show all not installed games. Bug https://github.com/lutris/lutris/issues/757.

GOG support has been added in 5.0, but no HumbleBundle support so far. But the new version doesn’t work anymore in any window manager except Gnome (bug). Lutris doesn’t scale well on 4k screens in Plasma Wayland.

DOSBox

DOSBox offers the possibility to run old DOS applications and games on Linux.  These retro games offers still a lot of fun.

Bug: DOSBox doesn’t support Wayland yet as it still/sadly depends from SDL1.2, it runs only trough XWayland. But there is a workaround in AUR, install instead of the normal dosbox package with this command:

yay dosbox-sdl2

To enable Wayland, add a environement variable:

SDL_VIDEODRIVER=wayland dosbox

You can find plenty of games on Archive.org, they even run often in a normal webbrowser:

https://archive.org/details/softwarelibrary_msdos_games

Creating a config file for DOSBox is described here:

http://www.dosbox.com/wiki/Dosbox.conf

KDE Plasma-Mobile (Bugs)

Plasma-Mobile is created by the KDE community to run on mobile phones by using bleeding edge technology like Wayland. It is based on Qt, Kwin and other great KDE technology for details read https://plasma-mobile.org/overview. As a base layer they use Ubuntu Mobile and a layer to Android drivers.

As I have a spare Nexus 5 still around I followed the instructions on https://plasma-mobile.org/nexus-5 to install Plasma-Mobile. Usually I would note the installation steps, but the short manual is really great and it worked well. As a preparation I only had to install Android tools:

pacman -Sy android-tools

I tried using instead of neon the arch platform, I was not sure about the difference as there is no further explanation. But I guess one is a Linux LXC container of Neon based on Ubuntu and the other Arch Linux. The arch based one was recently updated, but the installation script didn’t work, the phone was stuck in the boot screen with the Google logo for ages. But neon worked and started successful.

To update to a new testing release you probably have to wipe the phone by following the same instructions again, at least I’m not aware about a upgrade path.

Obviously there are a lot of bugs in Plasma-Mobile and is not really usable, but it is a good tech demo and I really hope to see more from the KDE Plasma-Mobile community! Actually the interface scales often quite bad, the phone or some apps can crash, the camera doesn’t work, the battery icon is not selecting the right battery, Firefox looks like a desktop app, …

Plasma-Mobile in a VM

For details how to run Plasma-Mobile inside of a virtual machine in Qemu read http://blog.bshah.in/2017/11/23/emulate-plasma-mobile. You can download a prebuild image from http://blog.bshah.in/2018/01/26/trying-out-plasma-mobile.

libvirt – KVM Qemu

Libvirt (license LGPL, https://libvirt.org) is one of the best and most flexible virtual machine environments. A graphic frontend for libvirt is the tool Virt-Manager. It can manage your virtual machines e.g. on a KVM/qemu server.

Interestingly there is a 3D driver in development called VirGL, it will use the host GPU and is not a complete GPU pass-trough.

libvirt

Based on https://wiki.archlinux.org/index.php/Libvirt you need to do the following base setup to get libvirt up and running on a host machine.

$ sudo pacman -Sy libvirt qemu dnsmasq ebtables bridge-utils openbsd-netcat qemu-block-gluster

As defined in /etc/libvirt/qemu.conf and /etc/libvirt/libvirtd.conf defaults to nobody, libvirt and kvm, replace USERNAME with your user.

$ sudo gpasswd -a USERNAME libvirt
$ sudo gpasswd -a nobody kvm

Then uncomment or comment the following lines in libvirtd.conf like in the example below.

$ sudo nano /etc/libvirt/libvirtd.conf
 unix_sock_group = "libvirt"
 unix_sock_ro_perms = "0770"
 unix_sock_rw_perms = "0770"
 auth_unix_ro = "none"
 auth_unix_rw = "none"
 #listen_tls = 0
 #listen_tcp = 1
 #auth_tcp=none
$ sudo nano /etc/conf.d/libvirtd
LIBVIRTD_ARGS=""
$ systemctl enable libvirtd.service
$ systemctl start libvirtd.service

Then reboot or logout and login again.

Host and VM direct network

Read Bridge Network – Connect Host with VM

Libvirt on Btrfs

Before creating a new virtual machine, make sure to disable the copy on write feature on a Btrfs file system so that it behaves like a traditional file system and directly modifies files without creating a copy first:

sudo chattr +C -R /var/lib/libvirt/images

If files are created in that directory already, move them to first to another directory and then copy them again into this folder so that they get the +C added as well. you can see the actual attributes with this command:

sudo lsattr /var/lib/libvirt/images

Virt-Manager

Virt-Manager (license GPLv3+, https://virt-manager.org) is a good tool to manage local and remote virtual machines on a Qemu/KVM on libvirt.

sudo pacman -Sy virt-manager

If you have issues on KDE with ksshaskpass remembering passwords, run:

sudo ln -s /usr/bin/ksshaskpass /usr/lib/ssh/ssh-askpass

Virt-Manager runs directly on Wayland.

Sadly Qt-Virt-Manager (https://github.com/F1ash/qt-virt-manager, GPLv2) development seems to be stalled, so there is no usable Qt version available. If you want, you can install it from AUR for testing. It runs natively on Wayland:

yay qt-virt-manager

It works, but the qt5-remote–viewer doesn’t show any content, see bug https://github.com/F1ash/qt-virt-manager/issues/25.

Virt-Manager Unknown Disk Format

If you create in Virt-Manager a pool and it doesn’t work as of unknown format, then do it via the console. Example:

sudo virsh pool-define-as sdf disk - - /dev/sdf - /dev

Check, edit and compare to other pools, e.g. make sure the format type is gpt.

sudo virsh pool-edit sdf

Then you can start the partition in Virt-Manager and you can enable auto start if you want.

Serial Console

https://unix.stackexchange.com/questions/346090/disable-framebuffer-in-qemu-guests#347751

Cockpit

Additionally to Virt-Manager you can use Cockpit to manage virtual machines, read Cockpit – Server Monitoring & Management.

Qemu 4.1

Qemu 2.12 deprecated GTK2 and SDL1 in favor of GTK3 and SDL2.

To use UEFI boot you must define it before creating the new virtual machine. Click on “Edit configuration before installation” and then select in the field firmware “”.

OVMF

OVMF is the Tianocore open source UEFI firmware for qemu. It allows you to replace the grub with systemd-boot. At the boot you should see then the white Tianocore logo indicating UEFI support. As always, booting with UEFI is slower, the Tianocore needs 3 seconds for initialization, Linux needs less time to boot to a console.

$ sudo pacman -Sy ovmf
$ sudo nano /etc/libvirt/qemu.conf 
nvram = [ "/usr/share/ovmf/x64/OVMF_CODE.fd:/usr/share/ovmf/x64/OVMF_VARS.fd" ]

Skip Bootloader

https://wiki.archlinux.org/index.php/QEMU#By_specifying_kernel_and_initrd_manually

Cloned VM

If you have cloned a virtual machine (or copied the image), the following steps are recommended to get a unique system:

  • Change hostname in /etc/hostname
  • Check /etc/fstab for not existing or changed devices
  • Check /etc/crypttab
  • Check with ip a if your new machine uses IPv6, if yes make sure that the locally assigned IP address is unique on your local network. I got some /128 noprefixroute duplicate addresses, this can be fixed by assigning a new machine id:
rm -f /etc/machine-id
dbus-uuidgen --ensure=/etc/machine-id
rm /var/lib/dbus/machine-id
dbus-uuidgen --ensure

For more details read: https://unix.stackexchange.com/questions/402999/it-is-ok-to-change-etc-machine-id

Video, Media & Music

Video

VLC 3.0

VLC is a really good multi-platform media player. The actual release 3.0 offers initial Wayland support. You can compile VLC-git from AUR in Arch Linux.

sudo pacman -Sy vlc

If VLC is still playing videos via X11 unless you launch VLC with the following command or modify your entry in the start menu/desktop symbol:

vlc --no-embedded-video --started-from-file %U

This will run the video in a separate window and the VLC window are together with the controls in another one. With this Wayland is supported natively, only the keyboard shortcuts do not work (bug). But this is acceptable as long as you can run it in Wayland. VLC on Wayland is not yet stable like the X11 version and you might see some crashes from time to time. VLC 4.0 should finally close the last Wayland issues.

Kdenlive

Kdenlive (https://kdenlive.org) is a video editor and it can convert and encode videos into other or compressed formats. It works well on Wayland.

sudo pacman -Sy kdenlive frei0r-plugins

Codecs

AV1

AV1 Decoding

AV1 Encoding

Music Player

There are many music player’s out there, but most of them are neither nice looking nor simple to use and have limited functionalities. If you focus on KDE/Qt music player’s, then the selection is quite limited.

Elisa 0.4

Elisa is music player and it can be installed in Arch Linux directly:

sudo pacman -Sy elisa

Elisa works well on Wayland. Elisa still is in an experimental stage as of issues with missing covers and cover icons cannot be resized.

vvave (Babe)

My actual favorite is babe (https://vvave.kde.org). This player looks nice and clean, very promising, unfortunately the development slowed down in the last months and the library is quite bad designed. In Arch Linux you can install it with (the old version is still available as babe or babe-git):

yay vvave-git

Babe works well on Wayland, except for some crashes as of library scans.

Youtube Download

ClipGrab allows you to download YouTube videos and music. It works well on Wayland and is based on Qt5.

sudo pacman -Sy clipgrab