Using Linux as a desktop machine
Editor Note: This was originally published on the Sitewards blog
Editor Note: This was originally published on the Sitewards blog
Probably not. The meme “is ${X}
the year of Linux on the desktop?" has been a thing long before I was a developer and will be here likely long after I'm gone. But I am a happy "Linux on the desktop user", at least in terms of my development life. This is post is a reflection on that -- why I use it, what the good parts are, and what the bad parts are (in comparison to Windows*).
The brutal truth about why I use it
Initially, I didn’t like using this stack at all. It was opaque, the interface isn’t nearly as polished as any other OS and various things appeared to mysteriously break without explanation. I started using it because at one particular job, there wasn’t a choice.
I am forever indebted to those colleagues, and the patience with which they helped me migrate to the new system, and answered my patient and apparently stupid questions. I am now a happy Linux user, and would not go back.
The bad parts
So! To get it out of the way, there are a few things that are super irritating running Linux on the Desktop
Sometimes it breaks. Spectacularly.
There have been a couple of times in which having run the normal machine updates every user is expected to run, things have spectacularly exploded. If memory serves, these are all because I didn’t pay enough attention during updates:
The ability to boot into Linux mysteriously disappeared.
The ability to boot into Windows mysteriously disappeared.
The “display manager” (graphical interface) exploded monumentally, rendering me unable to rescue it save on the occasional reboot where I’d get a working display.
Updates didn’t complete before battery death leading to a horribly broken system.
All of those things are 12/10 on the “things I did not want to fix” scale. Sometimes, it happens. The good news is, sometimes crazy things also happen with testing environments, or even staging or production machines. It’s nice to have solved a few of these on your desktop before having to desperately search man
pages in production.
There are no safeties
About a week into this new job, and assuring our CTO that “It’s cool I can Linux I been doing it for years!” I broke my machine hilariously. Specifically, I ran the command sudo rm -rf . /*
. I quickly realised my mistake and cancelled the command, but by then it was too late -- critical parts of my machine had gone.
Luckily, I was only a week in, and still landing on my feet. But it cost me a day to set my machine back up to something that could develop once again. More generally, this illustrates the point about Linux — there is no safety. No magic recovery mode to help you back on your feet when you do something foolish. Additionally, things do not always come “out of the box” in a good way — notably, Both Debian and Ubuntu ship with no firewalling.
The good parts
Now, with that out the way! Let’s dive into why I put up with the above.
Consistent OS from my Dekstop to your production machine
I know a single operating system (Linux, particularly Debian flavoured) extremely well. I’m not quite pushing work back upstream to the developers of the OS just yet — but I intend to do. This operating system is in extremely wide use; it and the operating system from which it was derived (Unix) currently make up approximately 66.9% of all internet facing computers. Increasingly it is being used to power critical infrastructure such as networking equipment, embedded systems and other bespoke areas of computing. But, more concretely to us, it is the server technology that is used almost ubiquitously to host the stack we specialise in, Magento.
So, I only need to understand a single OS from development right through to production.
Faster development process
Because we run Linux in production, we must reproduce this environment locally to adequately predict how the code will perform in testing and production. There are broadly two approaches I know for doing this:
Run an emulator, which virtualises the Linux machine, or
Run the process in a Sandbox called “Docker”, on the same machine
The latter approach allows the processes to execute much, much faster. Because there is no overhead of virtualising things like memory, CPU and disk space and there is no need to sync files over a shared mount I will be able to build and test a chance 3–4 times faster than if I was using an emulator.
Superior development tooling
As mentioned, Linux has become a system that is becoming increasingly used in critical infrastructure. Because of this, the tools that are used to introspect and understand things that are happening on the computer are excellent, and there is a large and open community that gives away it’s knowledge freely.
Practically speaking, this amounts to being able to investigate issues much more quickly with the same set of tools.
Free Software
The Linux distributions “Debian” and “Ubuntu” are maintained by a community of volunteers, and released under software licenses that are extremely liberal. They and all the software they package is largely free. This works through the paradigm of “open source”, in which we as a community will collectively work together to solve some technical issues, and contribute fixes back to each other.
The software is generally of a good quality, and if it’s not it’s often simple enough to fix.
Entirely Transparent
There are few mysteries when running Linux. It’s source is 100% available on GitHub, and by and large anything strange can be reconciled by reading documentation, or in the worst case, commit messages.
That sort of visibility has become a critical part of my workflow, and I find it stifling when code is obfuscated or compiled and sources hidden.
In Summary
I guess the obvious question at this point is, “Do I recommend that you run Linux as your desktop machine?”. The answer, if you’re a developer, is “Yes”. However, be prepared for some pain. I have been through probably 10 different desktop installations at this point, and several flavours of Linux. I eventually settled on Debian (unstable) as my preferred flavour — but getting this far was quite a journey.
There’s goods and bads to all things. But this is what works for me, and I hope it’s illustrative to you.
Still with me? Awesome! I’m glad you found it interesting. If you’re curious about anything further, or have more general Linux questions we’re always available if you reach out — just hit the “Contact” link
If you’re super excited about the idea of working with Linux as your development machine you sound like just the sort of person we’re interested in paying for you to do some work we have! Check out the “Jobs” link for further information.
I don’t know MacOS very well.