WSL2: Difference between revisions

From Wiki
m (Marcluer verschob die Seite Windows 10/Linux Subsystem nach Windows 10/WSL)
mNo edit summary
Line 1: Line 1:
= Windows Subsystem for Linux ==
== Installation ==
== Installation ==
# Activate Windows-Subsystem for Linux
# Activate Windows-Subsystem for Linux
Line 55: Line 57:
<pre>
<pre>
z: /mnt/z drvfs rw,relatime 0 0
z: /mnt/z drvfs rw,relatime 0 0
</pre>
== mount network share ==
<pre>
mount -t drvfs '\\server\share' /mnt/share
</pre>
</pre>



Revision as of 11:10, 26 November 2020

Windows Subsystem for Linux =

Installation

  1. Activate Windows-Subsystem for Linux
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  1. Restart
  2. Install Ubuntu from Microsoft Store

Using New Windows Terminal

  • profiles.json
    • set defaultProfile to Ubuntu
    • for linux home dir:
"commandline" : "wsl.exe ~ -d Ubuntu-18.04",


 "profiles":
    [
        {
            "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
            "source": "Windows.Terminal.Wsl",
            "name": "Ubuntu-18.04",
            "commandline": "wsl.exe ~ -d Ubuntu-18.04",
            "fontSize": 10
        },
        {
            "name": "server1",
            "commandline": "wsl.exe ~ -d Ubuntu-18.04 ssh server1",
            "fontSize": 10
        }
    ]

Running Linux Commands

  • using bash.exe
bash.exe -c "jupyter-notebook ; /bin/bash"


  • using wsl
wsl jupyter-notebook &

fstab

z: /mnt/z drvfs rw,relatime 0 0

mount network share

mount -t drvfs '\\server\share' /mnt/share


Nmap

  • Install Nmap for Windows
  • .bashrc:
alias nmap='"/mnt/c/Program Files (x86)/Nmap/nmap.exe"'