Jump to content
Lars Fosdal

Delphi on Windows 11 on MacBook Pro 16 (2021)

Recommended Posts

Xmas came early this year - and, as much as time permits, I will attempt to brave new frontiers. This is more or less my first attempt to use MacOS, and to make things even more exciting, I added the preview version of Windows 11 for ARM to a Parallels VM and I'm installing RAD Studio under that.

 

I will prolly have a thousand MacOS / XCode questions... so any pointers to tips on getting a smooth start with XCode and Delphi will be much appreciated.

 

 

PXL_20211126_173707336.jpg

  • Like 2

Share this post


Link to post

Is that a Windows 11 ARM running in a VM on a 3000 EUR MAC emulating x86 to run RAD Studio? 🙈

 

That will be nice! 😉

 

image.png.63a1529398f1fbdc63d90c6991e203b4.png

 

Edited by Attila Kovacs
  • Haha 1

Share this post


Link to post
2 minutes ago, Lars Fosdal said:

It is kinda ass backwards, isn't it...

Apparently not anymore. I'm glad to see the industry coming together.

Share this post


Link to post
On 11/26/2021 at 10:51 AM, Lars Fosdal said:

I added the preview version of Windows 11 for ARM to a Parallels VM

why the ARM version? I mean ... why not the Intel version?

 

I'm curious if there's much of a performance difference.

Share this post


Link to post
3 hours ago, David Schwartz said:

why the ARM version?

Because the computer has ARM processors would seem like the obvious reason

Share this post


Link to post
2 hours ago, David Heffernan said:

Because the computer has ARM processors would seem like the obvious reason

Brain fart. Sorry. 😕

Share this post


Link to post

Getting to know the Mac.

 

The OS is “UNIXish”, so that is pretty easy, but the UI and the keyboard… OMG, it is hard when 30 years of Windows is engraved into your DNA. Shift, fn, control, option, command will take some time to get used to., The multi-touchpad, with clicks, doubleclicks, single, double and triple finger combos...

 

After deciding on Parallels Pro as a VM host, getting the Windows 11 for ARM VM up and running was incredibly easy.  I went for four CPUs and 10Gb as the base config.

 

Getting Delphi 11 + November patch installed went flawlessly and pretty quick. Getting PA Server installed also went without a hitch.

It took a little while to start Delphi the first time, but after that it was snappy.

 

I created a blank FMX project, but when I try to select the MacOS ARM 64-bit platform, I arrive at

Obstacle 1: Delphi fails to import MacOS SDK and asks if I installed the XCode command line tools? 

I had installed XCode, but since I´ve never used it, it is pretty much a blank sheet to me.

 

Looking at the PA Server console, I found that it ran:

> command_line: "/usr/bin/xcodebuild" -version -sdk

 

When I run that in a Terminal, I get an error message:

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

 

So, Google it is. https://github.com/nodejs/node-gyp/issues/569

lists a solution, suggesting

# Install Command Line Tools if you haven't already.

xcode-select --install

Which fails, suggesting it is installed, and that I should use Software Update to update it.  I do. It is up to date.

 

# Enable command line tools

sudo xcode-select --switch /Library/Developer/CommandLineTools

This does not help. Same error message about the command line tool instance.

 

The third option worked.

# Change the path if you installed Xcode somewhere else.

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

 

Yay, I have a MacOS 12 SDK! Even if the import log looks weird.

A single Hello World TLabel and Run.  Yay! MacOS ARM app running!

 

Lets try something more complex.

I open a sample project, switch to MacOS ARM, and compile.

dccosxarm64 command line for "FMSimplePhysics.dpr"

[dccosxarm64 Error] E2597 ld: library not found for -lFlatBox2DDyn

[dccosxarm64 Fatal Error] F2588 Linker error code: 1 ($00000001)

 

Obstacle 2: Now what!?

It is probably trivial, but ...

 

  • Like 2

Share this post


Link to post

I did something similar the other day, installed Win11 into a HyperV container + Delphi 11 Trial with Android SDK, connected my phone via WLAN debug to the system, added a button to the form, F9 and voila, app is running on the phone. Brilliant. It's just slow AF as I'm on my old notebook 😉

  • Like 2

Share this post


Link to post

Moved the post to Cross-platform.

 

Ref. Obstacle 2: It is probably path related.

For now, I had to move the Mac out of my office to not be tempted to tinker more on it, but get some actual paid work done.
The lure of unfamiliar territory was too powerful to resist when within the reach of my fingers.

  • Thanks 1

Share this post


Link to post

