Help us understand the problem. What is going on with this article?

vagrantの共有フォルダ内のファイルにchmodが効かない場合

More than 1 year has passed since last update.

Vagrantfileに以下を記載

config.vm.synced_folder "./", "/vagrant", mount_options: ['dmode=777','fmode=777']

記載後↓

Vagrant.configure("2") do |config|
    config.vm.synced_folder "./", "/vagrant", mount_options: ['dmode=777','fmode=777']
end

記載後、vagrantを再起動して、chmod出来なかったファイルに再度アタックすれば出来ます。

記載内容の解説

 config.vm.synced_folder
→ホストとゲスト間でディレクトリを共有できるようにする事ができるメソッド

第一引数は、ホストディレクトリの指定
第二引数は、ゲストディレクトリの指定
第三引数は、オプションの指定(任意)

Synced folders are configured within your Vagrantfile using the config.vm.synced_folder method.
The first parameter is a path to a directory on the host machine.If the path is relative, it is relative to the project root.
The second parameter must be an absolute path of where to share the folder within the guest machine.
You may also specify additional optional parameters when configuring synced folders.

mount_options
→マウント時のオプションを配列で設定。

mount_options (array) - A list of additional mount options to pass to the mount command.

dmode
→ディレクトリのパーミッション設定

fmode
→ファイルのパーミッション設定

引用は全てVagrantのDocsからです。
https://www.vagrantup.com/docs/synced-folders/basic_usage.html

tatsuo-iriyama
Web Engineer|96'|高卒|前職:溶接工|2019-01〜ユアマイスター株式会社|
yourmystar
サービス産業のIT化プラットフォーム「ユアマイスター」と大切なものをもっと大切にするメディア「ユアマイスター スタイル」を運営するスタートアップです。
http://corp.yourmystar.jp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした