1

When I vagrant up or reload , synced folders are mounted but When I ssh from another pc , synced folders are not showing and when I ssh in the actual machine, synced folders are shown. What am I doing wrong ? Or what do I have to do?

when I vagrant ssh in the actual machine

when i ssh from another pc

this is my Vagrant file

Vagrant.configure("2") do |config|
  config.vm.box = "bento/centos-6.7"
  config.vm.synced_folder "/home/telenet/telenet", "/var/www/html/code",
  :owner => "vagrant",
  :group => "vagrant",
  :mount_options => ["dmode=777,fmode=777"]

  config.ssh.insert_key = false
  config.ssh.forward_agent = true
  config.vm.network "public_network"
  #config.vm.provision :shell, :path => "lamp.sh"

config.vm.provider "virtualbox" do |v|
    v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end

end

Answer : In vagrant file , in config.vm.network I add ip: "some ip address" . Then I use that ip address to ssh my virtual box, then boom there it was. It works

Shena
  • 11
  • 4
  • please, describe how exactly do you access to VM from host and from another PC? – Vadim Oct 29 '18 at 05:12
  • After vagrant up , I do vagrant ssh then go to the file directory for my synced folder , this is how I access the VM from host. And from another PC, I also do ssh using the ip address and username sample : ssh username@ip_address:port_number @Vadim, Is this what you want to know? – Shena Oct 29 '18 at 06:04
  • It will be good if you provide real data. vagrant just setup ordinary VM, if you access by `vagrant ssh` and see data , then no matter which way you access it you should see same data. Generally if you not see that expect then this means that by mistake you access to some another VM – Vadim Oct 29 '18 at 07:44
  • @Vadim thank you for that, your comment leads me to the right answer. You are right I have been accessing the wrong VM – Shena Nov 07 '18 at 01:01

0 Answers0