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
This helped me a lot!
systemctl start --user dropbx
is a typo ofsystemctl start --user dropbox
.