From Windows 7 to Arch Linux

So you’ve gotten quite comfortable with your home which you’ve been living in for the past 5 years. But your life has changed so much that it doesn’t quite fit anymore, even if it does keep you warm just as well as it did before. So many files here and there from when you did this or that, and you don’t even remember what they contain anymore and you don’t have the time to go through every one of them. It’s time to rip everything out and start all over again.

So with some excitement, and maybe just a little wistfulness, you type ‘parted; mklabel gpt’ and wipe your partition table clean.

This wasn’t because Linux had gotten better – oh no. In fact it’s quite the same as it was years ago, when everybody was declaring every year to be the year of the Linux desktop – flaky drivers here and there, small niggling things that require quite a bit of research to get working right, and always the possibility that a package update might break something.

But what’s the alternative? Windows 10 has improvements but you have to flip half a dozen switches (ok, more) to get it to not talk to Microsoft,  and even then, it seems like it still does. I grew up on Windows, but it has gotten so complicated that I don’t know what’s what anymore, and actually I don’t think anyone at Microsoft knows either. How could they? The whole thing has gotten out of control, the Windows directory is at least 20GB with all the patches, you need a SSD to get it to run quickly, and putting a swanky new interface on it that isn’t even applied consistently everywhere just makes it a joke now that I’m using OS X daily.

Then there’s AVG Antivirus, which loves to remind me that I haven’t bought their product. But I don’t have a choice, because any antivirus that’s worth a shit is commercial. Wait, do I still need antivirus? What about spyware, rootkits?

Then there’s the little niggling problem that my workflow on OS X doesn’t translate well over to Windows, not without cygwin. See, I work a lot on the console. And cygwin on Windows is an ugly hack, Linux in a VM on Windows is better, but I still have to remember to fire it up, and then I have to check its IP to ssh into it. But then I can’t use Windows programs to edit files in the VM without setting up a lot of stuff.

Then there’s the fact that I’ve been keeping my pictures/music collection on a ZFS pool for the past two years to prevent bit rot, and I would like not to have to fire up a VM and wait for Samba to announce its NetBIOS hostname when I want to listen to my music anymore.

Gentoo was an obvious first choice. My first foray into Linux was with Gentoo because they had the best documentation. I was familiar with how things While waiting for stuff to compile, I wanted to listen to some music. worked, I wanted to keep track of USE flags to not pull in dependencies, and it was sure to teach me a thing or two today still. Plus compiling things would make great use of my Phenom II X6 (but apparently a Haswell Core i3 can approach its level these days).

I chose an EFI+GPT installation with OpenRC, but apparently the minimal install ISO doesn’t boot in EFI mode, and you can’t really install GRUB2 in EFI mode properly with being already in EFI mode, because you need efivarmgr to edit the EFI variables, which aren’t accessible in BIOS mode. For some reason the Gentoo Handbook, which normally mentions small things like this that make or break the user experience, omitted this little detail. Fortunately all I had to do was temporarily rename the GRUB2 executable to EFIbootShellx64.efi, which my M5A99X EVO always looks for, and I could boot into the system, whereupon I promptly installed GRUB2 properly.

I pored over each config in the kernel sources, compiling a kernel tailored just for my use case and nothing else, that included drivers just for my hardware. I added discard to my /etc/fstab, -march=barcelona to /etc/portage/make.conf, and those zfs packages to /etc/portage/package.accept_keywords. I edited the USE flags and kept them in alphabetical order.

Then I tried to emerge mate.

I had to add all these extra USE flags just to get it to start. It wasn’t my meticulously pruned system anymore, no, it was now a mess. I was forced to accept the reality that GUIs are extremely complex and I just am not willing to deal with the little details of it all. Basically, I had to accept that I wasn’t going to have any control over what went into my system anymore.

Once I had gotten over myself and added the USE flags to make.conf, the emerge failed halfway because libgnome-keyring wasn’t pulled in when it should have been. I found a one year old post about this exact issue on the Gentoo forums. One year old and it still hadn’t been fixed. Report a bug? Get real, I’m still trying to get my desktop up and running here.

Once everything was up and running, I fired up Firefox and went on Youtube to celebrate. But the audio was skipping every second or two. Ugh. I listen to music on my computer all the time, and not having audio work properly was another thorn in the side on top of all these problems I had already which are, admittedly, characteristically Linux. I Googled but nobody had anything concrete. The closest I came was some guy on a forum advocating passing ‘snoop=0’ to the snd_hda_intel module when loading it. I tried it, and it just made the sound not work.

Around this time I started getting issues with the USB ports not being able to assign an address to plugged in USB devices. This did not happen with the Asmedia XHCI controller, only the built in AMD EHCI controlled ports. Weird, but then the GUI wasn’t a priority yet.

Then on the Arch Linux wiki, which had a larger Troubleshooting section than Gentoo’s with slightly more relevant entries, linked to the kernel documentation. Hmm. I have a Realtek ALC892 codec, with a Intel HD Azalia compatible sound system, and an Asus motherboard, so I passed model=asus-mode1 to snd_hda_intel and it worked!

