Category Archives: Linux

My first contact with Linux

I remember it like it was yesterday. The thrill. Wandering away from the safe and boring, and into the unknown. Yes, I’m talking about my first installation of Linux, Slackware 4.0 – which places my first contact around mid 1999, since this year also saw the 7.0 release.

Unfortunately, I don’t remember the name of the guy who introduced me, or his handle on the internet. It was at the local computer club, and in a short evening he showed me the ropes, helped me install Slackware and recommended using Enlightenment (E16) instead of Gnome or KDE.

The Librarian

Before this point, I’ve already read skimmed through at least one book on Linux, which is almost a short story in itself. I got curious about this whole Unix thing a few years earlier and took a trip down to my local library to see what they had on the topic. I asked the lady at the desk, but she didn’t know what I was talking about, however, the guy with the “stuffed penguin doll” certainly did.

Yet another guy I don’t remember the name of, but who made a lasting impression. “You don’t want Unix, you want Linux. Take this book, it will answer all your questions and make you wise” – well, the first part of that sentence is true anyway. So, it turns out that one of the librarians was a Linux geek! And when he spoke about his weekend Linux adventures at work, no one understood a damn thing. But I got it. I understood. At least I understood the core concept, I did not understand how much work it was to save a RAID gone bad. That would come later.

Got root?

So, I mentioned the thrill earlier, and in hindsight this might seem silly, but the thrill of being root for the first time was more powerful than you probably can imagine. This feeling quickly faded though, since I was root only on my own machine, but still, it felt big at that moment.

Back in 1999, you could not just install Linux and expect everything to work out of the box. Just setting up the graphical environment required a lot of leg work. Like knowing the vsync and hsync of your monitor (CRT monitors, remember those?), screen resolution, colour depth and a few other bits and pieces. If you got it wrong, it would just flicker your screen and crash. Fun times, glad they are over.

The Linux kernel

At some point I started compiling my own kernels. Adding and removing features to make it as small and streamlined as possible, and yet still be able to boot. I learned a lot about hardware back then, well, a lot about which hardware I had at least. Also, I learned how long it took to compile the kernel on my machine. It was just long enough that you didn’t want to make too many mistakes. So, circa 20 minutes?

Looking back, I’m glad most distros shipped with the source code as well as the compiled binaries. Downloading a new kernel took ages, that is around 38 minutes assuming we download a 17MB .gz file on a 64 Kbps (ISDN) connection.

Dial Internet

Eventually, we got internet, dial-up of course, but probably not the one you are thinking about, unless you made the connection from the previous paragraph. If you did, kudos. Anyway, my parents went straight to ISDN, two lines, always on. Except I wasn’t always on, because dial-up still cost money by the minute.

I had an Teles ISDN card where IRQ address had to be set manually (ISA bus), luckily there was a German project (German domain at least) called ISDN4Linux which helped a lot when setting up the correct kernel modules and software config. I guess ISDN was more of a European thing.

A funny thing about this ISDN card – well, funny might not be the right word – from time to time, the card would stop working. Rebooting the machine did not help. However, changing the ISA slot did. So, each time it stopped it was just a matter of turning the machine off, moving the card between one of the ISA slots available, and power it back up. Yeah, that was not a funny thing. I should not have written that.

I don’t know if anyone else ever had that problem, but the solution, as I mentioned, was easy. And as long as I never put the lid back on, or fastened the screw securing the card, it was a quick and painless experience. Except for the part were the machine had to be powered off and back on. Okay, skip quick and painless, let’s say: easy but tedious.

The year of the Desktop

Despite a lot of talk about “the year of the desktop”, it never really happened for Linux. Well, it happened for me. I used Linux full time on my desktop for over a year and a half around 2004. It was good and it felt good. I was master of my domain, still rocking Enlightenment as my go-to desktop environment.

Linux and Enlightenment with XMMS, gkrellm and a few other applications running
XMMS and gkrellm, those were the days.

Picture above: If you read Norwegian, I did eventually get paid for that Windows XP stint. If you don’t read Norwegain, I still got paid.

Now, however, I was using Gentoo. A Linux distribution that was compiled for your hardware on your hardware, promising more speed and control. The speed gain would come after installation and certainly not during, because downloading and compiling every package took ages – and this time I’m not talking about 38 minutes anymore, but hours.

I did save a bit of time when I worked as a sysadmin at a school. Using computers in the computer lab and a boot disk, I could harvest their collective processing power to install Gentoo on my laptop using distcc, a distributed C/C++ compiler system. Also, the school had way faster internet then I had at my apartment.

Then games drew me back to Windows. Now days it’s mostly Lightroom keeping me back, but the way Windows is heading, Linux as desktop looks way more interesting again. I’m still using Windows 8.1 at home, and it’s not because it’s great.

What’s this all about then?

I learned so much about computers back then, and Linux really was a big driver in that regard. Do I miss it? I would be lying if I said no, but on the other hand, my previous rant post have showed me that this probably is more about nostalgia then anything else.

I guess that’s basically it: me dipping my toes in lake nostalgia, again.

Problems starting Steam on Linux

I recently installed Steam onto my Linux laptop. You know, to play games and such. Well, actually, just to try that one game which I knew was running in DOSBox. It’s that kind of game. Old. Should work on Linux, right? I mean, it’s DOSBox. Well — it didn’t — and Steam would not start either.

The problem

Trying to start Steam resulted in nothing. Tried several times. Nothing. Trying to start it from a terminal produced some error messages. That’s a good tip. If you have problem starting a program in Linux, try to start it in a terminal. It usually produce some information instead of dying silently.

$ steam 
 Running Steam on centos 7 64-bit
 STEAM_RUNTIME is enabled automatically
 Installing breakpad exception handler for appid(steam)/version(0_client)
 /home/torh/.local/share/Steam/ubuntu12_32/steam: symbol lookup error: /lib/libxcb-dri3.so.0: undefined symbol: xcb_send_request_with_fds
 mv: cannot stat ‘/home/torh/.steam/registry.vdf’: No such file or directory
 Installing bootstrap /home/torh/.local/share/Steam/bootstrap.tar.xz
 Reset complete!
 Restarting Steam by request…
 Running Steam on centos 7 64-bit
 STEAM_RUNTIME has been set by the user to: /home/torh/.local/share/Steam/ubuntu12_32/steam-runtime
 Installing breakpad exception handler for appid(steam)/version(0_client)
 /home/torh/.local/share/Steam/ubuntu12_32/steam: symbol lookup error: /lib/libxcb-dri3.so.0: undefined symbol: xcb_send_request_with_fds

The Solution

So I did a quick Google search, and instead of ending up on this blog post (like you did), I ended up at a GitHub issue where a post from 2017 gave me this answer. And guess what? It works! Just run this command from terminal, and after that it should work as normal.

LD_PRELOAD='/usr/$LIB/libstdc++.so.6' LIBGL_DRI3_DISABLE=1 steam

In my case Steam started updating itself. So I guess the package available for CentOS isn’t kept up-to-date. And why would they, if Steam updates itself anyway.

The Question

Why on earth this hasn’t been fixed yet beats me. Actually, the Github issue says that it’s fixed, so I guess we are back to the point that the package in CentOS isn’t updated.

And why a game which “only” needs DOSBox isn’t supported on Linux is also a bit strange. I could always download it on a Windows machine and copy the files and see what happens.

Anyway. This was more about getting Steam running and less about me trying to play a game from my childhood years.

Citrix Receiver on Linux

I’ve written about this issue before, in 2008. But as it turns out, the problem still exists with todays version of the Citrix client, version 12.0, now called Citrix Receiver. And people are still searching for an answer on how to solve this issue.

You have not chosen to trust [certificate] the issuer of the server’s security certificate (SSL error 61)

Both the problem and the solution is the same as before, only the name and the path is different. The path depends on whether you installed the client/receiver as a normal user, or root, also known as the superuser.

I’ve used Ubuntu 11.04 here, but I reckon it’ll work on any Linux distribution.

The problem is this; When you install the Citrix Receiver, it will only install a handful of certificate files, and we’ll have to provide the rest. Now, where can we find a reliable source of SSL certificates? Well, it turns out that we most likely have that already. The same source our browser is using.

 /usr/share/ca-certificates/mozilla/

Just copy those .crt files over to the Citrix keystore, and we should be done. If the client is installed under /opt/Citrix/ICAClient/, run this command in a terminal:

