WSL2 on Windows 11: Linux Development Env

๐Ÿ’ก WSL2 on Windows 11: Linux Development Env โ€” Executive Summary

Technical architectural analysis, practical configuration manifests, and deployment instructions for WSL2 on Windows 11: Linux Development Env.

References and Guidelines (NOTE)

Windows 11 22H2, Ubuntu standard

Enable WSL

Window PowerShell

powershell
# ์„ค์น˜๊ฐ€๋Šฅ os ํ™•์ธ
wsl -l -o
>>>
๋‹ค์Œ์€ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ๋Š” ์œ ํšจํ•œ ๋ฐฐํฌ ๋ชฉ๋ก์ž…๋‹ˆ๋‹ค.
๊ธฐ๋ณธ ๋ฐฐํฌ๋Š” โ€˜*โ€™๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
'wsl --install -d <Distro>'์„(๋ฅผ) ์‚ฌ์šฉํ•˜์—ฌ ์„ค์น˜ํ•˜์„ธ์š”.

  NAME                                   FRIENDLY NAME
* Ubuntu                                 Ubuntu
  Debian                                 Debian GNU/Linux
  kali-linux                             Kali Linux Rolling
  Ubuntu-18.04                           Ubuntu 18.04 LTS
  Ubuntu-20.04                           Ubuntu 20.04 LTS
  Ubuntu-22.04                           Ubuntu 22.04 LTS
  OracleLinux_8_5                        Oracle Linux 8.5
  OracleLinux_7_9                        Oracle Linux 7.9
  SUSE-Linux-Enterprise-Server-15-SP4    SUSE Linux Enterprise Server 15 SP4
  openSUSE-Leap-15.4                     openSUSE Leap 15.4
  openSUSE-Tumbleweed                    openSUSE Tumbleweed
<<<

# ์„ค์น˜
wsl --install -d  {{ Distro }}#์œ„์˜ Name
Change repo and enable systemd

wsl

bash
# ๊ณ„์ • ์ƒ์„ฑ

sudo -i
# ๋ฆฌํฌ ๋ณ€๊ฒฝ
vi /etc/apt/source.list
---
:%s/archive.ubuntu.com/mirror.kakao.com/g
:%s/security.ubuntu.com/mirror.kakao.com/g
---
apt update -y && apt upgrade -y

# systemd enable
vi /etc/wsl.conf
---
[boot]
systemd = true
---

# systemd ๋ฏธํ™œ์„ฑํ™” ํ™•์ธ
ps -el

Window PowerShell

powershell
wsl --shutdown

wsl

bash
# systemd ํ™œ์„ฑํ™” ํ™•์ธ
ps -el

# extra linux gui app ์„ค์น˜
apt install gedit -y
Enable SSHD

powershell
# ssh ํ™œ์„ฑํ™”
sudo apt-get install openssh-server
# ์ฃผ์„ ํ•ด์ œ ๋ฐ ์ˆ˜์ •
vi /etc/ssh/sshd_config
---
...
PermitRootLogin yes
...
PubkeyAuthentication yes
...
AuthorizedKeysFile      .ssh/authorized_keys
...
PasswordAuthentication yes
...
X11Forwarding yes
...
UseDNS no
---
service ssh --full-restart
service ssh restart
Port Forwarding
References and Guidelines (NOTE)

When using this method, port 22 of existing Windows will be overwritten.

shell
## WSL to WINDOWS Port Fowardding script -> $WINDOW_HOME/.portForwadding.ps1
PORTS   L7      L4      SERVICE
-----------------------------------------
8122    SSH     TCP     sshd.service
8180    HTTP    TCP     apache2.service
8143    HTTPS   TCP/UDP apache2.service


## WINDOWS Port Fowardding
INT ->  OUT     L7      L4      SERVICE
-----------------------------------------
3389    8389    RDP     TCP/UDP ms-wbt-server

## AND Forwarded All Windows PortsN
  • win + R โ†’ taskschd.msc
  • Click on New,

  • system reboot

OpenVswitch settings

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *