Sharing Files Between WSL2 Instances

I’ve been trying out the Windows Subsytem for Linux lately, using Ubuntu on WSL2. I currently have multiple versions of Ubuntu installed, allowing me to easily get a console to either one.

The “problem” I was trying to solve was: not wanting to generate new SSH keys on Ubuntu X, when I already registered SSH keys on Ubuntu Y.

After a little bit of research, trial, and error — I found a solution that I found acceptable.

Apparently in WSL2, the directory /mnt/wsl is automatically shared between all instances.

In my case, I just had to copy the SSH keys into this directory, hop over to the console of my other Ubuntu installation, and copy them to the correct directory. Then running ssh-add, of course.

Pretty sweet, and not super-obvious.

Be Sociable, Share!
This entry was posted in Computers. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.