It worked! I was breathing fresh air again – obviously this sort of problem shouldn’t have occured in the first place but that’s what Linux does – it forces you to learn the nitty gritty. I chalked it up to Linux and listened to some Carpenters to soothe my growing annoyance.

At this point I had realized it was taking too long for me to get anywhere, and Gentoo, which was supposed to be lean and mean through CFLAGS and judiciously applied USE flags, was not lean and mean anymore because I had to pull in lots of dependencies for the GUI and I was probably going to pull in a lot more in the future each time I installed graphical software because after all, this is my main desktop, I’m not going to type at the tty on it all the time. Plus, Arch Linux had a much better wiki. I found myself on it all the time when I had a problem even though I was running Gentoo.

So I figured I’d wipe it and install Arch Linux. Having had my patience worn thin, I didn’t bother with the EFI+GPT option this time and went straight for the BIOS+MBR. Installed the base system, everything took less than 20 minutes because I didn’t have to compile anything. Then I booted into the new system without a hitch. Thank god, something finally working out of the box.

Within another hour I had my MATE desktop and Firefox back, a point which took me several hours to reach in Gentoo and a lot of messing with USE flags and wondering if I really wanted this in my system or not (now: who cares). But the USB problem still occurred intermittently, I couldn’t use my mouse, and the audio was skipping again. No problem, I passed ‘model=asus-mode1’ to the snd_hda_intel module. But it didn’t work.

This is Linux all over again, I sighed. What did I expect. Why didn’t I just install Windows 10. My entire weekend is gone, my eyesight probably slipping because I have to spend more time in front of the screen in addition to the time I already do at work… now that I’m older, I really don’t have patience for this shit anymore.

And on top of that, my Realtek 8111E Ethernet just decided not to send any packets, despite bringing the physical link up. And I knew it wasn’t my Linksys WRT54GL, because that thing is solid as a rock – I trust it so completely because it has earned it. So I was stuck without the internet on my main computer, unable to install new packages.

On my Macbook, I decided to read the other documentation pertaining to the HD Audio module. On this page, I found something interesting: position_fix. I had no idea what a LPIB register was, and I wasn’t about to spend time figuring it out. I put in ‘position_fix=1’ and YES! My sound works again!

The networking and USB detection problem, however, was more difficult because there was nothing I could change, no options to tweak. I kept rebooting (thankfully Arch Linux boots in less than 10 seconds) hoping each time that the network would at least work again. It never did. I read a blogpost claiming that the USB overcurrent protection might be causing it, and that I should just unplug the computer for some time and it’ll be right as day. That didn’t work either, and I left it for a good 5 hours.

Finally in sheer frustration I reset the CMOS.

And the next time I booted, everything worked perfectly again! The network, the mouse was showing… oh yes! Now I recalled old Mac zealots recommending to ‘reset the NVRAM’ to prevent weird problems, and similar exhortations from the SGI and Sun SPARC communities. It made sense. The NVRAM in the PC world is called the CMOS, and problems never arise with Windows because everybody writes their BIOS to work with it.

Writing a BIOS is thankless work, so companies tend to test it against Windows and nothing else. I know Fujitsu in particular doesn’t give a fuck – the Primergy RX300 had broken ACPI tables. If a server vendor couldn’t be bothered to test its products rigorously, what about a consumer motherboard vendor that markets itself to gamers?

So now, finally, I have a wonderful setup. It automounts my ZFS pool, runs foobar2000 through WINE, can serve an rsync daemon, runs Dropbox, git, runs the Python and bash scripts that I write on OS X, doesn’t add hidden desktop.ini files to folders, doesn’t automatically put up a firewall on incoming connections, and more importantly, doesn’t talk back to Microsoft. I can ssh into it when I’m not home, and actually get stuff done in Linux, because you can’t get anything done in Windows with just the command line. Also,

And when I sniff the network and find that this computer is sending packets to the internet, I can pinpoint what it is, because I know that this OS isn’t doing anything behind my back. That it’s not doing anything behind my back is EXTREMELY important. For instance, Windows automatically has a firewall on the network interfaces. When I forward a port, and I don’t get a response, I always have to wonder: did I mess up when configuring the router, or is something wrong somewhere? I spent so much time getting so frustrated over this before realizing that Windows has a firewall up by default. I know what’s doing what and what’s set up in which way. In OS X I don’t know what’s doing This is extremely important, twhat most of the time, but I don’t have to because it always works perfectly and has sane, reasonable defaults. Not so with Microsoft.

The Windows era is over. Slowly but surely Microsoft is making it worse and more bloated with each passing incarnation, and only Office is keeping people on that platform. If people aren’t switching to OS X or Linux, they’re certainly doing more of their computing on Android or iOS.

Leave a Reply

Your email address will not be published. Required fields are marked *