user@host:~$ sudo -i
root@host:~$ echo "listen_addresses = '*'" >> /etc/postgresql/9.5/main/postgresql.conf
root@host:~$ echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.5/main/pg_hba.conf
root@host:~$ /etc/init.d/postgresql restart
connect to host from guest
user@host:~$ vagrant ssh
vagrant@guest:~$ psql -h 192.168.33.1
root@host:~$ echo "listen_addresses = '*'" >> /etc/postgresql/9.5/main/postgresql.conf
root@host:~$ echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.5/main/pg_hba.conf
root@host:~$ /etc/init.d/postgresql restart
user@host:~$ vagrant ssh
vagrant@guest:~$ psql -h 192.168.33.1