3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vagrant でマウントされるディレクトリのownerを調整する

Last updated at Posted at 2013-11-15

 vagrant up 時に、ホストの Vagrantfile が存在する領域が自動的にVMの /vagrant にマウントされますが、そのディレクトリ群の owner が標準のvagrantのままだったので、変更する方法を調べました。

Vagrantfile の Vagrant.configureブロックの中に、

config.vm.synced_folder '.', '/vagrant', owner: '<ownerとしたいVM内のユーザ名>'

と記述して、vagrant up しなおす、あるいは vagrant reload をすると、指定したユーザがownerとなってマウントされます。

 また、グループも変更したければ、

config.vm.synced_folder '.', '/vagrant', owner: '<ownerとしたいVM内のユーザ名>', group: '<ownerとしたいVM内のグループ名>'

として、同様の手順を踏めば、変更できます。

3
3
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
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?