WSL Setup
** Enable WSL and install Linux distribution of choice:
- Enable WSL: Search for “turn windows features on or off”.
- Use windows store app to search for and install desired distribution, e.g. „Ubuntu“.
- You’ll be prompted to create a new username and password for your Linux account.
** WSL location: With the deprecation of the legacy WSL/lxss, the location of the new rootfs directory is (in case of Ubuntu 18.04 LTS as the Linux distribution of choice):
C:\Users\%USERNAME%\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs
Note: Do not, under any circumstances, create and/or modify Linux files using Windows apps, tools, scripts, consoles, etc. The files will become unreadable inside WSL. (Update, September 2019: Should be fixed by now.)
Mounting Drives
Use the regular Linux mount command. For example, to mount a removable drive X: as /mnt/x directory, run the following commands, using the „metadata“ flag, which makes it possible to change permissions of Windows files in Linux.
$ sudo mkdir /mnt/x $ sudo mount -t drvfs X: /mnt/x -o metadata
Consider adding the „metadata“ flag to existing drives. Newly created files in WSL will be created with metadata by default.
sudo umount /mnt/c sudo mount -t drvfs C: /mnt/c -o metadata
Note: DrvFs is a filesystem plugin to WSL that was designed to support interop between WSL and the Windows filesystem.
To make the change permanent, add the following to „/etc/wsl.conf“:
[automount] options = "metadata,uid=,gid="
SSH Setup
** Create symlink to SSH directory.
ln -s path/to/ssh-directory .ssh
** Fix permissions of existing Windows files within Linux. This will at least be necessary for the SSH „config“ and „known_hosts“ file.
chomd 600 path/to/file
** Restrict Windows file permissions of the „config“ and „known_hosts“ file to read-only, so they can be accessed through Linux.