Ask HN: How do you keep your multiple workstations in sync?

48 points by rsto ↗ HN
During a regular work week I work a couple of days in a co-working space, the other times either from home or at a client site - and I’m tired of carrying around my laptop all the time.

My dream setup would consist of a couple of low-fi workstations, say a bunch of Intel NUCs or the like, one at each site. Then, whenever I leave in the middle of work at one site, I can go to the other and pick up from there. However, due to sub-optimal internet connectivity I can’t use thin clients with a cloud-based X server. At each work location, I’d need to run my jobs on that machine (either bare metal, or virtualised). Is there a way to e.g. synchronise one virtual machine image across the workstations, when I switch locations? I wouldn’t need to run two workstations at once. Bonus points if a program or configuration, that I install one machine also shows up on the other workstations. I have no special requirements, any Unix-like OS with a window system is OK.

Is anyone of you running such a setup? Or have you found a similar solution? I have that nagging feeling I can’t see the forest for the trees, given that I haven’t with IT setups since 1999. Thanks!

53 comments

[ 0.17 ms ] story [ 102 ms ] thread
I use a Macbook Air and an iMac 5K at work. I keep these synced up heavily with cloud-based solutions like GDrive, Evernote, and VPN access to the hadoop clusters I work with.

Config-wise, I just built a shell script that I ran on both machines to install the same packages and libs I use for work.

For my startup, we use something like this https://github.com/thoughtbot/laptop (modified to our specs of course) to keep our machines all synced up. I'm thinking of using Docker or Vagrant to consistently provision machines with regular updates though. This has to be explored.

The key ones for me that let me leave the laptop at home;

- Outlook: MS Exchange does syncing on email/calendar/tasks (I use Nine for my mobile mail client).

- GDrive: General file storage/accessibility.

- Chrome browser: Sync's our tabs/history. I use Tab Cloud to save sessions across Chrome too.

- One Note: I use this for meeting notes and brain storming.

- Google Keep: I use this like sticky notes thats accessible cross devise.

With this mix I can easily move between my laptops/mobile devices as needed.

syncthing is wonderful.
Yeah, i keep my whole home-folder in sync with syncthing over 3 devices. Even if i am out of my office i stay connected through openvpn, so sync goes on...
+1 Syncthing is super handy for my core files (~10GB) synchronized between all my devices.

It more convenient than cloud storage in that I don't have to worry about sensitive information being stored on remote servers, but obviously is restricted by the storage capacity of each device.

One incredibly simple-minded possibility could be to keep VirtualBox or Qemu VM disk images on a USB HDD, and suspend the VMs to the HDD to move between machines.

Also, since it's better to err on the side of saying something irrelevant than not saying something at all, check out http://xpra.org/.

Yes, the USB image is so simple enough, that I'll just have to give it a try. Didn't know xpra, which could come handy from time to time. thanks.
I'm a UI guy + Rails developer, I own 3 Macs (1 Mini and 2 MBPs). For most of the stuff, I simply use iCloud. For the actual source code of what I work with, I use Google Drive w/ GIT and I CD into it no matter which system I'm working with.

Actually, Macs are quite enjoyable in the sense that everything else is taken care of, by Apple - The App store handles all my software installs and purchases between computers, iTunes handles all my music collection and ensures all 3 Macs have the same tracks (I use Apple Music w/ Match) and iCloud makes sure all my docs are available from any device I use (iPad/iPhone/etc.)

As for browsing and bookmarks, I use Chrome.

Biggest issue I see with syncing system images/full file systems around is that you can't easily do a merge: If you arrive at a new location and for some reason the sync with the latest changes isn't completed yet, you probably wouldn't want to wait for that to complete before you can safely work.

For that reason, I probably would go with only syncing home/data dirs, and maybe doing so explicitly or using something like git-annex. If you want to sync installed packages and system config, maybe force yourself to apply those only with scripts or a config management tool like puppet or ansible.

But there are options to avoid online sync: If your system fits in 1TB or less, you could only carry a external 2,5" SSD (or maybe even just a USB key) around and boot all machines off that. Or even carry an entire NUC, they still are more compact than a laptop.

