The Problem
I run a Linux machine as my main workstation and occasionally need to access project files from a Windows PC. I also wanted those files backed up to Dropbox without having to manually copy anything or change where my Dropbox folder lives.
The solution I settled on: share the folder over the local network from Linux, give the Linux machine a permanent address so the connection never breaks, map it as a drive on Windows, then trick Dropbox into backing it up by pointing it at that drive.
Files stay on Linux. Windows can read and write them. Dropbox backs everything up automatically without knowing anything unusual is going on.
One thing worth noting: Linux only exposes the one shared folder. It has no access to anything on the Windows machine.
Requirements
- Ubuntu 22.04 or later
- Windows PC with Dropbox installed
- Both machines on the same network
sudoon Linux, Administrator on Windows
Part 1: Set Up the Shared Folder on Linux
Samba is a piece of software that lets Linux speak the same file-sharing language as Windows. When it is running, Windows can browse and access folders on your Linux machine the same way it would access a shared folder on another Windows PC.
Install Samba
Open a terminal on your Linux machine and run:
sudo apt update && sudo apt install -y samba
Create the folder you want to share
mkdir -p ~/Projects
This creates a Projects folder in your home directory. This is the folder Windows will have access to.
Back up the Samba config before editing it
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
Always a good habit before editing system config files.
Add the share definition
This tells Samba which folder to share and who is allowed in:
sudo tee -a /etc/samba/smb.conf > /dev/null << 'EOF'
[Projects]
path = /home/yourusername/Projects
browseable = yes
read only = no
guest ok = no
valid users = yourusername
create mask = 0664
directory mask = 0775
EOF
Replace yourusername with your actual Linux username in both places.
Check the config for errors
testparm -s
If it prints your share definition without any errors you are good to move on.
Set a Samba password
Samba has its own login system separate from your Linux account. You need to create a password that Windows will use when connecting:
sudo smbpasswd -a yourusername
You will be prompted to enter and confirm a password. Write it down, you will need it shortly.
Start Samba
sudo systemctl enable smbd nmbd
sudo systemctl restart smbd nmbd
enable makes it start automatically every time the machine boots. restart starts it right now.
Part 2: Give the Linux Machine a Permanent Address
Every device on your network gets an IP address, which is basically its location on the network, something like 192.168.1.100. By default this address is assigned automatically and can change whenever the machine reconnects.
That is a problem here because the Windows drive mapping you are about to set up will use that address. If it changes, the connection breaks and you have to redo it.
Locking it to a fixed address (called a static IP) solves that permanently.
Find your active connection name
nmcli connection show --active
Look for the connection tied to your network. It will be your Wi-Fi network name or something like Wired connection 1.
Find your current IP address and gateway
ip route show
You are looking for two things:
srcfollowed by a number like192.168.1.100- that is your current IPviafollowed by a number like192.168.1.1- that is your gateway (the router)
Lock in the static IP
sudo nmcli connection modify "YOUR_CONNECTION_NAME" \
ipv4.method manual \
ipv4.addresses 192.168.1.100/24 \
ipv4.gateway 192.168.1.1 \
ipv4.dns "8.8.8.8,8.8.4.4"
Replace YOUR_CONNECTION_NAME with the name from the first step, and use the IP and gateway you found above.
Apply the change
sudo nmcli connection up "YOUR_CONNECTION_NAME"
Your IP address is now permanent and will survive reboots.
Part 3: Map the Shared Folder as a Drive on Windows
Now that Linux is sharing the folder and has a permanent address, you can connect to it from Windows.
Open File Explorer, right-click This PC and select Map network drive.
- Drive letter: pick any letter that is not already in use (I used
J:) - Folder:
\\192.168.1.100\Projects(use your actual Linux IP) - Check Reconnect at sign-in so it reconnects automatically after a restart
Click Finish. When Windows asks for credentials, enter your Linux username and the Samba password you created in Part 1.
The Projects folder will now show up as a drive in File Explorer, just like a USB drive or any other disk.
Part 4: Connect It to Dropbox
The goal here is to make Dropbox back up the Linux Projects folder without moving your Dropbox folder or changing how Dropbox is set up.
The way to do this is with a symbolic link. Think of it like a shortcut, but one that Dropbox cannot tell apart from a real folder. When you create a symbolic link inside your Dropbox folder that points to the network drive, Dropbox sees it as a regular folder and syncs it like anything else.
Windows has a built-in command for this called mklink. It creates these shortcuts from the command line.
There are two types of shortcuts mklink can create: junctions and symbolic links. The difference matters here. Junctions only work with folders physically on your computer’s own drives. Since the Projects folder lives on the Linux machine and comes in through the network, junctions will fail with this error:
Local volumes are required to complete the operation.
Symbolic links work with both local and network paths, so that is what we use.
Open Command Prompt as Administrator (press the Windows key, type cmd, right-click it and choose Run as administrator) and run:
mklink /D "C:\Users\YourWindowsUsername\Dropbox\Personal\Projects" "\\192.168.1.100\Projects"
Replace YourWindowsUsername with your Windows username and adjust the Dropbox path to wherever you want the folder to appear inside Dropbox.
If a folder already exists at that Dropbox path, delete it first.
mklinkcannot overwrite an existing folder.
Once the command runs successfully, open Dropbox in File Explorer. You will see the Projects folder there. Dropbox will treat it as a normal local folder and start syncing it to the cloud.
Quick Reference
| Step | What to do |
|---|---|
| Install Samba | sudo apt install -y samba |
| Add share | Edit /etc/samba/smb.conf |
| Set Samba password | sudo smbpasswd -a username |
| Set static IP | nmcli connection modify ... |
| Map drive on Windows | File Explorer > This PC > Map network drive |
| Dropbox symlink | mklink /D "Dropbox\path" "\\ip\Projects" |
Worth Knowing
Dropbox only syncs when the Linux machine is on and reachable on the network. If it is off, Dropbox will pause syncing for that folder but will not lose any data. It picks back up as soon as the machine comes back online.
If you ever move or rename the Projects folder on Linux, the connection from Windows breaks and you will need to redo the drive mapping and symlink. Treat the folder path as permanent once everything is set up.