-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work on Mac M1 #734
Comments
I am trying out the commands that @meyntony wrote on an M1 Pro (arm64) processor and getting the following warning when spinning up the container:
I figure this explains why it would or could give problems. A possible workaround, following this guide, suggests to use the image docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=P@ssw0rd' -p 1433:1433 --name sqledge -d mcr.microsoft.com/azure-sql-edge In terms of running the Even so, I am able to connect to the database server using Azure Data Studio (which works on Apple Silicon even though it's not officially supported) and create new databases. |
The sqlcmd utility is not included in the ARM64 version of the SQL Edge container. I pulled another image that contains sqlcmd. Retreive image w/ sqlcmd tools: Assuming the SQL Edge container is running on the same machine and bound to the default port of 1433, you could try something like this: |
Nice one, @rjschave. Thanks for the info! |
Please add aarch64 and arm64 support (necessary if one is using docker on M1 mac). |
More people are running into this issue and using azure sql edge as a workaround. Please add support for ARM64 / Apple silicon / M1 to MS SQL Server docker image. |
👍 'ed this issue. I'm using Azure SQL Edge as a workaround, but the lack of CLR support is an issue, as the database I'm working with uses the |
M1 support is needed urgently |
Since Azure SQL Edge does not support all the features of SQL Server its not an appropriate alternative for everyone. I would highly appreciate if Microsoft would support the M1 soon. |
If there is no support for MSSQL we as a company will look into other solutions! To me thats a must have. |
M1 support is needed urgently |
1 similar comment
M1 support is needed urgently |
This is pretty major, we've just had our dev machines upgraded, and the new Macs mean we are now on M1 chips and cannot develop with MS SQL. I'd assume it will become an issue for more and more people as the old machines age out. |
M1 support is needed urgently |
3 similar comments
M1 support is needed urgently |
M1 support is needed urgently |
M1 support is needed urgently |
I would suggest reducing the "me too" comments and simply thumbs up on the primary post at the top. I'm not working for MS, but would be surprised if this sees any attention in the near term. Mostly because M1 isn't really a server target for MS SQL Server. And the "edge" version is where any effort for ARM is going. You may be best off requesting better feature parity for that release. I would also suggest considering PostgreSQL as well, depending on how difficult porting would be for you, but you may run in to similar issues with specific use cases locally. Having gone through several painful database platform migrations in the early 00's it is emphatically not fun and I don't recommend it. An alternative might be a cloud hosted instance with each dev working on a separate |
There is the solution of running the container inside a VM, such as colima which can interface with docker pretty easily. However, even if the container spins to life for me, is reachable and all, liquibase will take a very long time to send the changelog and SQL commands to the container. What takes a few minutes (even seconds) on a Mac Intel takes forever with colima + Mac M1 somehow. If it spins to life, it will (most of the time for me) crash before sending everything, saying that the change log lock couldn't be acquired. Still investigating. For those wanting to try this out, I'm using |
M1 support is needed urgently!!! |
M1 support is needed urgently!!! |
Please leave thumbs up on the relevant messages instead of polluting the thread and not bringing anything. |
Sorry for spamming, I just want to say that while workaround like colima exist, they have issues. Some are obvious (the degradation of performance emulating x86), some are not so (the emulation, being a hack it can break eventually, like abiosoft/colima#288). |
Bumping this for visibility. We pay a ton of money for our Azure and I expect Microsoft to fix a problem on time, only once please. But as usual, disappointment all the way. |
FYI. You can find some workarounds here, but the whole situation is still just pathetic: |
M1 support is needed urgently |
There is a solution, see #734 (comment). I got it to work correctly by starting only sqlserver inside Colima, and all of my other containers inside Docker Desktop, just by switching the current docker context, pretty easy to do. |
@SuperFola could you please share with the example of switching Docker contexts? I want to run my docker compose with SQL server under Colima and other Docker instances as usual under ARM virtualization. Thank you |
It does work, but it's miserably slow. I switched to using an ec2 instance as a remote docker host. |
I tried the suggest steps to use colima with container mcr.microsoft.com/mssql/server:2017-latest to no effect. Am still getting the same error as the initially noted one:
|
are you sure your using the Colima runtime? run "docker context list" and see what it's set too |
I got the same issue and checked the docker context as in the below image. Colima has been selected as it should be. Any idea as to what could be the reason? |
Run |
For some reason when I ran |
@sinfergit @darrinholst did you get any errors when you installed it? I'd suggest clearing everything out and re-installing lima and colima by following the steps above it sounds like something is borked. |
The only error I got running the script is from here Did everything from the scratch again and now getting the following error about the colima driver. |
You shouldn't have to build anything from source anymore. Here is what I just did to clean and reinstall...
Change
|
Thanks a lot @darrinholst now it works. So what was missing was the mountType to be updated to |
What's the point of changing Colima defaults for SQL Server? I have been running it successfully for a year without changing anything. Is it faster or anything? I also don't share volumes with the host. Is that what's broken by the defaults? |
@Meligy the issue specifically steams for m1 macs as there isn't a native mssql container. if your on an Intel Mac or windows there isn't a strong reason to switch. |
@invaderb, yes. I get that. I have an M1 Max MacbBook Pro 16". And I use colima for that. Sorry if my question was not clear but I was asking about the reason for customising the colima template vs using colima's defaults, for someone who's already using colima to run SQL Server on Mac. |
Yes. Significantly. For some people just getting it to run with qemu emulation on arm64 was good enough. For others the performance was a show stopper. In my case we’re using it for automated testing against a local database (with the need for the CLR so the azure image was out). It’s the difference between seconds and literally minutes. |
OK. The new settings in colima ARE cool, much faster indeed. I started by deleting the existing VM then following the cleanup instructions above (my default template was not including the colima delete
brew uninstall --force colima lima
rm -rf ~/.colima ~/.lima
brew install colima Then I applied the settings to colima template: vmType: vz
mountType: virtiofs I forgot to measure the colima start command time difference, it certainly felt faster, but I could see the speeds of starting a custom SQL Server image (for enabling Full Text Search etc.) changing quite a bit. First, I want to mention how I changed my start command, because it was problematic. I changed it as follows... From (OLD): colima start --arch x86_64 --cpu-type kvm64 --cpu 4 --memory 4 --disk 60 To (NEW): colima start --network-address --cpu 4 --memory 4 --disk 60 Looking at the default comments in the template, I think at least setting And the results were amazing. Results BEFORE (I cancelled when I sensed nothing changed from usual): Results AFTER (Look at same-shape arrows for comparison): The download time of the 784.49MB part ending in That's going from minutes to seconds as @darrinholst said! Thanks for sharing! And hopefully at some point people won't have to go through all of this. |
UPDATE: The new docker-desktop release (v4.16.0) introduces a new Mac beta feature, Rosetta for Linux, which helps performance and stability when running intel bases images. I am now able to run MSSQL docker image on my Mac M1 laptop with no issues yet. Also seems pretty performant, but have not run any benchmarks yet. It would still be better if microsoft would provide a native ARM image, but this seems to be the best work around for now. Release Notes: |
Recapping where arm64 (M1/M2) support is currently for SQL Server:
if I've missed anything from the 91 comments in this thread, please feel free to open a new issue on that specific item! |
@dzsquared thanks for the list! Would you mind adding to that list that macOS Ventura (13) is required? I've gone crazy looking for that checkbox within the Docker Desktop and realised that it wasn't present because I was on 12. |
I don't know about the need for latest Mac, but there's another gotcha to be aware of that I mentioned here: docker/roadmap#384 (comment). In short: there are 2 beta features in the same tab, the Rosetta emulation and containerd for image pulling and storage. The containerd feature is supposed to be much faster but in my experience it caused an error, and after turning it off, the image pulling and extraction was still fairly fast (71.7s vs 61.3s on colima as mentioned above). |
Someone confirmed macOS Ventura is required, see docker/roadmap#384 (comment), I'll upgrade soon to get this on my computer.
|
Are there any plans for an official ARM container? My understanding is that Rosetta will most likely go away at some point. It would be nice to see an official ARM build. |
+1 for native arm build, because Rosetta 2 like Rosetta 1 -- just temporary workaround for 2-4 years. |
Yeah, that would be really great! aarch64 build now 😉 |
I can confirm that running the x86_64 SQL Server container under Rosetta is not an ideal solution. Due to the arch emulation, the SQL Server container under load locks up and becomes unresponsive. My M1-using devs report they are constantly having to restart the SQL Server container. They can use it, but it's buggy. |
Yeah it sucks! Give us the real thing 🙏 |
Alright folks - there's a new issue to track for a native aarch container - you're welcome to bring your concrete feedback to the comments - #802 |
The above code works fine on Windows, Ubuntu, Mac with Intel Chip, but not on Mac with the M1 chip.
Is this a known issue?
The text was updated successfully, but these errors were encountered: