Buch & Berger

  • Angebot
  • Agentur
  • Blog
  • Kontakt
  • Search

Windows Subsystem for Linux (WSL): Notes

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.

Bearbeitet: 2019-10-08
Veröffentlicht: 2018-09-09
Rubrik: Developer Notes

Stefan Buchberger

Über den Autor

Stefan Buchberger beschäftigt sich seit vielen Jahren mit der Präsentation, Verbreitung und Kommunikation von Inhalten. Er war vor allem als Buchverleger aktiv.

Heute gilt seine Aufmerksamkeit einer nachhaltigeren Form der Webentwicklung, welche die Inhalte zurück in den Fokus rückt.

Seitenleiste

Neue Beiträge

SiteGround: Renewal Reminders

Sobald sich die Vertragslaufzeit für einen SiteGround-Service (z.B. Hosting oder Domain) ihrem Ende nähert, erhalten …

Wartungsbericht: Begriffe erklärt

Unsere Wartungskunden erhalten regelmäßig einen individuellen Wartungsbericht für ihre Websites. Einige Begriffe, die wir darin …

Internationale Literaturdialoge

Das Projekt Internationale Literaturdialoge möchte innovative Kooperationsprojekte österreichischer Literaten mit Kreativen im Ausland ins Leben …
Mann skizziert Projekt auf Tafel

Wege zur Website: Nach Maß und von der Stange

Websites entstehen individuell und nach Maß oder auf Basis bestehender Vorlagen. Vielfach aber: sowohl als …
Boy singing in microphone

Testimonials: Das sagen unsere Kunden

Im Mittelpunkt eines Projekts steht für uns selbstverständlich die Zufriedenheit des Auftraggebers. Wir freuen uns …

Newsletter

Unser Newsletter mit Tipps und Angeboten erscheint wenige Male im Jahr. Infos zu Versand und Verarbeitung erhalten Sie in unserer Datenschutzerklärung.

    nav-social-menu

    • LinkedIn
    • RSS
  • Impressum
  • Datenschutz
Top ▲
Top ▲
Finde

Zeige alle ...

Generic filters