Personal Virtualisation on Mac OS? OK, I was wrong. It’s actually pretty good.

You know, I’ve always said that one of the things I admire most about a person is when they are happy to say “I don’t know”. I think that says they’re confident enough about what they do know, to be able to admit the boundaries of their knowledge.

In a similar vein I have a lot of respect for people who are happy to admit they’re wrong. And so I will step up to the plate now, and admit that after the feedback I received over the last week from a number of colleagues and acquaintances about my previous post …

Personal Virtualisation on Mac OS as a Developer? Probably not.

… and the work I’ve done since … I was wrong.

As I mentioned in my post a week of so ago, I am a developer who works primarily on the Microsoft development stack, .NET Framework, .NET Core, along with some of the modern JavaScript frameworks and libraries, such as Angular. Usually my development is done on Windows workstations, but my personal workstations are all Macs, and so the use of virtualisation has always been of interest to me.

The conclusion my post came to was that with the advent of Apple Silicon, and the challenges I’d faced over recent months using the early versions of Parallels virtualisation of Windows on Apple Silicon – such as struggling to run many of the development focused tools on that platform – I doubted the usefulness of persisting with Windows virtualisation on Mac, when I could use relatively cheap Windows laptops via Remote Desktops to do the same. Some of the challenges I’d faced using Windows virtualisation on Apple Silicon Macs included:

  • An inability to install Visual Studio successfully on a virtualised version of Windows under Parallels.
  • An inability to access SQL Server instances running outside the Parallels Virtual Machine, from SQL Server tools – such as SQL Server Management Studio running under Virtualised Windows
  • Other “x86” applications that appeared to have installed partially – I had some installs generate odd messages relating to ‘x86 architecture’ not supported

The first two issues were my primary concern, and if I could find a workaround for these, I would be a lot happier. After getting some advice – as the song goes – I decided to “start over” and try again. So here’s what I did:

  • I started with a fresh install of Windows 11 – initiated from the Parallels machine creation prompt. By doing this, Parallels downloads the correct Windows 11 image for Apple Silicon. My previous attempts didn’t use the Parallels sourced image, which may have contributed to the difficulties I had.
  • Once again following suggestions, I began the installation of Visual Studio from directly within the Parallels Virtual Machine, and under the Operating System built from the Windows 11 image sourced from Parallels, there was one critical difference I noticed. The available Visual Studio Workloads available were much more limited than I would have expected to see in a typical Visual Studio installation on an Intel machine:
  • The installation succeeded and Visual Studio Professional worked just fine within Windows 11. After creating a trivial Console application, I thought I’d try one of the more complex templates, so I created a solution based on the ASP.NET Core with Angular template. After installing Node, and other dependencies, it worked flawlessly.
  • OK, so one of my initial concerns appeared to have been overcome. Clearly the way I had tried to install Visual Studio previously had been wrong, or the platform – the version of Windows – I’d tried to install it onto wasn’t appropriate – but using the specific version of Windows 11 that Parallels chooses for you, seems to solve those issues. What about SQL Server connectivity?
  • I again installed the combined SQL Server Management Studio and Azure Data Studio, which installed correctly, as it did when I previously installed it on Parallels. The problem I’d had was getting it to connect successfully with externally hosted SQL Server instances. The advice I’d received was two fold:
    • Firstly, that you must explicitly add SQL Server Management Studio to Windows Firewall and add it as an application exemption.
    • Secondly, one of the most common issues is ensuring that you get correct name resolution when referencing the SQL Server instance you are trying to connect to.
  • Firewall Configuration: We need to add the SQL Server Management Studio application to the list of “allowed applications” in the Windows Firewall exemption list, as highlighted in the screen shot below, of the Windows 11 Virtual Machine.
  • Name Resolution: The other issue that can be challenging is ensuring you have correct name resolution to the SQL Server instance you are connecting to. In my case, I was using a Docker image running on the same Mac OS machine as the Parallels machine was running. If I was connecting to it from the same machine, I might use the shorthand “localhost” – i.e. 127.0.0.1 – but that won’t work, because it refers to the Parallel’s Virtualised Windows 11 machine itself. What I’ve found works, is to reference the machine by the fully qualified name of the host Mac OS machine itself. In my case, this was:

M1MacBookPro.local

  • The following diagram shows how the Mac OS host machine, the Parallels Windows 11 virtual and the locally running Docker SQL Server Edge image are related:
  • To reference the Docker based SQL Edge SQL Server Image from the Parallels Windows 11 virtual, I found that conveniently, I simply had to reference the fully qualified name of the host Mac Book Pro.
  • And once all this was working, I re-evaluated the performance of things, and it was in fact pretty snappy. Certainly as good as my aging laptop running Visual Studio and SQL Server, and as is obvious … it all runs on my favourite platform – my Mac.

Apart from the help, and somewhat pointed criticism, I received during the week, I was directed to the following item. Essentially, for the first time ever, it announces that Microsoft now supports Windows running on a Mac …. This is an incredible development. While the technical sophistication of tools like Parallels and VMWare Fusion have always been fantastic, to actually have Microsoft endorse running Windows under Parallels, is another step altogether. Here is a link to the Microsoft support article on the topic:

Options for using Windows 11 with Mac® computers with Apple® M1® and M2™ chips

So as I mentioned at the outset of this post, the scepticism and disappointment with Windows virtualisation on modern Macs which I expressed in my previous post, has been shown to be misplaced. By following recommended approaches, and by using Parallels Windows virtualisation correctly – because it’s clear I wasn’t previously – it delivers a useful, highly functional platform to assist a developer such as me.

The prospect of being able to carry a single, reasonably lightweight Mac laptop, running two virtual machines – one a docker image running SQL Server, the other a Parallels VM running Visual Studio or VS code to do development on, while still having my host Mac OS to perform my familiar productivity activities, sounds pretty attractive. So it’s now clear to me that the conclusions in my last post, were wrong!

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s