Skip to content

Instantly share code, notes, and snippets.

@gtirloni
Last active August 27, 2024 02:44
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
@avtomat2023
Copy link

avtomat2023 commented Jan 25, 2024

This helped me a lot!

systemctl start --user dropbx is a typo of systemctl start --user dropbox.

@alanfzf
Copy link

alanfzf commented Apr 13, 2024

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:
image

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

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