Resilio Sync on Chromebook (Linux 'Crostini' container)
Using Resilio Sync on Chromebook (using the ‘Crostini’ Linux container)
Resilio Sync is available on Chromebook as an Android app (via the Google Play Store), which is great, but:
for some reason, if I modify a synchronized file using a Linux application (running in the excellent Crostini Linux application container), the Resilio Sync app doesn’t seem to detect the change, and doesn’t propagate the changes to the other computers
the Android app does not have all the features, such as easily visible logs, as provided by the ‘web browser’ interface which operates on Linux/Windows computers.
‘Resilio Sync’ for Linux can be operated inside a Chromebook ‘Crostini’ container!
Details on the how to ‘start’/use Crostini can be found elsewhere.
Starting Resilio Sync on Crostini’s ‘Debian’ container can be found on Resilio Sync’s help pages.
In summary
- Add Resilio Sync repository
echo "deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free" | sudo tee /etc/apt/sources.list.d/resilio-sync.list
- Add Resilio Sync public key
On newer distributions:
wget -qO- https://linux-packages.resilio.com/resilio-sync/key.asc | sudo tee /etc/apt/trusted.gpg.d/resilio-sync.asc > /dev/null 2>&1
On older distributions:
curl -L https://linux-packages.resilio.com/resilio-sync/key.asc | sudo apt-key add
I previously used the instructions on Leon’s blog
wget -qO - https://linux-packages.resilio.com/resilio-sync/key.asc | sudo apt-key add -
- Update the repositories
sudo apt-get update
- Install Resilio Sync
sudo apt-get install -y resilio-sync
- Ensure that Resilio Sync is auto-started (at least when a container is started)
sudo systemctl enable resilio-sync
Sync’s web-interface is immediately accessible with the Chromebook’s
own ‘Chrome’ web-browser at https://127.0.0.1:8888
(with an invalid certificate).
By default, the ‘Sync’ service is started by the rslsync
user. The rslsync
user is created
with a rslsync
group. There will be a
directory named /home/rslsync
, which I think is the best place for synchronized
files (which will have the owner rslsync.rslsync
) to be placed. (The actual location
of synchronized files is determined when adding synchronized directories with
the web interface).
My ‘Crostini’ Linux user has a different name e.g. frieda
.
How do I ensure that the ‘normal’ Linux user can read/write the synchronized files
which are in directories which have the rslsync.rslsync
owner?
The Sync help web-pages suggest adding the rslsync
group to the frieda
user etc. will help.
sudo usermod -aG frieda rslsync
sudo usermod -aG rslsync frieda
sudo chmod g+rw /home/rslsync
I didn’t find that was enough. What worked eventually for me was
adding user permissions to the /home/rslsync
folder
sudo setfacl -R -m "u:frieda:rwx" /home/rslsync
Using Resilio Sync on Chromebook Linux (Crsotini) as a regular user
Some posts suggest running Sync as a local user instead, then placing the sync folder in the user’s home directory, and adding rslsync user permissions to that sync folder in the user’s home directory.
A method which worked well for me is described in the Forked, which
suggests that the method recommended on the Resilio Sync website is wrong to
recommend directly editing the file /usr/lib/systemd/user/resilio-sync.service
.
The reason is that file belongs to the Resilio Sync package, and will be
over-written when the package is updated.
Instead, Debian/systemd systems should use systemd drop-ins to modify the service’s behaviour. These drop-ins overlay the systemd unit settings.
This is the suggested routine by Forked.
# Disable default service used to run as `rslsync` user
sudo systemctl stop resilio-sync.service
sudo systemctl disable resilio-sync.service
# Create a drop-in. Notice omitted sudo below this point.
systemctl --user edit resilio-sync.service
# At this point you'll get an editor opened where you need to
# add two following lines which will replace in initial unit file:
# [Install]
# WantedBy=default.target
# Now enable and start service as the current user.
systemctl --user enable resilio-sync
systemctl --user start resilio-sync
All further commands to the Resilio Sync service should be issued with
systemctl --user
without using ‘sudo’. The configuration file for the user
Resilio Sync service can be found in ~/.config/resilio-sync
.
This method suggested by Forked appears to be working well on my Asus CX9 Chromebook.