How to connect with host PostgreSQL from vagrant virtualbox machine

You can reach your host from your guest by using the default gateway on your VM.

See this answer for an explanation.

By running netstat -rn you can get the default gateway and then use that ip address in your config file of your application.

Running netstat -rn | grep "^0.0.0.0 " | cut -d " " -f10 should give you the correct ip address. (only tested this on my machine)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)