5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

RHEL 10 on WSL2

5
Last updated at Posted at 2025-06-13

0. はじめに

出る出ると言われていて、ようやく正式に出たようなので、以下の公式ブログに沿いながら手順をなぞってみます。

1. Red Hat Developer Program に参加

Red Hat Developer Program から Red Hat Developer Program に参加します。

途中で Red Hat Customer Portal の ID を作る事を求められますので(無料)、既に Red Hat Customer Portal の ID を持っている人は、先に Customer Portal にログインしてしておくと、この後のフォームの埋める部分が少なくなるので、事前にログインしておくと良いです。

赤い「Join here at no cost」のボタンをクリックします。

image.png

Formを埋めるように言われるので埋めて行きます。

image.png

「Submit」します。
image.png

これは以上で完了です。

2. Activation Key の取得

次にこのリンクから Hybridd Cloud Console にログインして、Activation Key を取得します。

以下の画面の Organization ID は後で使うのでどこかにコピペしてメモしておきます
Create activation key をクリックします。
image.png

Key に名前を付けます。この名前も後で使うのでメモしておきます
image.png

この辺りはお好みで...
image.png

指定しなくても進めますが、Development なので...そのように選びます。
image.png

Createします。
image.png

作成が完了しました。
image.png

ここでメモした、Orginziation ID と Key の名前は、後で RHEL登録時に使用します。

3. WSL2 の Image を取得する

ガイドでは、自分の好みにあったイメージをビルドする方が推奨とあるのですが、選択肢やオプションが多いため、事前にビルドされたものを使用します。

こちらのページに行くと、Pre Build の WSL2用のイメージがあるので、Windows 上の適当なフォルダーにダウンロードします。

image.png

適当なフォルダーに移動します(ここでは C:\Users\<ユーザー名>\wsl)

cd C:\Users\<ユーザー名>\wsl

以下のコマンドでダウンロードしたイメージを import します。

 wsl --import RHEL-10-PREBUILD .\RHEL-10-PREBUILD <イメージをダウンロードしたフォルダ>\rhel-10.0-x86_64-wsl2.tar.gz

4. 実際に RHEL WSLを使ってみる

以下で RHEL-10-PREBUILD をデフォルトの WSLイメージに設定します。

wsl -s RHEL-10-PREBUILD

*が入って居ればデフォルトのイメージに設定されている事を意味します。

PS C:\Users\yuhki\wsl> wsl --list --verbose
  NAME                      STATE           VERSION
* RHEL-10-PREBUILD          Stopped         2
  Ubuntu-20.04              Stopped         1
  Ubuntu-22.04              Running         2
  podman-machine-default    Stopped         2
  docker-desktop            Stopped         2
  Ubuntu-18.04              Stopped         2
PS C:\Users\yuhki\wsl>
 

wslコマンドを使用して WSL Linux に切り替えます。デフォルトを RHEL に設定しているので、RHEL の WSLが出てくるはずです。

PS C:\Users\yuhki\wsl> wsl
[root@<PC名> yuhki]# 

RHEL 10がインストールされている事を確認します。

[root@<PC名> yuhki]#  cat /etc/redhat-release
Red Hat Enterprise Linux release 10.0 (Coughlan)
[root@<PC名> yuhki]# 

5. RHELを登録する

RHEL の WSL を登録します。現在の状態を確認します。

# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Not registered

以前メモした、Organization IDKey 名 を変数にセットします。

# export ORG_ID=<Organization ID>
# export KEY=<Key の名前>

subscription-manager コマンドで登録します。

# subscription-manager register --org $ORG_ID  --activationkey $KEY
The system has been registered with ID: 9ffb980c-b55c-40ab-b1a7-3105f9cc812e
The registered system name is: <your pc name>

ステータスを確認します。Registered になっているはずです。

# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Registered
# 
5
1
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
5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?