Ever wanted to create a HTPC from old computer laying around. Or just have some spare time and want to try something new. This article could be just for you. It will show you the step by step process to convert a Fedora Silverblue to a fully fledged HTPC.
What is Fedora Silverblue, Kodi and HTPC?
Fedora Silverblue is a system similar to Fedora Workstation. It offers an immutable filesystem (only /var and /etc are writable) and atomic updates using an ostree image, which offers reliable updates with ability to rollback to previous version easily. If you want to find out more about Fedora Silverblue visit https://silverblue.fedoraproject.org/ or if you want to try it by yourself you can get it here.
Kodi is one of the best multimedia player available. It provides plenty of features (like automatic downloads of metadata for movies, support for UPnP etc.) and it’s open source. It also has many addons. So if you are missing any functionality you could probably find an addon for it.
HTPC is just an acronym for Home Theater PC in simple words a PC that is mainly used as an entertainment station. You can connect it to TV or any monitor and just use it to watch your favorite movies, TV shows or listen to your favorite music.
Why choosing Silverblue to create an HTPC?
So why choosing Fedora Silverblue for HTPC? The main reasons are:
- Reliability – you don’t need to fear that after update everything stop working and if it does, I can rollback easily
- New technology – it is a good opportunity to play with a new technology.
And why to choose Kodi ? As stayted before it’s one of the best multimedia player and it’s packaged as a flatpak, which make it easy to install on Silverblue.
Conversion of Fedora Silverblue to HTPC
Let’s go step by step through this process and see how to create a fully usable HTPC from Fedora Silverblue.
1. Installation of Fedora Silverblue
First thing you need to do is to install Fedora Silverblue, this guide will not cover the installation process, but you can expect similar process as with standard Fedora Workstation installation. You can get the Fedora Silverblue ISO here
Don’t create any user during the installation, just set root password. We will create a user for Kodi later.
2. Creation of user for Kodi
When you are in the terminal logged as root, you need to create a user that will be used by Kodi. This can be done using the useradd command.
Go through GNOME initial setup and create a kodi user. You will need to provide a password. The created kodi user will have sudo permissions, but we will remove them at the end.
It’s also recommended you upgrade Fedora Silverblue. Press the Super key (this is usually the key between Alt and Ctrl) and type terminal. Then start the upgrade.
And reboot the system.
3. Installation of Kodi from Flathub
Open a terminal and add a Flathub remote repository.
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
With the Flathub repository added the installation of Kodi is simple.
flatpak install flathub tv.kodi.Kodi
4. Set Kodi as autostart application
First, create the autostart directory.
mkdir -p /home/kodi/.config/autostart
Then create a symlink for the Kodi desktop file.
ln -s /var/lib/flatpak/exports/share/applications/tv.kodi.Kodi.desktop /home/kodi/.config/autostart/tv.kodi.Kodi.desktop
5. Set autologin for kodi user
This step is very useful together with autostart of Kodi. Every time you restart your HTPC you will end up directly in Kodi and not in the GDM or GNOME shell. To set the auto login you need to add the following lines to /etc/gdm/custom.conf to the [daemon] section
6. Enable automatic updates
For HTPC automatic updates we will use systemd timers. First create a /etc/systemd/system/htpc-update.service file with following content.
ExecStart=/usr/bin/sh -c 'rpm-ostree upgrade; flatpak update -y; systemctl reboot'
Then create a /etc/systemd/system/htpc-update.timer file with following content.
Description=Run htpc-update.service once a week
OnCalendar=Wed *-*-* 04:00:00
Start the timer from terminal.
systemctl start htpc-update.timer
You can check if the timer is set with the following command.
This timer will run at 4:00 a.m. each Wednesday. It is recommended to set this to a time when nobody will use the HTPC.
7. Remove root permissions
Now you don’t need root permissions for kodi anymore, so remove it from the wheel group. To do this type following command in a terminal.
sudo usermod -G kodi kodi
8. Disable GNOME features
There are few GNOME features that could be annoying when using Fedora Silverblue as HTPC. Most of these features could be setup directly in Kodi anyway, so if you want them later it’s easy to set them directly in Kodi.
To do this, type the following commands.
# Display dim
dconf write "/org/gnome/settings-daemon/plugins/power/idle-dim" false
# Sleep over time/
dconf write "/org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-type" 0
dconf write "/org/gnome/desktop/screensaver/lock-enabled" false
# Automatic updates through gnome-software
dconf write "/org/gnome/software/download-updates" false
And that’s it, you just need to do one last restart to apply the dconf changes. After the restart you will end up directly in Kodi.
Now I will recommend you to play with the Kodi settings a little bit and set it up to your liking. You can find plenty of guides on the internet.
If you want to automate the process you can use my ansible script that was written just for this occasion.
EDITOR’S NOTE: This article has been edited since initial publication to reflect various improvements and to simplify the procedure.