ユーザ用ツール

サイト用ツール


public:win11_wsl2_ssh_en

文書の過去の版を表示しています。


WSL SSH In Windows 11

How to install Linux on Windows with WSL (Microsoft)

Connection settings for this article

Host NameLogin Name
ServerJump_ServerJump_Server_Username
ClientLocalhostLocal_Username

Command install

Check OS version

Start PowerShell or Command Prompt by selecting “Run as administrator”. PowerShell or Command Prompt can also be opened in Windows Terminal. The command to check the OS version is as follows:

PS C:\Windows\System32> winver

Select and install a Linux distribution

Linux distributions that install WSL2 online can be found with “wsl -l -o”.

PS C:\Windows\System32> wsl -l -o
インストールできる有効なディストリビューションの一覧を次に示します。
'wsl.exe --install <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_7_9                        Oracle Linux 7.9
OracleLinux_8_7                        Oracle Linux 8.7
OracleLinux_9_1                        Oracle Linux 9.1
openSUSE-Leap-15.5                     openSUSE Leap 15.5
SUSE-Linux-Enterprise-Server-15-SP4    SUSE Linux Enterprise Server 15 SP4
SUSE-Linux-Enterprise-15-SP5           SUSE Linux Enterprise 15 SP5
openSUSE-Tumbleweed                    openSUSE Tumbleweed

It can also be installed from the Microsoft Store rather than by command.

Here we install Ubuntu-22.04(wsl_install.jpg).

wsl --install -d Ubuntu-22.04

Reboot the system as instructed.

Ubuntu Linux startup and initial configuration

Ubuntu will start automatically after rebooting, but if it does not, start it from the menu. Enter your client username and password.

Enter new UNIX username: クライアントusername
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
...

Updating Ubuntu.

username@localhost:/etc/apt$ sudo apt update
username@localhost:/etc/apt$ sudo apt -y full-upgrade

Timezone, locale を確認し, 必要であれば適宜変更する.

username@localhost:/etc/apt$ timedatectl
               Local time: Fri 2024-01-12 11:51:24 JST
           Universal time: Fri 2024-01-12 02:51:24 UTC
                 RTC time: Fri 2024-01-12 02:51:24
                Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
              NTP service: inactive
          RTC in local TZ: no
username@localhost:/etc/apt$ localectl status
   System Locale: LANG=C.UTF-8
       VC Keymap: n/a
      X11 Layout: us
       X11 Model: pc105
public/win11_wsl2_ssh_en.1710723369.txt.gz · 最終更新: 2024/03/18 09:56 by hirata.nanako

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki