I have a laptop PC that I use for everyday tasks. I mainly use my PC for software development (so lots of git repos + IDE + development tools), browsing... lots of different stuff actually. I'm using Debian testing with almost all software coming from package repositories (apt).
I would like to build another system (a desktop PC, same CPU architecture, i.e. amd64) that shall have the same data and system configuration: that is, I would like to seamlessly (not necessarily in real time though) switch from the laptop to the desktop (and back) and continue my work there.
I did some research and I found several challenges:
- different hardware configuration might lead to some stuff being different (kernel version and/or modules, /etc/modprobe.d, /etc/modules-load.d and so on)
- not everything in the system state might be reflected by the file system (unless I sync a "cold state", e.g. during boot and shutdown)
- conflict management
- if the sync is done during boot, what to do if it fails?
- how to handle installed packages? (i.e. via "manifest files" + redo installs/removals vs sync the actual package contents in the file system + /var/lib/dpkg)
I don't need version tracking, just that the two systems are in sync at some point in time (with possibly only one of them being active at any given time - a third "bridge" system would be needed of course).
Some thoughts, off the top of my head:
- maybe handle user data (e.g. /home) and the system (/usr, /var, /etc) with separate tools (I'm thinking git vs rsync)
- near-realtime sync ("hot" sync) vs sync on boot/shutdown ("cold" sync - probably safer?)
- system-dependant and ephemeral stuff should be excluded somehow
I don't want to use remote desktop: the purpose of this exercise is also disaster recovery, so both systems should be ready to use at a moment's notice.
Of course classic configuration management tools (Puppet, Ansible, etc.) are not suitable for this IMHO because the state of the system changes often (because it's a personal computer for personal use).
Am I overengineering it?