WSL 環境で Ubuntu (Preview) の GUI インストーラーが「Unpacking the distro」から先に進まない問題

WSL 環境で Ubuntu (Preview) の GUI インストーラーが「Unpacking the distro」のまま先に進まない状況に遭遇した。


しばらく待っても先に進まなかったことから、インストーラーを強制終了。この状態で Ubuntu (Preview) を起動しても起動しないよな、と Ubuntu (Preview) を起動しようとしたが、案の定、エラーが発生し、正常起動できなかった。

Processing fstab with mount -a failed.
Failed to mount C:\, see dmesg for more details.
Failed to mount D:\, see dmesg for more details.
Failed to mount G:\, see dmesg for more details.
 
<3>WSL (10) ERROR: CreateProcessEntryCommon:370: getpwuid(0) failed 2
<3>WSL (10) ERROR: CreateProcessEntryCommon:374: getpwuid(0) failed 2
<3>WSL (10) ERROR: CreateProcessEntryCommon:577: execvpe /bin/sh failed 2
<3>WSL (10) ERROR: CreateProcessEntryCommon:586: Create process not expected to return

Windows 10 の設定アプリから Ubuntu (Preview) をリセットしたり、ストアから Ubuntu (Preview) を再インストールしたりしてみたが、状況に変化はなかった。

解決策

今回とった解決策は、 GUI インストーラーを使用せず、昔からある CUI インストーラーを使用してインストールすること。消極的な解決方法ではあるけれども、目的はあくまでも Ubuntu (Preview) のインストールと使用なので、これ以上の深追いはしない方向で。

なお、下記の手順は、上記のエラーが発生する状態から行ったもの。最初から GUI インストーラーを使用せずにインストールする場合には、「GUI インストーラーを使用せずに Ubuntu (Preview) をインストールする」のみで問題ない…はず。 (未確認)

Default Distribution を確認する

コマンドプロンプトを開き、 wsl --status コマンドを実行する。実行結果のうち、 Default Distribution の内容が後の手順で必要になる。

D:\Users\f7u>wsl --status
Default Distribution: Ubuntu-Preview
Default Version: 1
WSL2 is not supported with your current machine configuration.
Please enable the "Virtual Machine Platform" optional component and ensure virtualization is enabled in the BIOS.
For information please visit https://aka.ms/enablevirtualization

WSL から Ubuntu (Preview) の登録を解除する

引き続きコマンドプロンプトで、 wsl --unregister Ubuntu-Preview コマンドを実行する。

D:\Users\f7u>wsl --unregister Ubuntu-Preview
Unregistering.
The operation completed successfully.

GUI インストーラーを使用せずに Ubuntu (Preview) をインストールする

引き続きコマンドプロンプトで、 ubuntupreview.exe install --ui=none を実行する。インストールが終了すると、デフォルトユーザーを追加するよう促されるので、指示に従ってユーザー名とパスワードを設定する。

D:\Users\f7u>ubuntupreview.exe install --ui=none
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: f7u
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
 
D:\Users\f7u>

参考情報

タイトルとURLをコピーしました