0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Windows 11でLinuxコマンドを使えるようにする方法(WSL2)

0
Posted at

Windows 11で本物のLinux環境を構築し、lsなどのコマンドを使えるようにするまでの最短手順です。
CTF挑戦に不可欠のLinuxコマンド。
Windows上で lsgrep の動かし方が分かるまでに時間がかかってしまったので、備忘として残します。

1. ターミナルを管理者権限で開く

  1. スタートボタン右クリック
  2. メニューから**「ターミナル(管理者)」**を選択
  3. ユーザーアカウント制御が出たら「はい」を選択

2. WSL 2 のインストール

開いた画面に、以下のコマンドを入力して Enter を押す。

wsl --install Ubuntu

※完了後に「再起動が必要です」と出た場合は、PCを再起動する。

3. 初期セットアップ(ユーザー作成)

再起動後、自動で立ち上がる黒い画面で、Linux用のユーザーを作成する。

  1. username: 好きな名前を英数字で入力
  2. New password: パスワードを入力(入力中、画面には何も表示されないが、入力されている)
  3. Retype new password: 確認用にもう一度入力

4. 仕上げ:パッケージの更新

環境を最新の状態にアップデートします。

sudo apt update && sudo apt upgrade -y

5. 次回からLinuxを使う手順

通常のPowerShellを立ち上げ、wsl と打つとLinuxモードに切り替わる。

見た目のカスタマイズ(おまけ)

私はデフォルトの配色が見づらかったため設定変更を行いました。
PowerShall上部の「∨」マーク →「設定」から、以下2点を変更

  • 配色: One Half Dark
  • 「Ubuntu」→「外観」: 透過性を80%程度に下げる。文字のギラつきが抑えられて見やすくなる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?