はじめに
MacでUbuntuの環境を使う選択肢として、Multipassがあります。Multipassのバージョンをアップグレードした際に、multipassのコマンドを使おうとすると、multipass authenticate
を実施して下さいと言われ、コマンドが使えなくなったので、その解決方法を記載します。
ハマった事
multipassのコマンドを実行しようとしたところ、
multipass ls
以下のようなエラーが発生しました。
multipass authenticate
を実施して下さいと書かれています。
list failed: The client is not authenticated with the Multipass service.
Please use 'multipass authenticate' before proceeding.
書かれている通り、以下の通り'multipass authenticate'を実行します。
multipass authenticate
すると、パスフレーズの入力を求められます(設定した覚えがない!)
Please enter passphrase:
認証に失敗すると、multipass set local.passphrase
でパスフレーズを設定してから認証を行うように言われます。
authenticate failed: Passphrase is not set. Please `multipass set local.passphrase` with a trusted client.
書かれている通り、multipass set local.passphrase
を実行すると、以下の通りパスフレーズの設定を求められるので、パスフレーズを決めて入力します。
multipass set local.passphrase
解決したかと思いきや、以下の通りエラーが発生します。
setコマンドを使用するには、先にmultipass authenticate
を実施しておく必要があるとのこと。エラーの無限ループに陥って、詰んでしまいました。
set failed: The client is not authenticated with the Multipass service.
Please use 'multipass authenticate' before proceeding.
解決策を探したところ、やっとの事で英語の記事を見つけました(日本語での記事は、本記事が初になります)。英語の記事は終わりに載せておきます。
解決策
あまり深く考えず、以下のコマンドをコピペで実行して下さい。すると、multipass ls
コマンド等が今まで通り利用できるようになります(ホッとしました)。
$ sudo launchctl unload /Library/LaunchDaemons/com.canonical.multipassd.plist
$ sudo killall Multipass
$ sudo rm /var/root/Library/Application\ Support/multipassd/authenticated-certs/multipass_client_certs.pem
$ sudo cp ~/Library/Application\ Support/multipass-client-certificate/multipass_cert.pem /var/root/Library/Application\ Support/multipassd/authenticated-certs/multipass_client_certs.pem
$ sudo launchctl load /Library/LaunchDaemons/com.canonical.multipassd.plist
Linux版の解決策も載っていたので、参考に記載しておきます。
$ sudo snap stop multipass
$ sudo killall multipass.gui
$ sudo rm /var/snap/multipass/common/data/multipassd/authenticated-certs/multipass_client_certs.pem
$ sudo cp ~/snap/multipass/current/data/multipass-client-certificate/multipass_cert.pem /var/snap/multipass/common/data/multipassd/authenticated-certs/multipass_client_certs.pem
$ sudo snap start multipass
参考文献