Vagrant と mac でフォルダを共有したいとき
Vagrantには「 Synced Folders 」という機能がある
ホストOS(=mac)とゲストOS(=仮想マシン) の間でファイルの共有するための機能を
実はすでに持っています。
その機能が「Synced Folders」 です。
「Synced Folders」機能を使いたい場合
このフォルダは、仮想マシンが起動されると自動的に割り当てられます。
(・∀・) | 共有されてるフォルダ |
---|---|
ホストOS(=mac) | 「Vagrantfile」が設置されているフォルダ |
ゲストOS(=仮想マシン) | /vagrant 以下 |
試したみた
- mac側
mokokko@mac ~ $ ls work/hobby/vagrant/rails_centos/ Vagrantfile
[vagrant@localhost ~]$ ls /vagrant/ Vagrantfile [vagrant@localhost ~]$ touch /vagrant/hoge [vagrant@localhost ~]$ ls /vagrant/ Vagrantfile hoge
- もっかいmac側
mokokko@mac ~ $ ls work/hobby/vagrant/rails_centos/ Vagrantfile hoge
ほんまや!!!!ヽ(゚∀゚)ノ パッ☆