Solutions for file sync

Has anyone done anything interesting wrt. to using Incus hosts as development systems?

At work, we need x86_64 for some development, but some of our devs have ARM macOS machines. As we already have Incus, I was thinking of making it easy for them to develop there.

Some of them use terminal-based editors, but I’d prefer to give them file synchronization, so they can edit locally without lag.

I have had very pleasant experiences with https://mutagen.io/ for this purpose, but I also kinda like the simplicity of incus exec and not using SSH at all. I wonder if anyone has played with something in this space? Mutagen over Incus transport would be awesome, and perhaps it can be done with some fancy pipeline socat trick?

Or doing port forwards through the Incus client would also do the trick, like kubectl port-forward.

I am not sure if it is interesting, but SSH and Git work really well for this use case. With SSH you can even get VS Code to seem like it is running locally.

VS Code indeed works very well through SSH. But what I want to do is access SSH through the incus exec tunnel. Once we do that, we could use VS Code over that.

$ cat foo
#!/bin/sh

incus exec foo -- socat stdio tcp:localhost:22
$ socat exec:./foo tcp-listen:2222,reuseaddr,fork

Works… once. Also I’m not sure why I need a separate script. But with that running, I can ssh -p 2222 localhost.

Apparently, making the tcp-listen address go first makes the fork option work properly.

So:

$ cat foo
#!/bin/sh

incus exec foo -- socat stdio tcp:localhost:22
$ socat tcp-listen:2222,reuseaddr,fork exec:./foo

Does a proper port forward.

I think this would be a neat feature :slight_smile:

1 Like

Another option is to use Announcing ssh2incus – ssh into Incus instances It is very flexible and might simplify things a bit.

Ohhh, while I think port forwards over incus exec are really useful, for my specific use case (make something that only works over ssh work with an Incus instance), ssh2incus looks neater.

1 Like