Roots Discourse

How to make Trellis Vagrant VM accessable across LAN


#1

I am attempting to access the development site from other machines on the LAN. I tried to add port forwarding on the VM with ports 80 and 80 (in and out), with and without the guest ip address specified but could not get it to work.
I am not using Sage so I don’t think the browsersync method will work for me (mentioned in another post).
Please advise. Thank you!


#2

What exactly did you do?


#3

Tried from virtualbox (with VM running) -> settings for the vm -> network -> port forwarding (under NAT) -> added a line with TCP, host port 80 and guest port 80, tried with and without specifying the host ip address. I realize this is not permanent, but thought it should work while the current vm is running…

Not sure where to add port forwarding in trellis.


#4

See https://www.vagrantup.com/docs/networking/forwarded_ports.html


#5

Added the line config.vm.network "forwarded_port", guest: 80, host: 8080 to the vagrantfile, and it showed that it did it when doing a vagrant reload, but still cannot access it from the LAN.