Please help: where is config.xml

All the help says to change the ip address for the gui in config.xml. I cannot for the life of me FIND config.xml anywhere sane on Ubuntu 22.

Be super obvious: where is it?

Why isn’t there a reasonable install and config script?

Everyone says there is a .config folder under my home folders. There is NOT. I have run Syncthing. That is supposed to create the folder. It did not. I feel like there is a big disconnect in the documentation and all the advice on the internet.

So I found it via syncthing -paths

This I found through a somewhat unrelated internet search. This seems not be mentioned anywhere in documentation.

But, I’ve update the address per documentation. Now what? How do I actually access the gui after I start Syncthing?

Then I’ll get the systemd settings setup…

First paragraph (synopsis) here:

https://docs.syncthing.net/users/config.html

Open a webbrowser and enter http://[the IP you have configured]:8384. That’s it.

https://docs.syncthing.net/users/syncthing.html#cmdoption-paths

This command line switch is also documented. Are you on a headless machine? Usually the GUI opens in a browser window when you start Syncthing (manually, not from systemd). There you can see the used paths as well in the About dialog. Or just use the integrated settings GUI to change the address, so you don’t even need to edit config.xml at all.

If you’re reaching a headless device via SSH, you can also simply forward the GUI port over that connection. It’s even more secure to keep it restricted to localhost and use the SSH tunnel, if the host is publicly exposed.

1 Like

Would like to know how to forward the gui through ssh. SSH is a good way.

In any case, I got it. Found the config.xml. Updated it.

Started Syncthing gui. Added the reciprocal device IDs.

Added a login and password to the gui.

Synced all the directories!

Now I’ll add the config for init style process management from the Digital Ocean website suggestions.

Well, I guess no one uses Upstart any more. Sheesh, Linux… So, I’ll setup systemD.

I can’t get systemctl to start the service using systemd.

I put the file from the git repo into /etc/systemd/system

This is the file called syncthing@.service

Do I need to edit this file in any way…

I then ran systemctl enable syncthing@root.service which responded with:

Created symlink /etc/systemd/system/multi-user.target.wants/syncthing@root.service → /etc/systemd/system/syncthing@.service

The file or a symlink to it is in the target directory.

I then ran: systemctl start syncthing@root.service

There was no response to this at all.

ps shows that the service is not running.

Running systemctl status syncthing@myuser.service resulted in repeated appearances of failure:

syncthing@myuser.service - Syncthing - Open Source Continuous File Synchronization for>
     Loaded: loaded (/etc/systemd/system/syncthing@.service; disabled; preset: enabled)
     Active: inactive (dead)
       Docs: man:syncthing(1)

I can’t figure out how to diagnose this.

yes, I know I am sinning by using a root account. This is just a Digital Ocean VPS (one step up from minimal). All it will be used for is Syncthing and to store copies of the sync’ed directories

Once I get everything working I can become a good Boy Scout.

This might help regarding SSH tunnel setup: SSH Tunneling — Syncthing documentation

It’s talking about routing the actual syncing traffic through SSH, but the ssh -L ... option works just the same for the GUI port.

Depends on how you installed Syncthing, but for example out Debian package bundles ready made systemd config files that you just need to enable: Starting Syncthing Automatically — Syncthing documentation

Check systemctl status syncthing@root.service?

I haven’t been able to get the recommendations in Starting Syncthing Automatically, following the advice for systemd, to work. Way too opaque; too many changes; configuration very complex and unclear.

I will look at the GUI via ssh section…

The SSH tunneling thing is way too complicated. I already edited the ip address for the gui and that works.

At this point the automatic startup is just a mess.

Systemd seems to involuted.

Ubuntu doesn’t support Upstart any more (not available on apt).

What should I try instead?

At this point I’ll just start it manually…

For security reasons, configure a firewall to limit connections to Syncthing’s GUI port if the username and password aren’t sufficiently hard to guess.

