A way to set up a Fedora install exactly like another one?

Hey, so I don’t know how to really describe this. What I want to know is, if there is some way to kind of save all the settings and packages and applets, and panel layouts, all these kinds of things from one Fedora install, and then have a way to just apply that to a fresh one? Basically skipping all the manual setup?

I have read about kickstart, but that appears to be more of an automated installer, installing Fedora and downloading packages. Plus it seems complicated to set up, since I couldn’t find a GUI for doing that.

But what I really want is something that includes stuff like the themes I selected, the way I configured my panel, all the system settings. Basically everything one does manually to a fresh Fedora install to make it feel like I want to.

Is cloning the only option? I think Mint has something like Timeshift, which could, if included, also restore system settings and such right? Is there something like that for Fedora too?

It sounds to me like you want to transfer a Btrfs snapshot of your root filesystem from one PC to another. That should be doable.

The following article details how to manage multiple snapshots of a root filesystem.

What you want to do is similar, except that the different snapshots will be from different PCs rather than from different times.

You should be able to use ssh to transfer the snapshot from one machine to another. So, create the snapshot on machine A, ssh it over to machine B, and then restore it on machine B.

You can do the same thing with a home directory to duplicate per-user settings.

As far as I know, there is no GUI tool to automate this sort of work.

Each install needs to have some unique data.

For example the ssh identity for the system, there are other things that also need to be unique for a secure system.

If you use a btrfs snapshot then every cloned system will appear to be the same system to ssh and that is a security problem.

1 Like

Fedora has Kickstart to perform fully automatic installs of specifically configured systems on multiple machines: Automating the Installation with Kickstart :: Fedora Docs

1 Like

It is not 100% same as your case, but I tried achieving similar goal by using bootc and the https://blue-build.org/ (and Getting started | BlueBuild ).

Essentially image-based OS should provide you the exact image every time you install a system based of that image. My objectives were:

  • My selection of apps (layered and containerized) is installed
  • Certain settings are set through gschema-overrides
  • systemd-homed properly configured to manage my user and its homedir
  • kvm, qemu, libvirt and virt-manager properly configured

User creation, user settings and files were out of scope as I decided to rely on systemd-homed managed user on an external drive (those handy Framework external storage modules), which can be automatically mounted by systemd-homed on boot.

My attempt was partially successful, I manged to get my apps layered/installed, but I was uncomfortable storing important and sensitive stuff (e.g., systemd-homed keys for my user encrypted homedir) on the GitHub for all this to work properly. For example the build file of blue-build has this chezmoi module, which can install, initialize and update your dotfiles (user settings) stored on GitHub. I dropped the idea of having personalized OS image for now, I want the bootc to mature and get to the point to be useful for a regular experienced user.

I understand that my reply did not answer your question, I just shared bootc based perspective to deliver reproducible system and my experience with it.

1 Like

But does that include all the system settings you changed? All the other stuff you configured, like the panel, which widgets get installed and put where on it? And is there some kind of tool to create such a file with?

Those theme settings are scattered in different files for various widgets and apps under your home directory. The only sure way to get all the settings for all the apps is to copy the whole home directory.

Yes, any tool that can make a copy of your home directory. :slightly_smiling_face:

1 Like

So if I install the same version and copy the contents of /home everything is going to like the old one?

As long as you don’t install any additional software packages yes. If you do install additional software packages, you’ll have to repeat that before copying /home. Also, if you change any global package settings by editing any of the config files under /etc, then you’ll need to manually repeat those customizations.

Also beware that the ownership of the files under /home will need to be matched with accounts that actually exist on the new machine. If you’ve only created one initial user on each machine, then the files will probably end up being owned by the right user (the initial user usually gets User ID 1000), but if you have multiple accounts on the machines, then things can get more complicated.

1 Like

So let’s see if I got that straight.

  1. install the same version of the OS.
  2. generate a list of installed packages on source
  3. install the same packages on destination
  4. make sure the user has the same name and ID on both installs
  5. copy /home and /etc folders

That is it?

