softcode
softcode

Reputation: 4678

Vagrant synced folders structure

I am trying to set up a Django Mezzanine project on Vagrant. I have done the following

  1. installed vagrant

  2. installed virtualbox

  3. vagrant init

  4. vagrant box add hashicorp/precise32

  5. replaced everything in Vagrantfile with:

    Vagrant.configure("2") do |config| config.vm.box = "hashicorp/precise32" end

  6. vagrant up

  7. vagrant ssh

  8. sudo apt-get update

  9. sudo apt-get install python-dev python-pip

  10. pip install mezzanine

  11. mezzanine-project testproject

But I can't see my files on the host.
I have tried configuring Synced Folders by adding to the Vagrantfile:

config.vm.synced_folder "/", "/srv/home/vagrant"

To no avail.
I then tried isolating the problem by removing Python from the equation and running the following in the guest SSH instead:

  1. touch foo

To no avail yet again.
What am I doing wrong?

Upvotes: 0

Views: 845

Answers (1)

Anentropic
Anentropic

Reputation: 33923

You have the concept of synced folders back-to-front

https://docs.vagrantup.com/v2/synced-folders/basic_usage.html

Synced folders make a dir of your host visible to the vagrant vm

If you need to see files on the host, you need the files to exist on the host first (and then sync them so the vm can see them too)

Upvotes: 1

Related Questions