Xanatos

As I did become a father I thought more about privacy and did not want that photos of my child are getting uploaded to a cloud system. This did force me to disable all the picture cloud backup systems on my phone. Those chances where made 3 years in the past. But since I still did need a reliable solution to backup data from my mobile phone I start using Syncting earlier this year after I learned about it. The nice thing about Syncthing is that it always sends data encrypted and tries to use your local network. So I installed the software and my phone syncs with my main pc and my notebook. This does add some backup but since both of those devices are always online stuff could happen all the time. So I do need an additional sync point, which is some kind of a data storage I can turn of.

Lucky me my wife got a new notebook and I can reuse her old Lenovo ThinkPad T510 for this purpose.

What's The Plan

So the idea is to create a minimal server with a administration user for installing and managaging software. The system should automatically connect to the wifi. There should be an ssh server running, allowing the administrator user to log in for updates and configuration. The last requirement is syncthing with it's own user and home directory to prevent mistakes, this should also start automatically on system boot without any login required. The user should only be used to managed the file acces rights, but it will still need a home directory for storing the data.

To make this a little bit of a challenge to me and learn more about Linux I do not want to use the install script and configure everything myself instead.

The Installation

As every story related to computers does start we need to get it up and running, this was a real issue. But let's start at the beginning.

I did create the boot stick with the newest Arch Linux iso and validated the signature. After that i wrote the iso to the stick creating a bootable one via MultiWrite. I plugged in the stick, booted the notebook and started the installer, the first thing I noticed where a block of errors popping up every 2 – 5 seconds.

usb 1-1-port3: Cannot enable. Maybe the USB cable is bad?
usb 1-1.3: device descripto read/8, error -32

Seemed like one of the usb ports is kinda broken and the device tried to assign an address to is but failes every time. So I started to search for an solution to disable this port preventing the message to be thrown, sadly I could not find anything and after ~30 minutes. So I decided to try the installation with the error present.

In the process I learned that this is most likely a kernel error. I also got my assumption confirmed that this is most likely an issue with one of the usb ports.

First of all I did connect successfuly to my wifi network. The message still been shown every few seconds, preventing me from reading the commands I write. After that I partitioned the disk

  • 200 mb boot /boot
  • 20 gb root /
  • 8 gb swap [SWAP]
  • All the rest for home /home

Somehow I got this working even with the error annoying the hell out of me. I formatted the partitions with ext4 and swap, after that I mounted them. The next step was starting the installation script via pacman base base-devel linux linux-firmware While I waited, I continued searching for a solution on how to disable the usb ports later on. This did result in finding this post and I bookmarked it for later use. I created the fstab and checked it, the error still did not stop and I already was another 30 minutes in the process.

As as sidenote: It is really difficult to write commands if you cannot check them.

I switched to my newly installed system arch-chroot /mnt and did some post installation steps

  • Change the region
  • Set the correct locale
  • Set the correct keyboard layout
  • Set the machine name

After that only two steps where still to be done, creating the grub bootloader and add a root password. So I downloaded grub and tried to install the configuration via grub-install --target=i386-pc /dev/sda, but this resulted in an error because there is no space left on boot. I checked the disks usage via df just to notice my boot partition is already used 100%. My Linux knowledge is still limited so the only solution I did came up with is to fix my mistake by starting the installation again. So I unmounted everything and rebooted the system.

As a reminder, you should really the recommendations of the arch install wiki. They do recommenend ~1GB for the boot partition, so this was surely preventable.

After the installed showed up again welcoming me with errors spamming my screen I decided to use the installation script, hoping that it will somehow supress the errors. Reconnecting the wifi was easy, after that I was ready to start the installation via archinstall. The error where still present, but if I navigate the menus up and down it redraws the screen, clearing the message in the process. This approach helped me to get a installation done and prevent some frustration. Sadly I could not fullfil my goal to install it without the script but I wasn't ready to fight against the system once again.

