6

I have a MacBook with an M1 chip, so (about) the only option for me to run SQL Server is to run it as a Docker container. This works fine for standard SQL, but our application uses some CLR features like COMPRESS; when I try to use that, it tells me

Msg 50000, Level 16, State 1, Line 45 Common Language Runtime(CLR) is not enabled on this instance.

Enabling it does not work:

EXEC sp_configure 'clr enabled', 1;  
RECONFIGURE;  
GO

gives

Msg 15392, Level 16, State 1, Procedure sp_configure, Line 166
The specified option 'clr enabled' is not supported by this edition of SQL Server and cannot be changed using sp_configure.

I found this Stack Overflow post but that is about someone using a custom .NET library; I'm looking for the 'standard' functionality available in SQL Server for Windows.

0

2 Answers 2

3

Yes, there is an easier path to this now, as of Ventura (I tested on 13.3) and Docker 4.16.

  1. Make sure you are on macOS Ventura - I only know that it works on 13.3 because I can’t test anything earlier now

  2. Make sure Docker is the "Apple Chip" version, 4.16 or later:

    Get the right chip

  3. Enable "Use Virtualization Framework" in Settings > General:

    Enable "Use Virtualization Framework"

  4. Enable "Use Rosetta for x86/amd64 Emulation…" under Settings > Features in Development:

    Enable "Use Rosetta for x86/amd64 Emulation…"

  5. Hit Apply & Restart

  6. Create a new container adding the important --platform=linux/amd64 argument; while it should work for any image in the hub, this command is for SQL Server 2022, and is the only one where I have validated that it works:

    docker run --platform=linux/amd64           \
      -e ACCEPT_EULA=1                          \
      -e MSSQL_SA_PASSWORD=sTr0ng3st_p@ssw0rd!  \
      -p 1433:1433 -d                           \     
      mcr.microsoft.com/mssql/server:2022-latest
    
  7. Proof that COMPRESS() works:

    Glorfindel pudding

3
  • In Docker Desktop 4.26, the feature seems to have been promoted out of beta; I could skip steps 3 and 4.
    – Glorfindel
    Commented Jan 11 at 15:47
  • @Glorfindel Not at a suitable machine at the moment but are these options located elsewhere (and both enabled by default)? Commented Jan 11 at 16:34
  • 'Use Virtualization framework' is still under General, activated, but I can't deactivate it. And now that I have a second look, 'Use Rosetta for x86/amd64 emulation on Apple Silicon' is there as well (activated by default). Here's a screenshot you could use: i.sstatic.net/AhBBA.png
    – Glorfindel
    Commented Jan 11 at 16:39
3

You are not alone running SQL Server container images on MacBook Pro M1: and in fact CLR is missing from Azure SQL Edge container images.

However a brave person was able to install SQL Server 2019 on Windows Server 2016 on a M1 Max MacBook Pro by using an emulator called UTM, which itself is an abstraction over QEMU.

The recommended x86_64 architecture is this:

Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-6.1) (q35)

Use it as the basis of your virtual machine and configured it with two CPU cores, 8GB RAM, and a 127GB virtual hard drive.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.