sudo cp /usr/share/ca-certificates/mozilla/* \
/opt/Citrix/ICAClient/keystore/cacerts/

If it’s installed in your home directory, this command should work:

cp /usr/share/ca-certificates/mozilla/* \
$HOME/ICAClient/linuxx86/keystore/cacerts/

If you are using a home made certificate, or for some reason this doesn’t work for you, you’ll have to track down the correct .crt files yourself. But at least now you’ll know where to place them.

Adobe Air – Open URLs in default browser

For the last few days I’ve been fighting TweetDeck on my laptop trying to get it to open web pages in Opera. A small, but fast browser, from the Norwegian company with the same name.

At first I thought that Opera wasn’t my default browser in Gnome. I’m currently using Linux Mint, a distribution based on Ubuntu. So I checked the “Preferences->Preferred Applications” and made sure Opera was the default application for browsing the web. I also checked with “gconf-editor” just to be safe that Opera was set as default browser.

Having checked all this. I did a few tests and found out that Opera was indeed the default application for surfing the web. So the problem had to be limited to TweetDeck or Adobe AIR.

Now. I checked all the xml-files regarding Adobe AIR and TweetDeck, I even installed SQLite3 to read the database file for TweetDeck in my home directory. No luck.

But the Internet is a collection of tubes amazing and brilliant people. So I searched and found Andrea Olivato, which in turned had found the solution to my (and many others) problem. He discovered that Adobe AIR has hard-coded firefox as default browser in libCore.so, which (usually) can be found in /opt/Adobe AIR/Versions/1.0.

The solution

His solution to the problem was to open libCore.so with vim, or any other editor for that matter, and search for the word “firefox”. Ok, he writes that he jumps directly to line 15500, but this might change. But then again, maybe Adobe will make it work in the future. Anyway. He replaced “firefox” with “browser”, which is the same length. Very important. And created a symlink from his favourite browser to, well, browser.

In my case:

ln -s /usr/bin/opera /usr/local/browser

I noticed that in libCore.so, Adobe has a reference to /desktop/gnome/url-handlers/http/command, which is the registry setting for Gnome when it comes to default browser. Why this isn’t used I don’t understand. Perhaps the hard-coded firefox is a backup solution in case AIR fails to retrieve the information from the registry.

OpenWRT – Configuring VLANs and trunks

This weekend I decided to finally upgrade the firmware on my Linksys WRT54GL wireless router. The whole reason I bought this router a few years back was because it supported third-party firmware based on Linux.

Up until now, Linksys firmware has been working great. I didn’t need more than a simple wireless router. But recently I’ve started playing with VMware ESXi, which led to a few virtual servers. And with a few virtual servers, there was also a need to make them accessible from the Internet. With the only way of opening up ports on my router was through my ISPs web page, and that every change needed to be accompanied by a reboot of my router, I decided it was time to set up my own firewall.

Support for VLANs

OpenWRT support VLANs, and this is one of the main reasons I wanted to upgrade to a third-party firmware. Running a firewall with just one network adapter isn’t really possible, unless you can split networks within the same physical medium. And that’s when VLANs come in to the picture. This technology makes it possible to have several different networks within the same physical medium. Even the with the same network addresses.

The firewall, which is a virtual machine, doesn’t know that the host it’s running on only has one network adapter. I gave the firewall three adapters, all connected to different virtual switches. These switches tag their traffic with VLAN data and sends it to my Linksys router, which in also was configured the same way. One port on the router could hand out data for VLAN1, the next port for VLAN2.

In my setup, the traffic coming from Internet is connected to a port in VLAN2. This is sent, along with data in VLAN3, via port 4 to the ESXi host. Here the traffic is divided into virtual switches. One switch for each VLAN. So my firewall is connected to both the switch for VLAN2, and for VLAN3. VLAN2 is being labeled as WAN, while VLAN3 is labeled LAN. I also have a VLAN4 named SERVERS.

Installing OpenWRT

This is easy. If you haven’t installed a third-party firmware on your Linksys, you can use the web interface from Linksys to upgrade. Just as you would if you were to upgrade the original firmware. Download the correct image from OpenWRT, select it in the web interface and click the upgrade button.

After the new firmware is installed, the router will reboot and ready for configuration. By default the routers IP-address is 192.168.1.1. You can log in via telnet with no user name and password. It is advised to set a password at first log in. Doing so, telnet will be disabled and ssh enabled instead.

If you manage to lock yourself out, it’s possible to restart OpenWRT into a safe mode. Just take the power, when it starts up, press any button just when the DMZ light is lid. Now you can access it via telnet at address 192.168.1.1 again, no matter what address you have specified earlier. In safe mode you can change password and reconfigure firewall rules, if you have enabled a rule you shouldn’t have.

Setting up different VLANs (and trunking them)

First you should be aware of how the WRT54GL hardware is mapped internally. It is essential to understand the logic when configuring the router. The image shows the default configuration where port 1 – 4 is a regular switch on VLAN0, and the WAN port is separated on VLAN1. If you only want a dumb switch with 5 ports, you could put the WAN port into VLAN0 as well.

WRT54 internal architecture

The configuration file can be found under /etc/config/network. Here we can set the IP-address of the box, but also configure the ports. I only need a dumb switch with VLAN capabilities, so I won’t set up any fancy routing rules in this post.

config switch "eth0"
   option vlan0 "0t 5"
   option vlan1 "0t 5"
   option vlan2 "0t 4 5"
   option vlan3 "0t 3 2 5*"
   option vlan4 "0t 5"

In this setup I have created five VLANs, three of which are unused at the moment. VLAN3 is the default VLAN, as marked by the asterisk (*). Port 5, the internal, has to be included. Data on LAN port 4 (which is internally mapped as port 0), is tagged, which basically means it’s a trunk. If a port isn’t tagged, it can’t belong to more than one VLAN (except the internal port 5). If a port is tagged, it can’t be used by a computer which doesn’t support trunk or tagging.

My Internet connection is connected to the WAN-port on the router, also known as internal port 4. It belongs to VLAN2, and is tagged on LAN port 4, which is known as internal port 0. On the other side of LAN port 4 is my ESXi server, which supports trunking (surprise). VLAN2 then goes into my firewall, on the other side of my firewall is VLAN3, which goes over the same cable back to the OpenWRT box, which in turn distributes it to my main computer and media center on LAN port 1 and 2.

Conclusion

Linksys WRT54GL is a great product, and with third-party firmware such as OpenWRT, it’s even greater. This box can be transformed from a boring wireless router, to a full blown firewall if needed.