I configured the mirrors, changed the root password, preselected sshd for installation. Then I partitioned the disk via best effort seleting the option to split root and home. Added the hostname, selected an audio profile and added the networkmanager for auto wifi connection later on. As a text editor I added neovim, I quickly checked if the installer will create a swap and smashed the install button.

It did started, while the errors still showed up in the process, preventing any reading what happens right now. So I crossed my fingers and hoped for the best. There was a small chance that it will be gone after booting into the system for the first time.

The First Real System Boot

As the screen turned black I still crossed my fingers hoping for the best, grub started and loaded the kernel, I was greeted by a login shell. I waited a few seconds for the error to reappear, but nothing happend, the error was gone, properly writing to some system log. But at least I can continue the installation and read my commands, which will be helpful.

I logged into the system, which was hard since the keyboard was configured wrongly. As I was logged in I fixed the keyboard and restarted. My next task was getting a internet connection because I noticed that it was missing. For some reason I though that the network manager will magically fix it right away, because I already configured it in the installer. So my next task was searching the internet how to connect to a wifi network.

Connecting To The Internet

With my limited knowledge this did take a long time to get working. I did properly a lot of really stupid stuff down the road.

So I went to the wiki which told me that I need either iw or wireless_tools to do this. So I started with the first option, I plugged in a network cable after realizing that package download will not work if there is no internet connection, obviously. I tried to connect my wifi just to be remembered that reading the documentation is really important, because iw does not support WPA2 as a protocol. So I installed the second option and checked the wiki while the installation was ongoing. I noticed on the wiki that WPA2 is also not supported, leading to an uninstall of both tools right away.

Alright so I have no clue how to connect to my wifi network, what a great start. After checking the installation guide again I remembered the tool I used while installing iwctl. Searching through the wiki I learned how to install the cli. I stuck a while getting the cli running casue I did neet to start the iw service, without it iwctl does not work. I established a connection and checked my ip via ip addr. Nothing was shown, back to the wiki, surly I forget to setup up a dhcp service so let's do this.

As mentioned by the documentation I created the following file

/etc/iwd/main.conf

[General]
EnableNetworkConfiguration=true

[Network]
RoutePriorityOffset=300
NameResolveService=systemd

Since I missspelled some settings multiple times and forgot to add the resolve service I needed multiple service restarts to get a working configuration. I unplugged the device and checked if everything was working, it did show up on my router and the system was pingable. So I restarted the system to validate the auto connect, the auto connection did work, but the device registerd with another name and guid. This would prevent me from setting up a static ip based on the router configuration. I tried to get a solution for this but failed.

At this moment I finally checked the wiki page for the networkmanager I installed, and learned that all the previous steps where unnecessery. To celebrate my new knowledge I disabled the iw service and deleted the tools I installed. Confident to fix it right away. I added the networkmanager service and configured the connection. After another reboot test, the system registered with the same guid, which allows me to use a static ip.

Setup SSH-Server And Users

After the network worked as planned I added the administration user. The administrator user was added to the wheel group and I enabled this group in the /etc/sudoers file. I also added a user for syncthing.

I added a password for both users and tried a login to verify that everything works as expected. The last test will be accessing the device via ssh, so I enabled and started the ssh server and switched to another machine for testing. The connection could be established this allows me to do the configuration left from my daily work machine.

Configure Syncthing And Final Tests

I logged in as the administrator user and installed syncthing, I read through the wiki how to enable the tool with a user context. Which is really simple as I learned, you just need to following command systemctl enable [email protected]. To check this I simply started the service by replacing enable with start => .systemctl start [email protected]

The next step was to configure the service itself, since this is done via a website running on the machine I needed a solution to access this. The Syncthing wiki does provide one, which possible is a little bit unsecure. But since this machine will never leave my home, this should be fine. To use this solution you simple change which ip addresses are getting accepted from localhost only to every address.

After those changes I could access the web frontend via other machine. To secure the service I added a user and password authentification. I added my other sync points to the server and started to share some folders.

As some files where transmitted I changed to my syncthing user and checked the files recieved. Everything looked good.

“Fixing” The Usb

As a workaround for the broken usb port I used the solution mentioned above and disabled the ports with the guide. This seems to work because previously on a reboot, I saw those error messages been shown on shutdown, after editing grub they where gone.

I might could have only disabled the broken one but to be honest I don't care. I was also already really frustrated because my 1 hour project took 2,5h already.

Some More Thoughts And Context

Security

First of all the most important information I need to share. This project is far from secure. I should have used some disk encryption or share the folders encrypted via syncthing. My current solution can easily be read by plugging in an arch install stick, mounting the home drive and stealing all the data. So do not use this approach if you really need to protect your files.

Still for my situation this solution should be enough. I will never move the device and since I only use this at home nobody will every touch it, besides me.

The Project

With this project I learned how important it is to really read the documentation. This does save a lot of time if done correctly ... Additional I learned how to connect to wifi and make configure auto connect.

I noticed that the device syncs really slow. This is not really an issue but annoys me. Still it seemed like this backup system was a good idea, I do have around ~130 GiB of data which need's to be synced. This is mostly data from my mobile device getting backed up and some old phone backups I exclusivly stored on a single 5+ year old HDD.

This solution created an additional sync point and limted the risk for data loss.

Still Missing

At the moment of speaking I did not install any firewall, this is the next step I need to do. Sure the device is somehow protected via the router but no firewall is always a bad idea.

This post will wrap up my experience with installing Arch Linux on a gaming pc of a friend of mine.

Starting Situation

About the Situation itself

He did plan to do this for a long time. The main reason for his decision was that his old hardware is not supported with Windows 11 anymore, prevent him from updating.

Since he is a father of two children time for important stuff like this is limited, so he pushed the task back for a long time. But as I had some vacciation from work he asked me if I want to help him out installing. I was super interessted to help him so we meet the day after. We also did take care of one of his and mine child, so while working on this project they helped us out or manipulated our progress.

About Us

Both of us are software engineers and we love thinkering. We also got some knowledge with Linux on our daily work.

He does use a Linux Mint Notebook for a while now and it worked great.

I used a Linux Mint Notebook as well, updated it to Arch at the start of the year. Previously there was Mint installed and I used it as a dual boot with Windows 10. I never used the Windows installation, so fully comitting to Linux for that piece of hardware was just a matter of time.

The Goal

We had a simple plan for the day:

  1. First of all install his old PC and backup everything he needs on a sperate disk.
  2. Install some new hardware he got gifted, namely a new board, cpu and ram. Everything was already installed on the main board as a single package.
  3. Install a new power supply which uses managed cables.
  4. Install Arch Linux with KDE and SDDM on the new machine.
  5. Install the proprietary NVIDIA driver on the pc and get it running.
  6. Test if a game does start up.

The Hardware Upgrade

First of all we opend up his computer case and removed his old hardware. This was stressful because some parts weren't as easy to uninstall as we thought. The main issue here was that some fans blocked the main board so we could no lift it without removing the them. While doing this the childrens slowly got bored and started to do children stuff. After half an hour we did successfully remove the old hardware and started to install the new one. Since all the fans where already removed this was a fast process.

We decided to not install the power supply since some cables where already repaired via isulation tape and that felt not right. Since the new power supply unit only provided ~10 0W more power and we did reuse his old graphic card, we where pretty sure that there should be enough power available for the system. After installing all the components we plugged it in and checked for a successful boot to the BIOS. We disconnected all the ssd's where backup data was stored only keeping the os disk plugged in.

Now it was time to plug in the installation medium containig Arch and boot the system.

The Installation Script

After selecting the boot stick, we got greeted by the Arch installer. Since we are both some Linux newbies we decided to use the installation script and keep it simple. So we openend up the installation guide, started the script and filled out all the required information.

As we reached the part of the installation where we need to partition the disk we decided to increase the root partition. This happed because as I installed my Arch notebook I did use the default settings. For me the default root partition on my notebook was to small and I did run into issues. Ineeded to fix this via gdparted and a small boot stick. To prevent this issue for his machine we did want to do it right.

So we deleted the root and home partition via the manual editing tool and tried to create the on our own. We took a long time understanding how exactly to use this tool and it always felt kinda wrong. We continued with the partition process, we simple wanted a /root with ~80 Gb and use the rest as /home. We configured the rest on the installation skript.

  • Add a user
  • Set a root password
  • Adding KDE as a frontend, using SDDM as a login provider
  • Using systemd-boot as a boot manager
  • Using proprietary NVIDIA drivers for the installation
  • Adding some additional tools and some software to start with.
  • Set the locales and region

After we finished that we pressed the install button and got an error message that something with our partition went wrong. Since it was time for lunch at this point we did take a short break.

As we got back to the problem, we just started the archinstall script again and noticed that the SSD was not detected anymore. To solve this we restartet the machine. After restart we could access the disc again and tried another attemp for a correct partition table, but it failed again. We repeated that exact same issues once more, on the fourth installation attempt we were frustrated. Because we were still lookin after the childrens and it was already after lunch, we decided to use a single partition because this shouldn't be an issue. Only downside with this is you can't reinstall the boot system without wiping home I guess.

With this approach we could use the recommended settings for the partition process, hoping that the installation will work out this time. So we pressed the install button and got beyond the point of the previous crashes.

Everything else went smoothly after that, as the installation finished we switched into the new installed system and added some additional tools before finally rebooting into the new desktop enviroment.

Setup for the NVIDIA Proprietary Driver

After the reboot we where granted with the SDDM login manager, since no theme was set just yet it looked a litte bit off. As the resolution of the monitor was detected correctly already it seemed like the driver also did hos job. The thing which looked strange to me was that both monitors showed the same image, so instead of using the second monitor as a extension he used it for mirroring.

After the successful login the resolution changed to a wrong one, we checked the display settings and noticed that nothing was correctly detected. Our first guess was that something is wrong with the NVIDIA driver.

So we did start to search the internet what must be changed. We learned that for KDE with Wayland we need to aktivate the “drm” mode by adding nvidia-drm.modeset=1 to a configuration file. We did search for an hour where to add this and how we should solve this, slowly getting the information required to do this. We learned that this is a Kernel setting and we need to tell the system to use the NVIDIA driver instead of the open source one. Non of the articles/forum entries found on the internet really told us how to do this. We tried multiple things and rebootet the system at least ten times.

As we were really frustrated we found a single GitHub Page with an guide on how to install the driver (But this information is depricated I guess), enable DRM and make sure to load the driver on system start. We followed the guide and rebooted the system, logged in and the resolution was automatically correctly set. Whoever wrote this GitHub readme, thank you so much, you properly saved the installation. We checked the display settings and everything seemed to be working as expected, we finally did found a solution.

After verifing the driver we installed Lutris, Steam and Bottles. We did a quick test by installing the Epic Game launcher on Lutris to verify that all packages are installed and ready. After a successful login we installed Steam, selected the correct Vulkan driver and enabled Proton. Since the Toddlers where really bored already we decided to do not test any further software. It was already after 3:30 PM.

Lesson Learned

I think I did learn a lot about Arch and Linux with this installation. I learned how to install proprietary drivers and tell the system to use them. I learned thinks about the inner working of Linux by editing files related to the graphic driver. I did learn that installing software which is mainly for windows isn't a real issue anymore with the help of tools like Lutris and Bottles. At the end those are just som abstraction layers on top of Wine but they really make a difference.

I think it is possible for every gamer, who already installed an OS on there own or is willing to lern, can install a Linux distro and start gaming on it. You may should not start with Arch itself but using something like EndeavourOS, which is a Arch based distro. As an alternative I think Mint is always a good start and does run out of the box. I do not know if Mint does support proprietary NVIDIA drivers but I think it's highly likeable.