LoginSignup
8
9

More than 5 years have passed since last update.

【メモ】Vagrantのsynced_folderへのアクセスがめっさ遅くなった

Posted at

前提

Mac: 10.10.2
Vagrant: 1.7.2
Guest Additions: 4.3.16

本文

vm01.vm.synced_folder "~/Vagrant/vm01/", "/var/apps", owner: 'vagrant', group: 'vagrant', mount_options: ['dmode=777', 'fmode=777']

こう書いてて、ansibleとかで/var/apps以下にフォルダ作ったりとかするときにめっさ遅くて泣きたくなったので調べたら以下の記事を発見した

どうやらnfsの方が速いとのことだったので、nfsにしてみた。(ホストでnfsdが必要っぽいのでWindowsだとそのまま使えないかも)

vm01.vm.synced_folder "~/Vagrant/vm01/", "/var/apps", :nfs => { mount_options: ['dmode=777', 'fmode=777'] }

これだと権限まわりがちょっとアレな感じになってしまったので、さらに調べたら以下のにたどり着いた

nfsでマウントしたゲスト側のディレクトリをさらにバインドしてんのかな?

vm01.vm.synced_folder "~/Vagrant/vm01/", "/host_mount", :nfs => { mount_options: ['dmode=777', 'fmode=777'] }
vm01.bindfs.bind_folder "/host_mount","/var/apps", :owner => "vagrant", :group => "vagrant", :'create-as-user' => true, :perms => "u=rwx:g=rwx:o=rwx", :'create-with-perms' => "u=rwx:g=rwx:o=rwx", :'chown-ignore' => true, :'chgrp-ignore' => true, :'chmod-ignore' => true

とりあえずこれですっごく速いってわけではないけど、ものすごい遅いってわけではなくなったので、一旦これでいくことにした

8
9
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
8
9