Yes, that should work for most cases. There could be some state stored under /var as well, but it is somewhat unlikely. If you created a database, for example, they typically store their data under /var. There are a few other uncommon things there as well such as cron jobs or local mail spools. There probably isn’t going to be anything under /var that you really need to worry about if it is a “fresh” installation anyway.

Of course, it is also possible for things to accumulate under other paths as well such as /opt (third-party software like Google Chrome), /srv, /usr/local/bin, etc. But those are much less common. If you want to be sure everything is the same, you would need to clone the whole system, but the steps you outlined should work in the common case.

Also, depending on how exactly you transfer the /home and /etc content, you might need to run sudo restorecon -rv /etc and sudo restorecon -rv /home once after you copied them to be sure the SELinux permissions are correct on the files.

1 Like

I do not personally know of any app or command which may do this, therefore doing it manually would take more than just setting them normally.


Still, there’s this stuff too:

I cannot remember if any of the unique identity files live in /etc.
So a copy of /etc may lead to surprises. But as In say I cannot recall is the identity files are in /etc.

I recently stumbled across this tool:

which claims it can do that. But I have not (yet) tried it, so I have no idea how well it works.

/etc/machine-id is at least one!

It would be nice to have to tool that kept track of any settings you changed and any programs you installed so that could be duplicated on another system, but I’m not aware of one.

Another option you could consider is something like CloneZilla. It makes a clone of your whole disk and saves it on another disk or the network. You could then restore that image to the new system and you would have a 100% clone of everything. Then you would want to go in and update a few things such as set a unique network hostname. It doesn’t just back up settings and programs installed, it backs up everything but it might accomplish your goal.

I’d be very interested to learn the outcome of doing the cloning and re-cloning thing, too. Especially in the case where the disks and other hardware are all the same size, make, and model.

It seems to me that some things that might fail are those that tie to a TPM or MAC address, etc. I’m just wondering how much of that there is and how easily any of those adjustments were to track down and modify appropriately.

OP, please let us know what you learn if you try this method.

Hey Folks … been a while … :slight_smile:

Really old-school way …..

I have had the situation where I have had to make 100’s of clones of a “Golden Install” …

The disks were all the same size, manufacturer and model, basically ordered several hundred of the same disk …..

Now, before anyone goes sideways .. :slight_smile: 1) the method worked 2) there are some minor adjustments you have to do on each clone …. so …….

The destination machines were all pretty much the same model, but do not have to be ….

All the machines were set to UEFI and secure boot ….. no proprietary video cards (all were plain old Intel)

All the machines had USB 3.0 or better, so disk duplication speed was quite fast, around 400MB/s

To take advantage of having multiple machines at my disposal, I used multiple adapters and machine to do the cloning in parallel using clones of clones …..

  1. build the initial disk/machine

  2. reboot using live-usb

  3. clone the internal disk to an external, USB connected disk

  4. reboot on internal disk, connect another external USB disk and clone the other external USB disk to new disk via ….

I used dd to do the duplication ….. dd if=/dev/{source_disk} of=/dev/{destination_disk} bs=8192

The source disk in this case was a disk that I did the initial install as an internal disk in the machine.

The destination disk was a brand new disk of exactly the same model,type,mfg ….. connected to the same machine via another USB adapter.

Changes needed on the clone:

  1. network setup unless you are using DHCP to boot

  2. hostname IF you gave the original machine one

  3. boot target if not the same on the destination machine (done via BIOS usually)

All of the machines are still in use and have been since Fedora 38, doing in-place OS upgrades via dnf … now they are all in the process of upgrading to Fedora 43 ….. No issues to date :slight_smile:

Glad the clones work for your use case, but others may not be as successful if they depend on the files that are expected to be unique, but are the same for your fleet. ssh host ID, machine ID and others.

Hi Barry,

Yup, ssh host key would need to be regenerated (forgot that one :-))

sudo ssh-keygen -A

As for hostid, if the file /etc/hostid does not exist, the hostid is usually derived from the first IPV4 of the machine address but, it can also be set via sethostid.

Haven’t come across machine ID or any others on a Vanilla Fedora/Linux install so far ….. :slight_smile: