1
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?

【 Mac OS 】multipass authenticateでハマった場合の解決方法

Posted at

はじめに

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

参考文献

1
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
1
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?