microsoft / go-sqlcmd

The new sqlcmd, CLI for SQL Server and Azure SQL (winget install sqlcmd / sqlcmd create mssql / sqlcmd open ads)
https://learn.microsoft.com/sql/tools/sqlcmd/go-sqlcmd-utility
MIT License
325 stars 57 forks source link

Failed to install mssql and run on MacOS M1 Pro Ventura #371

Closed vandenbergrobin closed 11 months ago

vandenbergrobin commented 1 year ago

Docker version: 4.19.0 (106363)

Steps followed:

$ brew install sqlcmd [...] $ sqlcmd create mssql --accept-eula --using https://aka.ms/AdventureWorksLT.bak Downloading mcr.microsoft.com/mssql/server:latest Starting mcr.microsoft.com/mssql/server:latest Created context "mssql" in "/Users/robinvandenberg/.sqlcmd/sqlconfig", configuring user account... Disabled "sa" account (and rotated "sa" password). Creating user "robinvandenberg" EOF Error: EOF

Docker logs:

2023-06-06 09:04:37 SQL Server 2022 will run as non-root by default. 2023-06-06 09:04:37 This container is running as user mssql. 2023-06-06 09:04:37 To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216. 2023-06-06 09:04:37 /opt/mssql/bin/sqlservr: Invalid mapping of address 0x400384a000 in reserved address space below 0x400000000000. Possible causes: 2023-06-06 09:04:37 1) the process (itself, or via a wrapper) starts-up its own running environment sets the stack size limit to unlimited via syscall setrlimit(2); 2023-06-06 09:04:37 2) the process (itself, or via a wrapper) adjusts its own execution domain and flag the system its legacy personality via syscall personality(2); 2023-06-06 09:04:37 3) sysadmin deliberately sets the system to run on legacy VA layout mode by adjusting a sysctl knob vm.legacy_va_layout. 2023-06-06 09:04:37

stuartpa commented 1 year ago

This should work fine on Docker Desktop (we've tested it), can you confirm the following option is enabled in Docker Desktop?

"Use Rosetta for x86/amd64 emulation on Apple Silicon"

More detail here:

https://bornsql.ca/blog/you-can-run-a-sql-server-docker-container-on-apple-m1-and-m2-silicon/

If this fixes your problem, then we'll get the README.md updated with this info.

vandenbergrobin commented 1 year ago

Thanks @stuartpa. I have been able to confirm this is working and I have submitted PR #375 to add the instructions to the Readme. Are you aware of any plans for native Apple Silicon support?