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

Multipassでマウント時に所有者がnobody&Permission Deniedになる問題の原因と解決策

Posted at

Multipass でマウント時に所有者が nobody&Permission Denied になる問題の原因と解決策

問題の概要

Multipass で Mac のローカルディレクトリを Ubuntu インスタンスにマウントした際、以下の問題が発生。

  • マウントしたディレクトリにアクセスできない(Permission denied)
  • インスタンス内でls -alコマンドの結果、ファイル所有者がnobodyになっている

調査で判明した原因

1. Multipass の--mountは UID/GID マッピングが必要

  • Mac 側の UID/GID が正しく伝わっていなかった
  • マウント時に明示的な指定が必要
# 例
# Mac 側の UID/GID
id -u
id -g

# Multipass 側の UID/GID にマッピング
multipass mount --uid-map 501:1000 --gid-map 20:1000 /Users/example_user/shared_dir UBUNTU:/mnt/c/shared_dir

2. Mac 側で所有者情報が壊れていた

  • ls -alの結果、マウント元のファイルの所有者が 777 など不正な UID になっていた
  • おそらく色々触っている時に chmod誤って chownで叩いている...

解決手順

Mac 側で所有者とグループを正しく戻す

sudo chown -R example_user:staff /Users/example_user/shared_dir
0
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
0
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?