Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fedora - Convert your Fedora Silverblue to HTPC with Kodi

#1
Convert your Fedora Silverblue to HTPC with Kodi

<div style="margin: 5px 5% 10px 5%;"><img src="http://www.sickgaming.net/blog/wp-content/uploads/2019/02/convert-your-fedora-silverblue-to-htpc-with-kodi.png" width="1024" height="626" title="" alt="" /></div><div><p>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.</p>
<h3>What is Fedora Silverblue, Kodi and HTPC?</h3>
<p>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 <a href="https://silverblue.fedoraproject.org/">https://silverblue.fedoraproject.org/</a> or if you want to try it by yourself you can get it <a href="https://silverblue.fedoraproject.org/download">here</a>.</p>
<p><a href="https://kodi.tv/">Kodi</a> 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.</p>
<p>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.</p>
<h3>Why choosing Silverblue to create an HTPC?</h3>
<p>So why choosing Fedora Silverblue for HTPC? The main reasons are:</p>
<ul>
<li>Reliability – you don’t need to fear that after update everything stop working and if it does, I can rollback easily</li>
<li>New technology – it is a good opportunity to play with a new technology.</li>
</ul>
<p>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.</p>
<h3>Conversion of Fedora Silverblue to HTPC</h3>
<p>Let’s go step by step through this process and see how to create a fully usable HTPC from Fedora Silverblue.</p>
<h4>1. Installation of Fedora Silverblue </h4>
<p>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 <a href="https://silverblue.fedoraproject.org/download">here</a></p>
<p>Create only the root user during the installation with some password. We will create a user for Kodi later without password.</p>
<h4>2. Booting to terminal</h4>
<p>This part will be a little tricky. You need to bypass GNOME and end the boot sequence in terminal. Otherwise you will end up in GNOME initial setup process, which will not allow you to create user without password.</p>
<p>To bypass the GNOME you need to press the ‘<em>e’&nbsp;</em>key in GRUB menu to edit the GRUB entry. When editing the GRUB entry just look for the line starting with <em>linux16</em> and add <em>3</em> to end of this line. Then continue the boot sequence with <em>CTRL + x</em>. Don’t worry about the changes, they are used only for this session.</p>
<figure class="wp-block-image"><img src="http://www.sickgaming.net/blog/wp-content/uploads/2019/02/convert-your-fedora-silverblue-to-htpc-with-kodi.png" alt="" class="wp-image-24814" /><figcaption>GRUB menu</figcaption></figure>
<figure class="wp-block-image"><img src="http://www.sickgaming.net/blog/wp-content/uploads/2019/02/convert-your-fedora-silverblue-to-htpc-with-kodi-1.png" alt="" class="wp-image-24815" /><figcaption>GRUB entry edited</figcaption></figure>
<p>You will end up in terminal where you need to login as <em>root</em>. </p>
<h4>3. Creation of user for Kodi</h4>
<p>When you are in the terminal logged as <em>root</em>, you need to create a user that will be used by Kodi. This can be done using the <em>useradd</em> command.</p>
<pre class="wp-block-preformatted">useradd kodi</pre>
<h4>4. Installation of Kodi from Flathub</h4>
<p>To install the Kodi in flatpak you first need to add a Flathub remote repository.</p>
<pre class="wp-block-preformatted">flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo</pre>
<p>With the Flathub repository added the installation of Kodi is simple.</p>
<pre class="wp-block-preformatted">flatpak install flathub tv.kodi.Kodi<br /></pre>
<h4>5. Set Kodi as autostart application</h4>
<p>First we need to create the autostart directory for the <em>kodi</em> user, this is easier if you switch to <em>kodi</em> user directly.</p>
<pre class="wp-block-preformatted">su kodi<br />mkdir -p /home/kodi/.config/autostart</pre>
<p>Then you need to create a symlink for the Kodi desktop file.</p>
<pre class="wp-block-preformatted">ln -s /var/lib/flatpak/exports/share/applications/tv.kodi.Kodi.desktop /home/kodi/.config/autostart/tv.kodi.Kodi.desktop</pre>
<p>The last thing that will prevent for autostart to work correctly is the GNOME initial setup. To disable it just create a <em>gnome-initial-setup-done</em> file in <em>.config</em> directory of kodi user.</p>
<pre class="wp-block-preformatted">echo "yes" &gt; /home/kodi/.config/gnome-initial-setup-done</pre>
<p>You can now switch back to <em>root</em> for the next steps.</p>
<pre class="wp-block-preformatted">exit</pre>
<h4>6. Set autologin for kodi user</h4>
<p>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 <em>/etc/gdm/custom.conf</em> to the <em>[daemon]</em> section</p>
<pre class="wp-block-preformatted">AutomaticLoginEnable=True <br />AutomaticLogin=kodi</pre>
<h4>7. Enable automatic updates</h4>
<p>For HTPC automatic updates you will need a <em>cron </em>job. But because <em>cron</em> is not part of the standard Fedora Silverblue installation you need to install it first. In this step I also recommend to do upgrade of the Fedora Silverblue first before layering the <em>cron</em> package.</p>
<pre class="wp-block-preformatted">rpm-ostree upgrade<br /><br />rpm-ostree install cronie</pre>
<p>After this you need to reboot your computer, to apply the new updates.</p>
<pre class="wp-block-preformatted">reboot</pre>
<p>To be able to setup <em>cron</em> in this phase you need to do the second step again and log in as <em>root</em>. After this you need to edit the <em>crontab</em>.</p>
<pre class="wp-block-preformatted">crontab -e</pre>
<p>And add the following line to it.</p>
<pre class="wp-block-preformatted">0 4 * * 3 flatpak update -y; rpm-ostree upgrade; reboot</pre>
<p>This will create a new <em>cron</em> job, which will update any flatpaks (Kodi in this case), update Silverblue and does a restart to apply the changes.</p>
<p>This job will run at 4 AM on Wednesday. It is recommended to set this to a time when nobody will use the HTPC.</p>
<p>Restart the computer now.</p>
<pre class="wp-block-preformatted">reboot<br /></pre>
<h4>8. Disable GNOME features</h4>
<p>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.</p>
<p>To do this exit Kodi and open the terminal. Press <em>Super</em> key (this is the key between <em>ALT</em> and <em>CTRL</em>) and type <em>terminal</em>. Once the terminal will be open and you need to type the following commands.</p>
<pre class="wp-block-preformatted"># Display dim<br />dconf write "/org/gnome/settings-daemon/plugins/power/idle-dim" false<br /><br /># Sleep over time/<br />dconf write "/org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-type" 0<br /><br /># Screensaver<br />dconf write "/org/gnome/desktop/screensaver/lock-enabled" false<br /><br /># Automatic updates through gnome-software<br />dconf write "/org/gnome/software/download-updates" false</pre>
<p>And that’s it, you just need to do one last restart to apply the <em>dconf</em> changes. After the restart you will end up directly in Kodi.</p>
<figure class="wp-block-image"><img src="http://www.sickgaming.net/blog/wp-content/uploads/2019/02/convert-your-fedora-silverblue-to-htpc-with-kodi-2.png" alt="" class="wp-image-24818" /><figcaption>Kodi</figcaption></figure>
<h3>What now?</h3>
<p>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.</p>
<p>If you want to automate the process you can use my <a href="https://github.com/Zlopez/ansible_HTPC">ansible script</a> that was written just for this occasion.</p>
<hr class="wp-block-separator" />
<p>Photo by <a href="https://unsplash.com/photos/XCBW03rNaNQ?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Sven Scheuermeier</a> on <a href="https://unsplash.com/search/photos/tv?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p>
</div>
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016