Imaging VM to sync between desktop and laptop

My setup: I am building a virtualized system using a debian server installation, qemu and PCIe passthrough to virtualize my desktop. Besides this, I have a laptop running arch linux.

The problem: When I want to work on the go or do whatever on my laptop when I’m away, I need to keep my laptop in sync with my desktop (files, i3wm dotfiles,…).

The idea: Since Linux seems pretty portable and I allready have all my VMs on my desktop in raw and qcow2 images I should be able to just Image my laptop on a regular basis and my laptop and desktop would always have the exact same setup. Note that I have SSDs on both my laptop and desktop and the process would simply involve booting an USB stick and imaging over the network.

The questions:
1.: What would be the best way to approach this?
2.: Could I somehow only copy over the difference since my last sync? (Maybe I could make a snapshot every time before copying over to the laptop to find out the difference?)
3.: Is this a stupid idea, if so, why?

Thank you for any responses.

I feel that I understand most of this, but I feel that you may be over complicating this problem or I just can’t wrap my brain around your post. From what I read you want to keep both your virtual machine and your physical laptop as close to a similar state as possible.

Personally, I feel that netbooting your laptop every couple of days and attempting to get those vm images working on your laptop is a crazy idea.

Let’s break this down into smaller chunks…

  • Find a method to store and sync local files (documents, music, etc..)
  • Find a method to easily sync configuration files (.bashrc, dot files, etc…)

Possible Ideas for local files:

  1. Setup and configure an owncloud server to keep your files on, then install the owncloud client on each the vm and laptop to have sync support.

  2. Use a cloud storage offering such as Drive or Dropbox. Though I wouldn’t recommend this and linux support is shoddy.

  3. Utilize SSH, SCP, maybe RSYNC to download and upload files across devices.

Possible Ideas for configuration files:

  1. Utilize SSH, SCP, maybe RSYNC to manually download and upload those configurations across devices, you could configure a script but honestly with some files I don’t see how feasible this is.

  2. Abandon hope for this idea.

A Practical Solution:

Keep the two systems separate, trying to sync them at all times is just asking for headaches and doesn’t make much sense from a productivity point of view.

When using a linux laptop in the work place most of the time I would SSH back to my desktop to perform 99% of my duties via terminal. That way all my files and stuff were in one place.

When working with code, I could ssh to my desktop, git pull the code and work on it, and when I was done I would commit changes and disconnect.

When it came to configuration files like .bashrc I would just go and scp a copy from my desktop and tweak it to make it work for the setup I had on my laptop.

1 Like

Since I’m treating my desktop as a server, I’ve allready used things like ssh to work on the desktop remotely. I currently have an ssh port open so that I can tunnel any port I want over to my laptop. With regards to projects and such, I use git, so that wasn’t really the problem. I was simply looking for a more “automatic” approach to keep my laptop and desktop in sync, especially because I’ve been distro-hopping on my laptop lately.

Thanks for the reply.