I'm currently having a Macbook Pro M1 as my development machine, running Docker on Mac for my containerised applications and Windows 11 VM using Parallels as my development environment. In this Windows VM lies the SQL Server database that Docker needs to connect to. To those who may be unaware, no, the M1 chip doesn't support nested virtualisation.
Therein lies my question: how do I establish a connection from Docker through the MacOS host to SQL Server in Windows VM?
Points that I'm aware of:
- There is no direct connection between Docker and Windows
- Docker has its own subnet assigned by default e.g.
192.168.65.0/24
- Parallels uses shared network by default, which places the Windows VM in an invisible subnet e.g.
10.211.55.x
- Parallels support bridged network but ideally would like the corporate VPN to just be in the MacOS host
- Inside Mac's host file, an entry exists to resolve the private IP of the Windows VM to a hostname e.g.
10.211.55.x windows-11.shared
- Docker uses a specific hostname to establish a connection to the MacOS host i.e.
host.docker.internal
- SQL Server is configured to accept TCP connections through port 1433
- Using the connection string
Server=windows-11.shared;Database=xxx;User ID=xxx;Password=xxx
throws the "Server not found" error because no direct connection
Advice greatly appreciated!