Ah, the USB key suggested by you and i336_ is beautifully simple! Hadn't thought about that (but did come close by looking at the Compute Stick, which unfortunately is under specced for my requirements). Thanks for this.
Just make sure you back the sticks up. USB sticks have a habit of dying without warning.
Yeah, I thought more like: Using the USB stick to carry round my image, but transferring it onto the local workstation. That might take a couple of minutes during start and end of work at one location, but would give me better performance (and some redundancy).
To build off this, if you use Vagrant, you might not even have to carry the full image around with you, just the setup scripts which can get you to a working environment with a `vagrant up` command.
Git. Also, occasionally doing work with tmux on a Linode. I really like the VM disk image on a USB that some people are suggesting though. And, again, if you used tmux or screen, it would make resuming work easier.
If you don't want to send your unencrypted data to places you do not control - use git-annex for the heavy binaries (photos, PDFs, videos, music) and just sync between your instances. Though git annex can do end-to-end encryption and upload to Dropbox/gdrive as well.

Pure Git is great for consolidating configuration as well as keeping plaintext format files in sync. Invaluable if you are an org-mode or markdown jockey.

Yes, git-annex looks nifty and its prototypical Nomad use case on the website comes close to what I am looking for (lest the system files, executables, etc.)
+1. I ended up using Git for everything. Use a private server, ssh repos, and you have a pretty good end-to-end encryption, and privacy.

I've always wished there was something to help me sync my environments, especially between mac an Linux platforms (just sync my terms, keep the history, stuff like this), but at the end of the day, it forces me to stay clean and close my windows from time to time ...

Oh and I use Chrome with sync feature, and it works awesomely great! - with extensions like LastPass to sync all my accounts. I used to value privacy a lot .. I gave up when I moved to China.

git and tmux are my main tools for multi-site working too.
With windows, Ive done very well with goodsync. It tries very hard to keep things synchronised nicely, including when the connection between clients is patchy.
Unison. Know where your data is. Don't sync oses. Instead, keep their setup in scripts. You can get faster sync if you can say which side is newer by using btrfs snapshot over the network.
google drive to sync documents, normal files, etc.

git for code.

then i have VMs on EC2 for specific tasks.

>tired of carrying a laptop

i solved this with a lighter weight laptop.

you can usually leave your multiple displays wherever you need them, and plug into the laptop.

edit:

looking back, i'm very invested in google's ecosystem of "synced" things: google apps.

it's almost to a 90's microsoft extent -- where i will actively avoid and discourage incompatible formats or platforms.

at the very least you can use any of google's things with an OK computer and an internet connection.

that leaves me wondering what will "obsolete" the "google office"

My company gives employees laptops with cisco anyconnect. It basically punches a VPN back to corporate over ant HTTPS connection it can get its hands on, which means that it can map all of your network drives, citrix apps run fine, etc.

By encouraging everyone to work off network drives, everything tends to stay in sync. Other solutions include having a server-located user data folder (desktop, documents, etc. - but that slows down for regional sites or mobile data if you load it up too much) and horrors like sharepoint or other remote content storage programs (HP records manager, etc.).

For code, I run a git server on a network share and point visual studio at it. My code gets committed to it and I can see it from any device on the network, including via VPN.

All of my machines are linux, so I like to use ansible for it. I can sync my dotfile git repos, configure the OS how I need it, automate syncing vim plugins, get all of the PPAs I need. This doesn't quite solve the problem of half-finished work on one machine being available on a different machine (unless git counts), but at least your systems are now set up identically everywhere you can. One option is to work remoted into a VM somewhere in the cloud very close to you (to minimize latency), I've heard of people doing that.
Swaping ssd with OS and data.
I tried running a home server with data, running a home server and forwarding X from there over ssh, limiting my needs to CLI (tmux, irssi, vim, etc) and running everything on a remote server, using built-in sync for various apps (like notes)...

