Ask Hackaday: How Do You Distro Hop?

If you read “Jenny’s Daily Drivers” or “Linux Fu” here on Hackaday, you know we like Linux. Jenny’s series, especially, always points out things I want to try on different distributions. However, I have a real tendency not to change my distro, especially on my main computer. Yet I know people “distro hop” all the time. My question to you? How do you do it?

The Easy but Often Wrong Answer

Sure, there’s an easy answer. Keep your /home directory on a separate disk and just use it with a new boot image. Sounds easy. But the truth is, it isn’t that easy. I suppose if you don’t do much with your system, that might work. But even if you don’t customize things at the root level, you still have problems if you change desktop environments or even versions of desktop environments. Configuration files change over time. Good luck if you want to switch to and from distros that are philosophically different, like systemd vs old-school init; apparmor vs SELinux. So it isn’t always as simple as just pointing a new distro at your home directory.

One thing I’ve done to try out new things is to use a virtual machine. That’s easy these days. But it isn’t satisfying if your goal is to really switch to a new distro as your daily driver.

The Reason

Not a cuddly logo, but a good distro nonetheless.

The reason this came up is that I generally like KDE and was using Kubuntu for a number of years. They tend to lag a bit on the KDE desktop, so when KDE came out with Neon, I was sold. However, since they were both based on Ubuntu/Debian, there was a mostly working upgrade path to convert a Kubuntu installation to Neon.

Fast forward to today. Neon has been suffering lately. I hear there is one volunteer keeping it running. KDE has decided to shift focus to a new distro that does things I’m not crazy about (immutable system; Wayland). So it was time to hop again.

I’d heard that OpenSUSE was good at keeping up with KDE, and the rolling release of Tumbleweed appeals to me. So I made the switch.

The Hard Way

I am in no way suggesting you do this. It was a bad idea, and while it worked, it was a lot of effort. Even so, it only worked because I have way more disk storage than I need: my root file system is way under 3 TB, and I have about 9 TB of RAID as my primary hard drive. Of course, you should be backed up. But if you’ve ever had to restore from a backup, you know that’s no fun. Better to have it and not need it.

So what did I do? I used kvm to stand up a virtual machine, and then I installed Tumbleweed on it. I turned off the btrfs features since I didn’t plan to use them. Then I set about matching my Neon desktop. All the KDE settings. All the strange systemd services and timers I have set up. The systems I use to run my own dynamic DNS. As much of everything as I could think of.

I got to the point where working in the VM was comfortable. My browsers and all my other tools were ready and configured.

You know I forgot something. I knew too, so I wanted to save things for reference. First, I booted from a live image and made a copy of my entire root file system under /NEON. Then I rebooted and created a new virtual machine and booted a “live” ISO file on it.

A Hard Day’s Night

The next step was to copy the snapshot of the /NEON directory into the VM. Sure, I could have used LVM snapshots or, if I were still using btrfs, a snapshot from that. But I have plenty of disk space, especially after pruning off some very large directories from the copy.

The key to this, by the way, is using the nbd program to mount the VM’s disk image. You do need the nbd module loaded, if you have it as a module, and then you export it using nbd. From there, you get a device you can mount just like any other. I’d explain it, but you really shouldn’t be taking this as instructions. Still, if you need to do it, [shamil] has a good, concise explanation.

Of course, the new VM won’t boot. You have to bind mount all the running directories (like /run and /proc) to the right mountpoint and then chroot into the mounted file system. Once there, you can rebuild your init image and run grub. After that, you should be able to boot into the old Neon system in the new VM.

The Beauty of It…

It has been a while since I’ve installed Linux from a CD, but you still have an ISO file.

So at this point, I had not made any changes to my main OS. I had a copy of it for backup purposes, and I was able to boot into a clone of it using a VM. I could also boot into the target system with a different VM.

The next step was to boot to a live image again and nuke nearly everything on the root file system except for /NEON, and the VMs, of course, which were on separate drives.

I thought about running the Tumbleweed installer and then copying files from the VM, but instead I decided to just do it by hand. I copied the files from the new VM over to the real root drive, using nbd again. Then I had to do the whole bind/mount/chroot/reinstall steps again.

Did It Boot?

It did, in fact, boot up. There were a few glitches, mostly due to self-inflicted problems. When I restored some large directories and some SSD-based temporary directories, I created some SELinux problems that were fun to track down. I had, of course, forgotten a few things installed deeply, too. But that wasn’t a problem. I could still go grab stuff from /NEON or even boot the Neon install up in the VM to compare things.

I am about to the point where I will delete the extra copies of things. I’ve already released the Tumbleweed VM. But it occurs to me: I won’t do this again. That leads to my question for you. If you distro hop, how do you do it? Let us know in the comments. Then again, current thinking is to have a minimal system and then put everything in its own container anyway.

