Mike Levin SEO

Future-proof your technology-skills with Linux, Python, vim & git... and me!

← Do You Still Really Need Windows? Switching To Linux in 2022
Build Linux container on Windows and Install Python 3.10 →

Share Folder Between Windows, WSL Linux, Container and Home Cloud

by Mike Levin

Sunday, July 31, 2022

Share Folder Windows Linux Wsl Container Cloud

For my next trick, I really have to nail down and document how I get that ~/data directory to be in common across:

In situations like this when you want to share files freely between systems there are lots of choices. Increasingly copying stuff up to and down from Github is becoming the easiest choice, but that’s stupid because of all the extra delay and overhead. We have the perfect interface for moving files around, and that’s just copying files between drives. We should continue to enjoy that simple interface even with all these hosts, containers, cloud servers and whatnot.

In other words, all 4 of these locations that I currently have in play will have a ~/data location (except for Windows that uses letter-drives).

There’s a broader issue to address here. To make a ~/data folder accessible “everywhere”, it’s primary location shouldn’t really be on your laptop because when your laptop goes offline, anything else using it loses contact. So it’s time to talk about the QNAP NAS a bit more. It’s a good setup for letting the nice people know they need a 24x7 place to run code that isn’t their laptop and isn’t the cloud. That’s such a huge right of passage with tech capability. Some would call it a home server. Whatever. It’s just a place to run your containers that isn’t your laptop and isn’t the cloud. Call it a home server if you will.

Show the diagram from yesterday.

Let’s to through them one at a time.

Add shared folder on the main windows system (on laptop)

Add shared folder on a WSL2 instance of Linux (on laptop)

Add shared folder on LXD Linux Container hosted under WSL2 (on laptop)

lxc config device add Munchkin data disk source=/mnt/data path=/home/ubuntu/data

And after that command is done from the Linux host, the following command has to be done from inside a container Terminal session.

ln -s /mnt/data /home/ubuntu/data

Add shared folder LXD Container hosted on physically separate machine (qnap nas)