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
I tried to do this, and it previously worked, i think the MS team did some changes to wsl or the kernel and broke something in the process, i can only start dropbox under wsl v1, i installed the v6 kernel, but it didn't seem to have any effect.
I just end up with this:
the only solution i have is to run wsl under v1, but the catch is this version doesn't support systemd at all, if anyone has a fix please let me now