How to connect with host PostgreSQL from vagrant virtualbox machine

后端 未结 2 1543
粉色の甜心
粉色の甜心 2020-12-04 14:09

I have a VirtualBox machine running Ubuntu 12.04 in a Mac OS X host machine. In my host machine (Mac OS X), I have PostgreSQL installed. I would like to connect to this Post

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 15:00

    Easy way - simply use this "magic" IP from inside of vagrant without any additional configurations:

    10.0.2.2

    Don't know if it's always static, though for me works and it's very convenient - I can use laptop at home, from office - having assigned different IPs to me by routers, but my VMs know the "trusty name" of their master

提交回复
热议问题