As for SSH tunneling, the command-line syntax is really straight forward. If you’re using OpenSSH for Linux, macOS or Windows:

ssh -L <local_port>:<server_address>:<server_port> <remote_address>

So, to avoid conflicting with a local instance of Syncthing, if you choose local port 48384 for one end of the SSH tunnel, keep Syncthing’s default of 127.0.0.1:8384 on your VPS, and your VPS is located at IP address 1.2.3.4:

ssh -L 48384:127.0.0.1:8384 1.2.3.4

Then fire up a local web browser and point it at http://127.0.0.1:4834/

You can also get fancy with a desktop shortcut, using PuTTY, or some other compatible SSH client with a GUI.

Ubuntu 22 – I’m guessing it’s 22.04 LTS – ships a fairly dated version of Syncthing (1.18.0), but whether you’re using Ubuntu’s repo or Syncthing’s repo, both packages already bundle a ready-to-use systemd unit file, so no need to add one from Syncthing’s Git repo.

In an earlier post, you mentioned using the command systemctl status syncthing@myuser.service but had also said that you’re temporarily running Syncthing as root for your initial setup, so I’m assuming the “myuser” wasn’t literal. But if it was literal, it explains the line from the output you posted:

     Loaded: loaded (/etc/systemd/system/syncthing@.service; disabled; preset: enabled)

The output above says “disabled;”, meaning that either the service hadn’t been enabled, or there was no matching service enabled.

Although systemd can have a fairly steep learning curve for users coming from init, RC or Upstart, majority of the time just a handful of commands are all that’s needed: enable, disable, start, stop, status.

It takes at most two steps to enable a service for autostart, and to start it immediately without a reboot:

  1. systemctl enable syncthing@root.service
  2. systemctl start syncthing@root.service

Can also combine steps 1 + 2 in a single shot:

systemctl --now enable syncthing@root.service

Using enable is only required if you want systemd to autostart the service at system boot. Otherwise start and stop can be used any time either manually, via a cron job, etc.

Service status check:

systemctl status syncthing@root.service

At this point, the syntax for stop and disable hopefully should be obvious. :smirk:

Upstart was discontinued just over 10 years ago (Sept 4, 2014), so it’s not going to be available in the newer official Ubuntu releases.

Don’t give up on systemd just yet – it’s really much easier than it seems.

I have two recommendations:

  1. Remove the syncthing@.service systemd unit file you got from the Git repo to avoid confusion with the ones bundled with Ubuntu and Synthing’s DEB packages.
  2. Before installing a systemd unit downloaded from somewhere on the internet, always review the list of services that are already installed via the following command: systemctl --type=service

It’s rare for network services software intended for a Linux system running systemd to not bundle a service unit file. And even when it is, one of the existing unit files can be used as a template for a custom one as needed.

Unless you’re frequently rebooting your VPS, a manual start isn’t a bad idea.

On my server, I autostart Syncthing on a time delay (i.e. via a separate syncthing.timer unit file) to allow any boot time filesystem repairs or other tasks to do their thing first.

1 Like

I didn’t see syncthing unit file when I looked, but I may have looked in the wrong place. Could apt provide a “package” of unit files?

By the way, I must say that none this really has to do with Syncthing. Syncthing is great and I got it working quite quickly and satisfactorily.

So, it’s really unfortunate to be posting all this on the Syncthing forum because they are stuck documenting configuration details of the environments where they run–in some sense, not their problem.

It’s possible, but I don’t recall ever seeing a package of just a variety systemd unit files. In most cases a unit file is bundled with an app, but there are some packages that contain only special-purpose unit files (e.g. time sync without a dedicated daemon).

Yup. Plenty of earlier form posts have involved some pretty complex setups with Syncthing being just one component and not even really being the reason for needing help. Some past posts haven’t even about Syncthing at all, just someone hoping to get a quick answer/solution with minimal effort.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.