Again, I beg you, don’t follow my example. This was way too much work and risk. But I’m also crazy enough to relocate /usr.

7 thoughts on “Ask Hackaday: How Do You Distro Hop?

  1. My home ‘data’ is on a home server. The other machines /home folder is periodically backed up to it. So changing desktops/laptops/SBCs to a new distro would be no big deal — IF (big if) I want to do so. That said I run LTS versions for a reason. One gets tired of installing an OS every 6 months or year when you got lots of machines…. Plus, I don’t like distro hopping anymore… that’s a ‘been done’. Realized a few years ago that Linux … is Linux… so I stay with a reputable distro. I ‘use’ the applications on the Linux OS now instead of ‘deep dive’ the Linux OS proper (building kernels, caring about scheduling, etc.) . I mean, as long it runs Firefox, Thunderbird, FreeCad, KiCad, run ssh, sftp, run compilers, cross compilers, allows me to print, etc. and is ultra stable, I am happy. The OS is just a means to an end. Right now KUbuntu LTS makes it all happen. Oh, and the home server(s) runs headless…. It just needs a ssh interface to keep it in good shape. Once in a few years, the server(s) gets upgraded to latest LTS (sometimes with new hardware upgrade). Since the data drives on the server are separate from OS drive, it doesn’t take long to install, and then final step to setup fstab to point to the old mount points and setup nfs. Simple.

    Note, to try a new distro for fun, I simply install it in a VM. Note I keep latest Fedora in a VM because I have a soft spot for it.

  2. Approach with the least brain damage for me: nuke everything from orbit and start again. Have screen shots or copies of config files, for future re-configuring use, and copy over any data files etc., but that’s it.

  3. I distro hop via laptops. I’m a desktop as my primary computer person. Laptops are for travel or occasionally using computing resources on the couch. So I usually try out different things on a laptop. That said, like the current top comment on this post – I settled on Fedora a LONG, LONG time ago. (I have been using it as my main since it came out in 2003). Linux has settled to the point where I don’t generally look forward to new releases unless I need the latest compiler (and there are easy ways around that with containers nowadays). It JUST WORKS and that’s all I want in a computer nowadays.

  4. i do the opposite of distro hopping…i always use debian (devuan) unstable, and just roll with the piecemeal upgrades as they wash over me. When apt wedges itself, i always seem to have more stubbornness than it takes to get through it. i had a debian install that lasted about 15 years before i reinstalled in 2019 to switch to amd64…which still seems new to me :) One way or the other, i buy new laptops often enough that i am pretty good at getting a new install up from scratch but i’ve never reinstalled on a laptop after that first go, still use an i386 (32-bit) install on a 2010 laptop that just won’t quit.

    When i did reinstall, i kept a copy of my old root partition (wasting 72GB doesn’t mean what it used to) just so i could dig up config files. Still have my old pre-amd64 root sitting around. And i keep media and /home rigidly segregated from the OS install, of course.

    i can’t see myself staging in a VM like AI Williams did…the touchy parts for me are always things that wouldn’t translate into a VM very well. On laptops, i always have to remember a few key changes in /etc/acpi and how to set up /etc/wireguard, and on my ‘main PC’ (headless), there’s just a bunch of random stuff…firewall, wireguard, openvpn, httpd, nfsd, named, a random piece of bespoke hardware on one of the USB ports, all sorts of things…none of which makes any particular sense under a VM. Like, i could run the httpd server under the VM but i wouldn’t want my diverse clients sending API calls to a temporary/VM instance. So there’s just a little bit of a mad dash to get core functionality working whenever i do reinstall.

    As for my GUI config, i just copy and customize .xinitrc, .fvwm2rc, and a very small pile of ~/bin/ helpers, like it always has been for 30 years :) In modernity, i also copy .mpv/config/input.conf too.

    i’ve switched to using an almost entirely-uncustomized chrome install under a VM, which i think is a better situation than trying to customize it but failing

  5. For me distro hopping trying to bring your previous ‘ideal system’ isn’t worth the effort really I’ll run a system for years, usually a rolling release like Tumbleweed and when I want to try something else I’ll really try something else – so all the config files etc get nuked keeping only the important data in /home (which mostly lives on a NAS in reality anyway) or its installed to a new drive entirely – usually leave it long enough the drive speed, size and price make the upgrade worth it even on otherwise the same system…

    For me if you are going to distro hop you really want to just immerse yourself in that distro’s default way of doing things, find you really like and hate certain elements of their default setups. Only way you’ll learn some things are really useful/annoying to you is to actually have somebody else’s idea of what an OS should be.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.