Complete desktop synchronisation with Unison and FreeBSD jails (xjails)

Do you find complete desktop synchronisation interesting / useful?


  • Total voters
    9

kbs1

New Member

Thanks: 1
Messages: 1

#1
I am running multiple computers in multiple locations. I always hated syncing them up (syncing my mysql dbs, installed programs and their versions, their configurations), so I shifted to FreeBSD around a year ago. I found jails very useful and was looking for a way to run Xorg in them.

This isn't currently possible without a kernel hack, based on kernel patches found in mailing lists. I just adapted them to latest kernels.

The script here: https://kbs-development.com/download/xjail_install.sh will prepare your vanilla installation for XJAILS, it will configure your system, recompile the kernel, install the base jail (using ezjail), will ask you about xorg conf, simply everyting you need to get up and running.

The script then gives you a choice to either create a new default lxde desktop xjail or sync from existing unison server.

You have the possibility to create multiple xjails, for example one for programming, watching movies etc.

Second important script is https://kbs-development.com/download/xjail_update.sh. You choose one machine that you will do the update on. You will update the host and the basejail, based on script's instructions. You will then sync the changes to the rest of the machines (and only update host kernel on them).

Having this approach is highly benefical in terms that the only thing that must match between the synced computers is that they are able to execute the same instruction set (amd64 etc). All other hardware-specific drivers (video card, sound, chipset, storage....) are simply abstracted to the jail and the system is therefore transferable and functional.

The script will modify your host system in a way that will allow you to log-in into a selected xjail using standard host's system login prompt. For each xjail, a special user account is created and copied to the jail with .profile scripts created on both sides that allow seamless entry into the jail, as if using a local account with local Xorg.

Script displays a prompt each time you enter or exit a jail. This selection allows you to sync the jail to / from server, force (clone) it from / to server (therefore overriding any inappropriate changes you may have made), or in case of serious filesystem damage it allows you to drop the current jail FS on the disk and resync from server.

Main advantage with this sync process is that you are syncing a jail that is not running, therefore it's state can not change during the sync.

There are some directories we do not want to sync. Those are carefully selected and excluded by default (/tmp, /var/run, etc).

It is possible to mount *ANY* local filesystems into the jails that will never be synced (by means of jail's own fstab, which will be unmounted before syncing).

The only downside is that allowing access to /dev/kmem (via kernel patch) voids jails security. Therefore this setup / approach is targeted for personal use only and should not be used on machines where jail security is a must.

EDIT: I have created a github repo: https://github.com/kbs1/freebsd-synced-xjails

I just wanted to share this script and approach here with you, somebody might find this useful / helpful. I am running this setup for 3 months now and it works wonderfully, no more sync issues / "I don't have this on this machine right now" moments! :)
 
Last edited:
A

ASX

Guest


#2
Certainly interesting ... even if I have no plan to use a solution like this, right now. ;)
 
Top