1

I have a VirtualBox VM running locally that has postgresql 9.6 installed on Windows 10. I am able to connect to the instance with pgadmin on the virtual machine. I am trying to connect to that same instance from the host machine.

I have created an inbound firewall rule: enter image description here

My pg_hba.conf file contains the following: host all all 192.168.56.1/24 md5

And my postgresql.conf file contains the following: listen_addresses = '*'

I have restarted the service (and also Windows) after making those changes. From my host machine I get the following error when attempting to connect: enter image description here

I have switched to Bridged Networking instead of the default NAT. I have also tried to disable the Windows Firewall completely on the VM and that did not help.

Network settings on the VM: enter image description here

Any ideas on which settings I am missing?

11
  • 1
    What type of networking are you using? Bridged or NAT? You'd want to use bridged in this instance, otherwise you'll need to set up port forwarding in the VM's NAT settings.
    – essjae
    Commented May 14, 2018 at 22:48
  • I changed from NAT to Bridged and restarted the virtual machine, but still have the same message.
    – Mike Cole
    Commented May 15, 2018 at 13:39
  • After you switched networking modes, did you adjust the firewall and IP? You moved to the host's subnet when you changed from NAT, so the IP on the VM, firewall, etc need to be adjusted as well.
    – essjae
    Commented May 15, 2018 at 18:23
  • I did adjust the IP. What would have I needed to change on the firewall? I opened the port and the port should be the same after switching networking modes.
    – Mike Cole
    Commented May 15, 2018 at 19:44
  • Are you sure you have the correct IP? A 192.168.x.1 address is typically the router in my experience. That also looks like a host-only network address to me. A bridged connection should get an IP on the same subnet as your host from your DHCP server.
    – kicken
    Commented May 17, 2018 at 22:07

1 Answer 1

0
+50

The Host-Only network adapter is the best way to check for connection problems between host and guest.

With the DHCP server that is built into VirtualBox, you don't need anything else than setting the guest to that interface. You could also temporarily disable the firewalls on both host and guest if it still does not work.

For more information, see the VirtualBox Chapter 6 - Virtual networking, section Host-only networking.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .