Webpage for the University of Chicago Data Science Clinic
Hosted on GitHub Pages — Theme by orderedlist
This document contains instructions for making your Box folder usable from WSL. Mac users do not need it – Box Drive syncs to ~/Library/CloudStorage/Box-Box/ and works out of the box.
Windows needs extra work for two reasons:
/mnt/c/... path. Box Drive creates Box as a Windows reparse point rather than a normal folder, and WSL cannot follow it.The second point is the one that causes confusion, because the failure looks like a broken disk rather than a configuration problem:
$ ls /mnt/c/Users/YOUR_WINDOWS_USERNAME/Box
ls: cannot access '/mnt/c/Users/YOUR_WINDOWS_USERNAME/Box': Input/output error
Docker fails the same way, which means a DATA_DIR pointed at /mnt/c/... will never work:
docker: Error response from daemon: stating /mnt/c/Users/YOUR_WINDOWS_USERNAME/Box: input/output error
The fix is to mount the Box folder directly at its own mount point, which bypasses the reparse point entirely.
Download Box Drive and install the Windows version. Do not try to install Box inside Ubuntu. Sign in with your CNET.
Box Drive will sync your files to:
C:\Users\YOUR_WINDOWS_USERNAME\Box
YOUR_WINDOWS_USERNAME is your Windows username, which is frequently not the same as the username you chose when setting up WSL. If you are not sure what it is, open your terminal and run:
ls /mnt/c/Users/
Your Windows username will be one of the entries listed.
Before making anything permanent, confirm that mounting works. In your WSL terminal, substituting your Windows username:
sudo mkdir -p /mnt/Box
sudo mount -t drvfs 'C:\Users\YOUR_WINDOWS_USERNAME\Box' /mnt/Box
ls /mnt/Box
If this lists your Box folders, continue to the next step. If it does not, see troubleshooting below.
The mount from step 2 disappears when WSL restarts. To make it persist:
Make sure /etc/wsl.conf contains the following. You will need to edit it with sudo, for example sudo nano /etc/wsl.conf:
[boot]
systemd=true
[automount]
enabled = true
mountFsTab = true
Add this line to /etc/fstab, again substituting your Windows username:
C:\Users\YOUR_WINDOWS_USERNAME\Box /mnt/Box drvfs defaults,nofail,x-systemd.automount 0 0
Shut WSL down completely from PowerShell, then reopen your terminal so the new settings take effect:
wsl --shutdown
Open your terminal and confirm all four of the following work.
List your Box folder:
ls /mnt/Box
Read the contents of a real file. This step matters: Box only downloads files on demand, so a successful ls does not prove the file itself is actually available. In the Box web app, create a text file named clinic-test.txt in your top-level folder containing the word hello, then read it from the terminal:
cat /mnt/Box/clinic-test.txt
This should print hello rather than an error.
Confirm Docker can read it, since this is how your project will actually reach the data:
docker run --rm -v /mnt/Box:/data alpine cat /data/clinic-test.txt
Confirm writes sync back up. Create a file from the terminal, then check that it appears in the Box web app:
echo "hello again" > /mnt/Box/clinic-test-2.txt
Once all four work, you can delete both test files.
DATA_DIRProjects generated from the clinic template read their data through a DATA_DIR variable in the project’s .env file. Point it at your project’s folder under /mnt/Box:
DATA_DIR=/mnt/Box/dsi-core/11th-hour/your-project
Your mentor will tell you the exact folder for your project. Note that teammates on Mac will have a different path in their own .env; this is expected, since .env is deliberately not committed to the repository.
Input/output error when listing /mnt/BoxBox Drive is probably not running. Check for the Box icon in the Windows system tray and confirm you are signed in, then try ls /mnt/Box again.
mount: /mnt/Box: wrong fs type, bad option, bad superblock...The path you gave to mount does not exist on the Windows side. Double-check your Windows username with ls /mnt/c/Users/, and confirm the Box folder appears in File Explorer under C:\Users\YOUR_WINDOWS_USERNAME.
/mnt/Box is empty after restartingYour /etc/fstab line is not being applied. Confirm that /etc/wsl.conf has mountFsTab = true under [automount], then run wsl --shutdown from PowerShell and reopen your terminal. Note that closing the terminal window is not sufficient – you must run wsl --shutdown.
/mnt/BoxConfirm Docker Desktop is running with WSL integration enabled for your Ubuntu distribution. See the Docker WSL instructions.
Reading large files across the Windows/WSL boundary is slower than reading from the WSL filesystem. This is expected. If a project involves repeatedly reading the same large files, ask your mentor whether it makes sense to copy them into WSL for the duration of the work.