いろいろやってみるにっき

てきとーに生きている奴の日記

古いエントリのサムネイル画像がリンク切れになってたりするけど、チマチマ修正中


【小ネタ】WSL 2にCentOSを無料でインストールする。

CentOSも試してみたいと思ったのだが、Microsoft Storeで見るとなんと有料。

f:id:shigeo-t:20201013090113p:plain

有償のRed Hat Enterprise Linuxならともかく、CentOSが有料というのは受け入れがたい。それに公式というわけでもない。

f:id:shigeo-t:20201014042915p:plain

 

Amazon Linux 2と同様にどっかにrootfsがあるはずと探してみると、ありました。

github.com

 

README.mdを読んでいるとインストーラ付きである。

Install

1. Download installer zip

2. Extract all files in zip file to same directory

3.Run CentOS.exe to Extract rootfs and Register to WSL

Exe filename is using to the instance name to register. If you rename it you can register with a diffrent name and have multiple installs.

 

Downloadページに飛んでみると8.1や7が存在する。今回は都合により7.6。

@yuk7 yuk7 released this on 4 Apr

downloads

  • Changed FileName
  • CentOS 7.6 1907
  • wsldl 20040300
    -Added "Windows Terminal" and "Fluent Terminal" integration

 

好きな場所に解凍する。CentOSを置いておく場所に解凍するのが一番手っ取り早い。第2ドライブのSSDに解凍した。

f:id:shigeo-t:20201013090956p:plain

 

これでCentOS7.exeを実行すればできあがり。実行前はWindows TerminalにはCentOSは無い。

f:id:shigeo-t:20201013091133p:plain

Powershellなのを忘れてたけど、無事に完了。

f:id:shigeo-t:20201013091258p:plain

1GB未満である。

f:id:shigeo-t:20201013091316p:plain

起動済のWindows Terminalには反映されないが、新たに起動したWindows TerminalにはCentOS7がある。

f:id:shigeo-t:20201013091434p:plain

起動してみる。

f:id:shigeo-t:20201013091611p:plain

 

あとは、コマンド関係のインストールや日本語化やWindows Terminalのアイコン変更などお好きに。Amazon Linux 2と同じ手順でできる。

shigeo-t.hatenablog.com

shigeo-t.hatenablog.com

 

お時間あったら、他のエントリもクリックして頂ければ幸いです。