Skip to content
holzkohlengrill edited this page Dec 15, 2023 · 10 revisions

WSL (Windows Subsystem for Linux)

On this page we are targeting the Ubuntu WSL. Most of this page should work for others too.

Installation

Installation has to be done on a per user level.

  1. Run Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux in PowerShell as admin
  2. Install your distribution from the Windows Store. Currently, available distros are:
    • Ubuntu
    • OpenSUSE
    • SLES
    • Kali Linux
    • Debian GNU/Linux

Distribution Update

$sudo do-release-upgrade

The default is a LTS release cycle. If you do not want to wait for the releases appear in LTS you can change to the normal release cycle by modifying: /etc/update-manager/release-upgrades.

Network shares in WSL

Mounted network shares are not automatically accessible in WSL.

Edit /etc/fstab:

# <file system>           <mount point>      <type>   <options>   <dump>  <pass>
LABEL=cloudimg-rootfs     /                  ext4     defaults    0       0
//network/share/unc/path  /mnt/mount-point   drvfs    metadata    0       0

Make sure the mount points are existing (= folders created => mkdir /mnt/...)

DrvFs is a file system plugin for WSL to interoperate between the WSL and the Windows file system.

Finally reload fstab: sudo mount -av.

Read an ext4 partition in Windows via wsl

See here: https://superuser.com/a/1630438/591879

Clone this wiki locally