None of it ever worked well so I bought a nice leather messenger bag and learned to like carrying my laptop around and using the small (13") screen most of the time.

I have a MBP, desktop (Xubuntu), netbook I rarely use (Xubuntu) and Android phone + personal webspace (just use it for a simple wordpress and owncloud+mail accounts). My setup is pretty consumer/not very sophisticated. I recently removed my last Windows VM but will probably create a new one soonish because there's the occasional windows only thing I need to do. That VM is just kept up to date and has antivirus etc. but no synching with the other machines (shared folder with the host)

- GitHub/GitLab

- owncloud with personal "webspace" for data, especially important for Android (+ a photobucket account for images for random funny forum posts)

- Zotero for Firefox (with said owncloud) for my academic work. This is worth its weight in gold. I prefer to work with Latex but you are often forced to use Word/LO and the plugins are amazing (instant citation/bibliography; snapswitch to a different format).

- Thunderbird (and Outlook on OSX, meh but needed/convenient for work would prefer 100% TB)

- Firefox sync (not really using it anymore but probably should)

- KeePass to store my passwords across systems

The overlap between the machines isn't huge and I mostly just keep them up to date. The stuff I use on multiple machines is on the same version if possible but not automated in any way. My personal backup strategy is pretty horrible (I just randomly put important stuff on external storage), I need to up my game there. Not even keeping my configuration files etc. on github as of now (planned for the near future) tl;dr: Need better backups, need scripted os sync

Note: I don't use my phone all that much for stuff I can do on other machines (don't mobile browse a lot). It's mostly an IM/call platform with occasional data use.

I got tired of carrying a laptop around so I get a smaller laptop.

You sound like you would do well with that idea, but maybe it takes the form of an external (e.g. USB) storage device that you store virtual machines on but don't forget about backups. Perhaps you have a script snapshot and rsync diffs between your storage and your machine so that each machine's local storage can also be your backup.

A couple of ideas that don't exactly fit your question but might be relevant to others in a similar position:

- You could buy a more portable laptop that you wouldn't mind carrying around, for example the new Macbook Retina or an MS Surface.

- Even a poor Internet connection might still be good enough for command-line work, and you can get a lot done on the command line. I've had great success keeping all my code and data on a central server, and editing code either directly in command-line Emacs via mosh (https://mosh.mit.edu) or in a local Emacs instance using tramp (http://www.gnu.org/software/tramp/) to save changes directly to the server. This has the advantage that I can start long-running jobs that persist on the server even as I'm moving between locations. For data science work, iPython notebook is also very easy to set up for remote web access.

> You could buy a more portable laptop that you wouldn't mind carrying around, for example the new Macbook Retina or an MS Surface.

Here I think you're setting yourself up for failure. What happens when said laptop is stolen, has a hard drive die, or you forget your encryption key? If it's more convenient for him to have multiple workstations, then why not also make sure he maintains a good practice of having his working data synchronized and therefore backed up?

Sure, everyone using a laptop (or desktop!) should run regular backups. I think that's mostly orthogonal to the portability solutions being discussed here, though. For example, the VM-on-a-USB-stick solution would also require a separate backup mechanism.
TBH: I ask this already owning a MacBook Air 11" :) It's not the weight that bothers me. Cycling with a backpack in summer is sweaty. Carrying it with me when going out after work is both a hassle and a recipe for disaster (I almost forgot my laptop twice in a bar and wasn't even drunk - just distracted).

I work as much as I can on the command line but I have to use some visualisation tools. They are part of the problem: they take time to set up, require constant configuration tweaking and I see myself wasting hours keeping them in sync on my workstations.

I personally can't wait for 1) OSes that can move seamlessly from phone UI to full desktop UI depending on the size of connected screens, and 2) hardware that can handle heavy dev work (multiple VMs, lots of random I/O) that fits in a smartphone form factor and power envelope.

Then sync would no longer be necessary because all you would ever need to use is that 1 unified device.

Until then, I use network shares on a cloud server through VPN for media, and Git and Vagrant/Docker for dev stuff.

I have an X1 Carbon thinkpad. It's not a problem at all to carry around---very light and thin. I have separate mouse+monitor setups in different places (e.g. office, home). So I just plug it in wherever I am. I keep the monitor and mouse plugs right there on the desk(s), so it takes two seconds to plug them in.

I even have mulitple separate power adapters. I have one in my kitchen and another in my bedroom, for instance. They are literally 15 feet away. Totally worth the $70 or whatever since I can easily move back and forth multiple times a day.

Carrying around and dealing with a power adapter is 60 to 70% of the hassle of carrying a laptop and that can mostly be eliminated.

Oh, I also have a separate pair of headphones in each location AND one that always stays in my bookbag.

I've been working on customized EC2 instances, DO droplets and Nitrous (https://pro.nitrous.io) since 2012 and haven't looked back. There is the issue of connectivity, but I'm unproductive without an internet connection so it has worked well for me.

I use tmux and then connect to the session from work, home, etc... and setup ssh config (http://nerderati.com/2011/03/17/simplify-your-life-with-an-s...) so I have shortcuts to all of my remote machines. App environments are built with docker, snapshotted, and pushed to dockerhub.

USB keys are known to be too unreliable in the long run, so my advice is a big STAY AWAY from them; but I can testify an external box, connected via a USB2 / USB3 cord, plus an (Intel 530 series) SSD can do wonders as a portable, full GNU/Linux system (Kubuntu in my case). Boots to desktop in under 1 minute even over USB2 (USB3 is a lot faster), and is very usable despite the USB bottleneck (way better than any USB stick). 120Gb, even after installing a full distro, leaves you with plenty of space to carry along your favorite music, virtual hard drive images, so you can carry along your Windows virtual machine(s) intact, and already configured [1]. You can then use TimeShift (or manual rsync cronjobs) to backup your full system to local drives/USB keys, and sudo apt-get upgrade the system whenever you get a reliable internet connection.

Minor issues I have experienced with this setup:

1. The biggest issue of all is, due to the peculiarity of USB power design, most SSD's might experience failures when the machine is powered off. This is a known issue with USB keys too! Believe me, booting a system every time not knowing if it's going to end in the dreaded fsck mess with thousands of errors really is a nightmare. Going with the Intel 530 series SSD's (which is a known solution) fixed the issue as they have larger capacitors, though Samsung SSD's might be reliable too.

2. USB power: on most laptops, your single USB power cord is unable to power the external drive; you might have to use the popular Y (double connector) USB cable.

3. Stay with open source video drivers. Especially swapping nVidia <-> AMD drivers is a recipe for disaster.

4. Audio HW devices will stack up, possibly resetting their settings when you return to a previous machine.

5. You might sometimes have issues with UEFI when you first boot your system on a new machine.

[6] VirtualBox VM's have sometimes issues when the system unexpectedly swaps eth0<->eth1 interface names, but this is easily fixed in the network configuration before booting them; also swapping AMD and Intel processors is risky, and can unexpectedly hang your Windows system on boot; BTW don't forget to carry along on your external drive every hard disk image they might use, or the VM's won't boot. Of course this applies to Vagrant boxes too, but is less relevant as you can destroy/recreate the box any time.

What exactly do you want to sync? Is there any data, or is it only your environment?

Almost all the ideas so far mention moving the whole thing with you (usb sticks with system or vm), or working remotely (X / mosh / similar).

There's another possibility if you don't require any (or only static-like) data to be migrated - use some system which can be updated / rebuilt in sync. Setup a server salt / chef / puppet and make sure your local machines sync to it periodically. Whenever you need some modification, you have to implement it in your server and push.

Advanced version - implement it over something like NixOS for consistent builds.

Pros: anything fails - just rebuild it (even remotely if you can set up the satellite servers to boot over network); you won't forget your physical media; you can update all machines at once; you can store all configs in a repo with full history; if you need per-site specialisations, templates are great for it

Cons: if you need to sync any large chunks of data, this is not a good idea anymore

I didn't much look into salt/chef, yet. The "anything fails" approach is intriguing, though. Since my data is mostly source and config a central server to serve puppet and cloning my work products from a Git repo would work.

The only drawback I could see is if the "implement [a modification] it in your server and push" would turn out to become a hassle to try out libraries and programs. But that's just me speaking without any hands-on experience with these tools. Thanks.

What about bringing your laptop to work?
Depending on exactly what it is you're doing, maybe keep a master vagrant file that describes your dev environment (and every time you install a new app or modify the env, update the vagrant file accordingly)? Then on each workstation you use, you can just spin up a dev vm from the vagrant file.

That's one way to quickly replicate your env across workstations. Then all you need is git/rsync/btsync + a few bash scripts to keep your data in sync.