Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Edgar_massa
Helper II
Helper II

Connection to postgres Mac

Question: I have a Mac Mini Pro M4. I tested Paralels, VMware, VirtualBox, and UTM, but I don't know how to connect Windows Power BI running on a virtual machine to a database created on the Mac, both of which are on the same network.

1 ACCEPTED SOLUTION
Sandip_Palit
Resolver III
Resolver III

This is a networking and configuration issue. Because the Virtual Machine (VM) acts as a separate computer, it cannot see your Mac's database if you try to connect to localhost. To the VM, localhost is itself (Windows), not your Mac.

 

Here is the step-by-step solution to connect Power BI (Windows VM) to PostgreSQL (Mac Host).

 

Step 1: Allow PostgreSQL to Listen to External Connections
By default, PostgreSQL on Mac is locked down to only accept connections from inside the Mac (localhost). You must open it up.

Locate your Config Files: If you installed Postgres via Homebrew (most common on M-series Macs), your data directory is likely at: /opt/homebrew/var/postgres Open a terminal and navigate there, or use Finder (Cmd+Shift+G).

Edit postgresql.conf:

Open this file in a text editor.

Find the line: #listen_addresses = 'localhost'

Uncomment it (remove the #) and change it to:

listen_addresses = '*'
Save and close.

Edit pg_hba.conf:

Open this file. This controls who is allowed to connect.

Scroll to the bottom and add a line to allow the VM to connect. The easiest method for a local dev machine is to allow any IP (or you can restrict it to your specific subnet):

host all all 0.0.0.0/0 scram-sha-256
(Note: If you are using an older Postgres version, it might be md5 instead of scram-sha-256).

Save and close.

Restart PostgreSQL:

Run this in Terminal: brew services restart postgresql (or however you started the service).

 

Step 2: Get your Mac's IP Address
You need the address that the Windows VM uses to "find" the Mac.

On your Mac, go to System Settings > Network.

Click on your active connection (Wi-Fi or Ethernet) and click Details.

Note the IP Address (e.g., 192.168.1.15 or 10.0.0.5).

Tip: If you are using Parallels in "Shared Network" mode, you can often reach the Mac using the specific IP 10.211.55.2, but the actual LAN IP found above usually works for all hypervisors.

 

Step 3: Test Connectivity from Windows
Open your Windows VM.

Open Command Prompt (cmd).

Type ping [Your Mac IP] (e.g., ping 192.168.1.15).

If you get a reply, the network bridge is working. If it times out, check your Mac's Firewall (System Settings > Network > Firewall) and ensure it's not blocking incoming connections.

 

Step 4: Connect in Power BI
Open Power BI in the Windows VM.

Get Data > PostgreSQL database.

Server: Enter the Mac's IP Address (e.g., 192.168.1.15). Do not use localhost.

Database: Enter your database name.

Authentication: Enter your Postgres username and password.

 

If this explanation and solution resolve your issue, please like and accept the solution.

View solution in original post

3 REPLIES 3
Edgar_massa
Helper II
Helper II

@Sandip_Palit 

 

I did exactly what you said, installed Postgres 17 to get the drivers, connected with Dbeaver, and it worked. I installed PowerBI on Windows VM, success!


THANK YOU SO MUCH, you saved my life.

 

 

Captura de Tela 2025-12-03 às 12.07.39.png

kushanNa
Super User
Super User

Hi @Edgar_massa 

 

When I want to connect to a PostgreSQL database, I usually start by checking whether I can establish a connection to a tool like pgAdmin from my Windows machine. So first, verify that you can build a connection from your VM to the PostgreSQL database on your Mac and pgAdmin can access it.
After that, try connecting using the Power BI PostgreSQL connector.

Sandip_Palit
Resolver III
Resolver III

This is a networking and configuration issue. Because the Virtual Machine (VM) acts as a separate computer, it cannot see your Mac's database if you try to connect to localhost. To the VM, localhost is itself (Windows), not your Mac.

 

Here is the step-by-step solution to connect Power BI (Windows VM) to PostgreSQL (Mac Host).

 

Step 1: Allow PostgreSQL to Listen to External Connections
By default, PostgreSQL on Mac is locked down to only accept connections from inside the Mac (localhost). You must open it up.

Locate your Config Files: If you installed Postgres via Homebrew (most common on M-series Macs), your data directory is likely at: /opt/homebrew/var/postgres Open a terminal and navigate there, or use Finder (Cmd+Shift+G).

Edit postgresql.conf:

Open this file in a text editor.

Find the line: #listen_addresses = 'localhost'

Uncomment it (remove the #) and change it to:

listen_addresses = '*'
Save and close.

Edit pg_hba.conf:

Open this file. This controls who is allowed to connect.

Scroll to the bottom and add a line to allow the VM to connect. The easiest method for a local dev machine is to allow any IP (or you can restrict it to your specific subnet):

host all all 0.0.0.0/0 scram-sha-256
(Note: If you are using an older Postgres version, it might be md5 instead of scram-sha-256).

Save and close.

Restart PostgreSQL:

Run this in Terminal: brew services restart postgresql (or however you started the service).

 

Step 2: Get your Mac's IP Address
You need the address that the Windows VM uses to "find" the Mac.

On your Mac, go to System Settings > Network.

Click on your active connection (Wi-Fi or Ethernet) and click Details.

Note the IP Address (e.g., 192.168.1.15 or 10.0.0.5).

Tip: If you are using Parallels in "Shared Network" mode, you can often reach the Mac using the specific IP 10.211.55.2, but the actual LAN IP found above usually works for all hypervisors.

 

Step 3: Test Connectivity from Windows
Open your Windows VM.

Open Command Prompt (cmd).

Type ping [Your Mac IP] (e.g., ping 192.168.1.15).

If you get a reply, the network bridge is working. If it times out, check your Mac's Firewall (System Settings > Network > Firewall) and ensure it's not blocking incoming connections.

 

Step 4: Connect in Power BI
Open Power BI in the Windows VM.

Get Data > PostgreSQL database.

Server: Enter the Mac's IP Address (e.g., 192.168.1.15). Do not use localhost.

Database: Enter your database name.

Authentication: Enter your Postgres username and password.

 

If this explanation and solution resolve your issue, please like and accept the solution.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.