Hi Lars, not sure why you are having problems. I think I have the same setup and mine works like a charm. Compilation speed is totally absurd. My previous dev environment was on a late 2014 Macbook Pro (16GB mem, and additional Nvidia graphics). My new Laptop with an M1 Max processor (32GB mem) is a beast compared to my old laptop (and a beast to any other Windows laptop in our building - lol). Not really fair because having six years in-between, but compared to my home-game computer this this is fast! Real fast!

 

Back to your problem, maybe telling about my setup, and the following order of getting to that setup helps:

  • MacBook Pro 16 (M1 Max processor):
    • macOS Monterey (version 12.0.1)
    • installed Xcode 13 (v13.1) and inside of that I created a few signing certificates (apple development, and apple distribution certificate)
    • Parallels Desktop Version 17.1.0 (51516) 
  • Inside Parallels:
    • Installed "Windows 11 Pro Insider Preview" installed (thus ARM version) inside (Build 2250.rs_prerelease.211112-1650)
      • I left everything to standard/automatic (such as CPU&Memory is set to "automatic" on my machine)
      • graphics set to "best for external displays" as I typically run Windows/Delphi on a bit larger external display
      • Inside Startup and Shutdown (options) I changed "on VM shutdown" to "close window" so I don't manually have to close the VM after I shut down windows
      • Coming from VMWare I set several sharing and applications settings such that they mostly matched what I was used to
  • Then booted Windows inside Parallels.
    • Installed Delphi 11
    • Applied the November Patch
    • Coped PAserver22.0.pkg from "C:\Program Files (x86)\Embarcadero\Studio\22.0\PAServer" to a shared folder inside Parallels so I can access it from my Mac
  • Back to the Mac:
    • Ran "PAserver22.0.pkg" to install PAserver
    • Then ran the just installed PAserver-22.0 app (when I run PAserver it tells me that the version is 13.0.12.1)
    • inside the window, pressed enter (thus not using a password), and then pressed "i" to retrieve the IP address needed in Delphi
  • Back to Windows
    • Started Delphi
    • Inside Tools/Options:
      • Connection profile manager, added host, called it MacOS, gave it the IP address found within PAserver. I didn't touch the port number or the password. The connection should then work properly
      • Once the connection is OK then proceeded to SDK manager and installed
        • SDK manager: added the macOS 64-bit (MacOSX 12.0) SDK, telling overwrite existing files
        • SDK manager: also added macOS ARM 64-bit (MacOSX 12.0) SDK
        • SDK manager: iOS device 64-bit (iPhoneOS 15.) SDK
        • SDK's for android 32 and 64 bit along with windows 10 SDK were already installed with Delphi
    • After that I installed all my regular components

The above following-order 100% works, at least for me.

 

So far I've compiled 32-bit windows, 64-bit windows, MacOS 64-bit, MacOS ARM!, and iOS apps without any problems. I can also package both Mac apps and iOS apps for Apple's stores! Probably today I'll try compiling for Android.

 

And for who wonders... compilation speeds are totally nuts from my point of view. This thing is real fast. I will be saving time not having to wait as much for compiling, and packaging apps. Not even mentioning waiting for starting MS office apps (build for ARM) on the Mac-side, or running any other program on the Mac side. I ran Pixelmator the other day, did a "super ML resolution" on an image and I was floored on how fast that went. Sick!  This was one of the best investments I've made for our company.

 

Hope this helps

  • Like 3

Share this post


Link to post

@futuron and @Lars Fosdal and everybody else using M1 and Delphi. I'm about to enter this adventure. 🙂 It's been a while since you posted, are you going through the experience without issues? I think I have 3 main questions:

 

1. Is Windows 11 the best option, I wonder if someone is using Windows 10 with it. I don't get positive reviews about Windows 11 at all.

2. Is Delphi working flawlessly on it? Compiling for all platforms, the IDE, specially debugging...?

3. Side question, but I wonder your opinion on Pro 16GB to Max 32GB just for software development. Is Pro 16GB being enough?

Share this post


Link to post

I'm still getting used to Win 10 after being pretty much forced to give up Win 7. Win 11 is not even on the horizon for me yet. 

 

I'm using Delphi 10.4.2 and even though my maint subscription expired, I wouldn't bother with D11 because there are still too many bugs in 10.4.2 IDE that haven't been fixed in D11 and nothing that seems worth the bother of upgrading.

 

My main computer right now is a Late 2018 Mac Mini with 6-core i7, 36 GB of RAM, and 2TB of SSD. The only thing it's slow at is rendering long videos on Camtasia. 🙂 

 

It's faster than any other computer anybody has ever given me to work on! When Apple introduces a Mac Mini with an M2 Max, I might upgrade. But it bugs me that it's not possible to upgrade the RAM and/or SSD yourself any more. Apple charges WAY too much for them.

 

The biggest problem is not Delphi or the VM, but the fricking browsers. They seem to fragment the crap out of the system's memory and it just slows down to the point where it reboots itself after a month or so.

 

For what I do, a faster CPU would not make much of a difference to me. But for really huge projects, I can see how it might shorten compile times a bit.

 

One tip I have for anybody using VMs for stuff like this: they tend to grow. And grow. And GROW. Mine are pushing 125 GB now and take forever to backup to spinning HDs. (I exclude the VM folder from Time Machine.)

 

I do periodically copy them to the backup drive by hand. It bugs me that there's no easy way to do a diff back up of them, because they'd be awfully small diffs. 

 

I also make periodic backups to a Samsung T5 1TB USB drive. You can get the T7's now that are twice as fast as the T5's. It takes about 5 mins to copy the VM to the T5. I expect the T7 would take half that. (It doesn't make much sense to pay for a super-fast box then have to wait 30+ minutes to copy your VM in or out!)

 

That's my tip: get a Samsung T7 1TB USB 3.2 Gen 2 device to back up your VMs to.

 

Also, if you get one or two T7's, you can probably get by with just 256GB of SSD and plug one of the T7's in and use it as a backing store while keeping your currently active files on-board.

 

 

 

Edited by David Schwartz
  • Thanks 1

Share this post


Link to post
8 hours ago, Wagner Landgraf said:

are you going through the experience without issues?

  1. For the M-series ARM CPUs, Windows 11 for ARM is the only viable option. Parallells' seamless Windows on MacOS solution is mindblowing.
  2. I am working on integration solutions using IBM App Connect Enterprise these days, so I've not been able to spend so much time with Delphi on the Mac as I'd like to.
    Our company is moving away from Delphi, and the current app portfolio has gone into care & maintenance mode and will in time be replaced with commercial shelf-ware, so my active Delphi time will be greatly reduced going forward.
    As for using Delphi under Win4ARM om M1 - compilation is not a problem, but I have not had time to test debugging on iOS/Android at all, so others must peep up about any eventual issues on that.  Other than the debuggers of Delphi being in an awful state in general - as long as the VM is set up to reroute the USB connections correctly, I would not expect any issues.  
  3. I went for Pro + 32Gb + 2TB as I don't expect to need those gfx cores.  I'd opt for a 64Gb Pro if there was one, but only Max supports 64Gb.  I have to say it is an awesome piece of HW - although - during the winter, I actually miss the heat from the Intel CPU on the Lenovo 😛

I'd opt for even more storage, but Apple are greedy AF.

  • Like 2
  • Thanks 1

Share this post


Link to post

Still very happy with my MacBook.

Compiling for Windows, MacOS, iOS still trouble free. And I could swear it is faster than on a regular native windows machine.

 

Still today I have troubles with connecting my (older) samsung phone to it. I have another regular windows 11 machine and it connects fine there so the culprit is not Win11 but it is Win11 for ARM.

Personally I love Win11. I have it installed on every machine I have. However, other than aesthetics I don't see a benefit of Win11. It looks a little more Mac-like so that's probably why I like it better. If you're into dark-mode on Windows then Win11 is definitely better than Win10.

 

The only 2 remaining problems I have with my virtual machine:

* getting the Samsung phone to connect normally (culprit is Microsoft's ARM implementation)

* getting to run PostgreSQL to run properly (culprit is PostgreSQL does not have an ARM ODBC driver, yet)

 

Everything else, literally everything else works great.

Share this post


Link to post
On 11/26/2021 at 12:51 PM, Lars Fosdal said:

I added the preview version of Windows 11 for ARM to a Parallels VM and I'm installing RAD Studio under that

You're just trying to induce a tear in the fabric of spacetime, aren't you?

  • Haha 1

Share this post


Link to post
2 hours ago, Darian Miller said:

If you upgrade to 12.3 Monterey and use RAD Studio 11.1 - be aware that PA Server has a dependency on Python that is no longer present in 12.3.   https://quality.embarcadero.com/browse/RSP-37609

 

What the...? It's looking for Python 2.7.  Python 2.7 reached end-of-life status Jan. 1 2020! And Python 3.0 came out at the end of 2008. How old are these LLDB binaries?

Share this post


Link to post
7 hours ago, Joseph MItzen said:

You're just trying to induce a tear in the fabric of spacetime, aren't you?

It is already torn.  The 32-bit emulation under W11 for ARM running in a VM is way FASTER than running native on my Lenovo i7 P52.

  • Like 1
  • Haha 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×