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.