# How to connect to vagrant machine using ip address?

**URL:** https://discourse.roots.io/t/how-to-connect-to-vagrant-machine-using-ip-address/12078
**Category:** trellis
**Created:** 2018-03-30T09:21:32Z
**Posts:** 7

## Post 1 by @eddiesuper — 2018-03-30T09:21:32Z

Hi,

I am totally new to trellis, vagrant and ansible.

Two questions.

1. I have vagrant up and I can connect to my machine on my webbrowser.  
but the problem is that I can’t see the webpage wehn I enter the ip address 192.168.50.5.  
I really want to see my webpage with ip address.

2. How I can reach to vagrant machine from other computer on my local lan network?

Anyone can help?

Thanks a lot!

---

## Post 2 by @JMan — 2018-03-30T14:49:56Z

Hi,

You should be able to to do `vagrant ssh` and access the vm from the CLI via vagrant

You should see this:

```
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-87-generic x86_64)

 * Documentation: https://help.ubuntu.com
 * Management: https://landscape.canonical.com
 * Support: https://ubuntu.com/advantage

113 packages can be updated.
49 updates are security updates.

***System restart required***
```

Hope this helps you advance,

Justin

---

## Post 3 by @IdeasandPixels — 2018-03-30T14:59:30Z

You’re going to want to setup port forwarding in your Vagrantfile. You need port 80 on your host computer to point to port 80 on the vagrant machine.

Also, you haven’t said if you’ve installed a web service. Have you installed Nginx or Apache on the Vagrant machine and verified it’s serving your site?

---

## Post 4 by @MWDelaney — 2018-03-30T16:57:59Z

This post is tagged `trellis`, and Trellis does all these steps for you. There’s no need to edit a Vagrantfile if you’re using Trellis.

---

## Post 5 by @eddiesuper — 2018-03-31T06:01:03Z

Hi all,

Thanks for your answers.

‘vagrant up’ and getting the main html with host name ‘trellis.test’ on Chrome was successful.  
‘vagrant ssh’ also successful.

What I want is that I want to see the webpage with **_ip address_** on Chrome.  
[http://192.168.50.5](http://192.168.50.5) from chrome not successfull.  
again,  
[http://trellis.test](http://trellis.test) successful.

Any hint?

Thanks.

---

## Post 6 by @fullyint — 2018-03-31T06:47:10Z

Try adding IP in a second `canonical` entry in `site_hosts` in `group_vars/development/wordpress_sites.yml` like second example [here](https://discourse.roots.io/t/deploy-to-digital-ocean-droplet-with-no-domain/11973/2)

Then `ANSIBLE_TAGS=wordpress vagrant provision`

---

## Post 7 by @Jimmy_Turgeon_Trovac — 2018-05-16T17:53:32Z

Hi,

@eddiesuper, did you find the solution? I have the same problem, I wanted to allow local dev website reachable for other computers in same network (LAN).

@MWDelaney when you said:

> Trellis does all these steps for you. There’s no need to edit a Vagrantfile if you’re using Trellis.

Do you mean it expose the local website in the VM to the local network (LAN), or that what suggest @IdeasandPixels (port forwarding)?

We tried all possible IPs (host, VM IP…), and the domain (website.test with private/etc/hosts file configured in other computers) and we’re not able to reach it from other computer in the LAN. The only way we found to reach the VM is with BrowserSync but this do not allow to see correctly the media files list (thumbnails) in the WP admin because of the absolute url that use the domain define for the dev env.

@fullyint Should I try with the IP of my computer (host) or of the VM?

Thank you
