Kodi on Arch Linux can be installed to run on a Desktop just like XBMC. It can also run without a Desktop environment with a help of a kodi-standalone-service package. Make sure to configure audio and especially video drivers before proceeding or it may fail to run.
Install with pacman.
sudo pacman -S kodi
Install the standalone service.
packer -S kodi-standalone-service
Optionally install Add-Ons for PVR functionality.
sudo pacman -S kodi-pvr-addons
Set the ownership on the installation directory.
sudo chown -R kodi:kodi /usr/share/kodi
Open Xserver wrapper configuration file.
sudo nano /etc/X11/Xwrapper.config
Add the following to Xserver wrapper configuration file and save.
allowed_users=anybody needs_root_rights = yes
Remove PulseAudio if it causes issues.
sudo pacman -Rdd pulseaudio
Pulse audio allows sound from multiple application simultaneously but this means no digital passthrough is possible. It can also cause the volume controls to stop working properly.
By default Kodi library updates ignore directories with unchanged date modified attribute. This can greatly increase the scan speed but can cause issues with certain file systems. When using a union file system such as MHDDFS or Mergerfs the mdate can be inconsistent causing Kodi to ignore new media. This can be disabled from advanced settings configuration file.
Open the settings file.
sudo nano ~/.kodi/userdata/advancedsettings.xml
Open the settings file of the standalone installation.
sudo nano /var/lib/kodi/.kodi/userdata/advancedsettings.xml
Copy the settings and save the file.
<advancedsettings> <videolibrary> <usefasthash>false</usefasthash> </videolibrary> </advancedsettings>
Disabling fast hash will force Kodi to scan all directories regardless of the date modified attribute.
Start manually in standalone mode.
sudo startx /usr/bin/kodi --standalone
Start the service with systemd.
sudo systemctl start kodi
Enable the service to run on boot with systemd.
sudo systemctl enable kodi
Migrate Kodi Configuration & Settings
If kodi-standalone-service was installed after configuration it will be require to relocate the configuration and cache to a new location.
Copy user configuration directory to the new kodi-standalone-service location.
cp -r /home/kodi/.kodi /var/lib/kodi/.kodi
After the transfer completed successfully remove the old user configuration directory.
sudo rm -Rd /home/kodi
Set the ownership on the new user directory.
sudo chown -R kodi:kodi /var/lib/kodi