As of Parallels 20, there is a Knowledge Base article on how to do this. It does require Parallels Business as it needs Ubuntu x86_64 to be installed, but I recently tried switching to using Docker on MacOS and it's been working pretty reliably so far. The only thing I haven't tried is turning on the SQL Agent but I can do restores and backups, and I've fiddled with the registry in Windows to get aliases working.
Here are the steps I followed:
- Run
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=VeryStr0ngP@ssw0rd" --name sql -p 0.0.0.0:1433:1433 -d --platform linux/amd64 -d mcr.microsoft.com/mssql/server:2022-latest to get a basic instance of SQL Server running. You can add volumes to persist the data. I add the arguments -v sql_server:/var/opt/mssql -v ~/Downloads:/var/backups so that the data folder persists and so that backups I download are immediately available within the container.
- From Windows, open the registry and go to
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo. Add a new String key with the name of the alias, and the data set to DBMSSOCN,10.211.55.2,1433. Where 10.211.55.2 is the IP address of the MacOS host machine through Parallels.
- To get it working with 64 bit applications you will need to do add the same key to
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\MSSQLServer\Client\ConnectTo.
You should be able to connect via SSMS immediately once this has been set up, but it might require a restart. I've been working like this for a few weeks without issue, so it's totally doable and it's been able to keep up with what I've put it through so far.
I hope this helps anyone in a similar situation to mine.