WSL2: Difference between revisions

From Wiki
No edit summary
Line 19: Line 19:
</blockquote>
</blockquote>


<blockquote>
<pre>
"profiles":
    [
        {
            "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
            "name": "Ubuntu-18.04",
    "colorScheme": "Campbell",
            "commandline": "wsl.exe ~ -d Ubuntu-18.04",
            "fontFace": "Consolas",
            "fontSize": 10,
            "historySize": 9001,
            "padding": "0, 0, 0, 0",
            "snapOnInput": true
        },
        {
            "name": "server1",
            "commandline": "wsl.exe ~ -d Ubuntu-18.04 ssh server1",
            "fontFace": "Consolas",
            "fontSize": 10
        }
    ]
</pre>
</blockquote>


== Running Linux Commands ==
== Running Linux Commands ==

Revision as of 19:59, 11 December 2019

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}",
            "name": "Ubuntu-18.04",
	    "colorScheme": "Campbell",
            "commandline": "wsl.exe ~ -d Ubuntu-18.04",
            "fontFace": "Consolas",
            "fontSize": 10,
            "historySize": 9001,
            "padding": "0, 0, 0, 0",
            "snapOnInput": true
        },
        {
            "name": "server1",
            "commandline": "wsl.exe ~ -d Ubuntu-18.04 ssh server1",
            "fontFace": "Consolas",
            "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


Nmap

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