LoginSignup
15
15

More than 5 years have passed since last update.

Vagrantの共有ディレクトリ設定

Posted at

Vagrantfileで共有ディレクトリ設定を行うのにつまづいたのでメモ。

環境

Windows 7 Professional
Vagrant 1.7.4
Packer 0.8.6

Vagrantfile

ただの勘違いかもしれませんが、

config.vm.synced_folder "C:/vagrant", "/vagrant"

だけではうまく共有してくれないようなので検索しまして解決。

PC上のC:/vagrantと共有する場合。
以下のようにすると、PC側で作成したファイルやフォルダは、vagrantユーザー、vagrantグループでサーバ側に作成されます。

config.vm.synced_folder "C:/vagrant", "/vagrant", :owner => "vagrant", :group => "vagrant", :mount_options => ['dmode=755', 'fmode=644']

この設定は複数書けるので、ディレクトリごとにユーザーわけて共有することもできるはず。

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