0

I'm using the "Scotchbox" (scotchbox.io) Vagrant file and I would like to use it together with Ngrok to demo work in progress for clients. I'm not really sure how to set this up properly with custom dev domains - such as "project.dev" - could anyone point me in the right direction here? Would be much appreciated.

My Ngrok file has no configuration added so far other than an authentication token, and my Vagrant file contains this -

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

  config.vm.box = "scotch/box"
  config.vm.network "private_network", ip: "192.168.33.10"
  config.vm.hostname = "scotchbox"
  config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
  config.foodshow.enabled = true

end
Staffan Estberg
  • 6,795
  • 16
  • 71
  • 107

1 Answers1

1

You should edit your host file from your host machine.

  • on mac/linux, file is /etc/hosts
  • on windows, files C:\Windows\System32\Drivers\etc\hosts

Add a line like

192.168.33.10 project.dev www.project.dev

There are others possibilities like using the vagrant host-manager which can manage this file automatically for you based on some settings from the Vagrantfile, but the idea remains the same.

Frederic Henri
  • 51,761
  • 10
  • 113
  • 139
  • Forgot to mention, I've already set this up for all my dev domains. I guess I need to assign one of them specifically for Ngrok each time I want to run it? – Staffan Estberg Oct 18 '15 at 11:23
  • @StaffanEstberg well you can leave it once for all in your host file if you use different private IP; else the vagrant host-manager is a good choice to manage this for you when you run your VMs – Frederic Henri Oct 18 '15 at 11:41
  • Sorry, not sure what you mean. I've installed the Foodshow plugin (https://github.com/express42/vagrant-foodshow) that's supposed to help this issue but still stuck. – Staffan Estberg Oct 18 '15 at 12:24
  • well it does not seem to help manage the `hosts` file (see my answer) - I can advice you to install the https://github.com/smdahlen/vagrant-hostmanager to help manage the file and access your VM through `project.dev` URL – Frederic Henri Oct 18 '15 at 12:30
  • I've decided to go with Vagrant Share instead as this is too poorly documented (for inexperienced users), thanks for your suggestions. – Staffan Estberg Oct 18 '15 at 14:01
  • hey @StaffanEstberg how did you work around, i'm facing the same issue! – runningmark Sep 22 '16 at 09:53