Skip to content

Instantly share code, notes, and snippets.

@gtirloni
Last active December 13, 2024 00:20
Show Gist options
  • Save gtirloni/a0191776b41fd634df047ae20625d154 to your computer and use it in GitHub Desktop.
Save gtirloni/a0191776b41fd634df047ae20625d154 to your computer and use it in GitHub Desktop.
Windows WSL2 and Dropbox

This was only tested on Fedora 35 with systemd but should work on any WSL distribution that uses systemd.

Install the Dropbox headless client:

$ cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

Install the Dropbox manager script into your ~/bin folder:

$ wget -O ~/bin/dropbox https://www.dropbox.com/download?dl=packages/dropbox.py
$ chmod +x ~/bin/dropbox

Create a systemd unit to start Dropbox automatically (somehow dropbox autostart has no effect):

$ mkdir -p ~/.local/share/systemd/user
$ cat > ~/.local/share/systemd/user/dropbox.service <<EOF
[Unit]
Description=Dropbox Daemon
After=network.target

[Service]
Type=simple
ExecStart=/home/YOUR_USERNAME_HERE/.dropbox-dist/dropboxd
ExecStop=/bin/kill -HUP $MAINPID
Restart=always

[Install]
WantedBy=multi-user.target
EOF

$ systemctl enable --user dropbox
$ systemctl start --user dropbox

Additionally, configure the download/upload limit:

$ dropbox throttle unlimited unlimited
@insign
Copy link

insign commented Dec 13, 2024

You can use $USER instead YOUR_USERNAME_HERE and maybe needs escape $MAINPID.

BTW, user level not worked for me, this one worked: https://www.linuxbabe.com/ubuntu/install-dropbox-headless-ubuntu-server

But with some changes like the path to dropboxd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment