First of all good to be back. Thanks to everyone who reached out to me during my recovery! 2 months of inactivity puts me in a situation where it urgently time to get back up to speed and up to date with all changes in the MacAdmin world. Apple released iOS13, macOS 10.15 Catalina,… Jamf released Jamf Pro 10.15, 10.16… some Jamf Connect updates… and much more….so more than enough to get back into action!
That said, let’s start with updating our test environment, and one of the things I need on a daily basis are macOS 10.15 Catalina Virtual Machines. Those who have been following this blog for a while (1 Year since I started, 100k hits! Thanks btw!) know that I’m a big fan of automating things, so my preferred way of deploying VM’s is a script running against ESXI which automates the creation of a vFuse based vm.
I might be updating my VMWare Fusion and Parallels Desktop post where needed for Catalina as well, but for this occation I’d like to focus on what I need to automate my VM’s in ESXI:
- First of all we’ll need to update ESXI to 6.7 update 3 (or 2)
- Get VMWare Fusion 11.5
- Get the latest version of AutoDMG
- Get the latest version of vFuse
- Tweak the vFuse template to be compatible with Catalina
- Tweak the ESXI script to be compatible with Catalina
Update ESXI to 6.7 Update 3
So, first of all: ESXI, as this is where my VM is gonna live. Until now I was running ESXI 6.7 and this does not run macOS 10.15 Catalina (VM stuck at Apple Logo at boot). At least for me it was.
Subject to your server, free trial or VMWare licensing you will need to download the ESXI 6.7 Update 3 (or 2). There are multiple ways of updating your ESXI, but my preferred method is using the offline bundle. The reason I prefer this method is because of the simplicity:
- Upload the bundle (.zip file) to your datastore in ESXI
- Put the server in maintenance mode
- Run a command to update ESXI
- No USB sticks and physical access to the server needed
Note: if you are downloading the .zip bundle on macOS it might automatically unzip it depending your system preferences. If that's the case, compress it again but make sure to only add the subfolders and files to the archive and not the main folder where the content was zipped to. The hierarchy of files and paths of the zip file needs to be maintained.
After uploading the bundle to the datastore, and putting the server in maintenance mode, the only thing left to do is run the following command:
esxcli software vib install -d “/vmfs/volumes/Datastore/DirectoryName/EXACT-NAME-OF-THE-BUNDLE-FILE.zip”
If all goes well, you will end up with a long block of text confirming the update is completed. Reboot your server and DONE!
VMWare Fusion 11.5
Because vFuse needs VMWare Fusion to be running, and we need Catalina support, we need to upgrade our VMWare Fusion to 11.5. Get your free trial here if needed.
Update AutoDMG
vFuse needs a macOS DMG to create the VM, so no better tool imo than AutoDMG. I used the (at this moment of writing) pre-release version v1.10b587 which worked fine. Well, with one remark, see below.
Update vFuse
With VMWare Fusion 11.5 goes a compatible vFuse version, so I went for the latest (at this moment of writing) version 2.2.5.
vFuse Template
Those who are unfamiliar with vFuse might want to have a look at one of my previous post here, but for those who just want to know what to change in the template, here is my basic template to use with vFuse. Obviously this can be tweaked to your needs (or you could decide not to use a template at all), but for all those fancy things I’ll have to refer you to the vFuse wiki here.
For me the following template is more than enough:
{
"source_dmg": "/Users/TTG/Desktop/AutoDMG Builds/osx-10.15.1-19B88.apfs.dmg",
"output_dir": "/Users/TTG/Desktop/vFuse Builds",
"output_name": "macOS151",
"hw_version": 15,
"mem_size": 4096,
"disk_type": 0,
"bridged": true,
"enable3d": false,
"hw_model": "MacBookAir7,1",
"serial_number": "C02S80QWERTY"
}
Note: The template above has all the attributes needed for making the VM compatible with Apple's Automated MDM Enrolment (previously DEP). Important here are the HW Model and Serial Number which must match an existing device of your ABM or ASM account. Also, the VMWare Hardware Version is set to 15 to make it compatible with ESXI. VMWare Fusion uses HW Version 16, but you can upgrade the VM at first boot if you would decide to use it in VWare Fusion (you will be prompted to do so anyway). More about VMWare HW Version here.
ESXI Script
Once again I’ll refer to my previous post here for a detailed discussion about this script, but I you’ll find the updated version with Catalina support on my github here.
The main thing I changed is adding darwin19-64 (representing macOS Catalina) and VMWare Hardware Version 15 to the script.
Upload the script to a suitable location in your ESXI Datastore.
As mentioned in my previous post, once again all credits go to Rich Trouton for this script. I only changed some numbers again!
Putting it all together !
So, with all the above updates you should be good to build a VMWare Fusion VM running Catalina, compatible with Apple’s Automated MDM Enrolment.
Note: For those who are not interested in auto-enrolling in MDM, just remember that a HW Model and SerialNumber is still required. In this case it does not need to be matching an existing device, but the HW Model must still be an existing (current) Mac model. The serial number can be anything you want, but must be alphanumeric (no special characters) and of the same lenght of a normal serial number.
Just follow the steps in my previous post:
- Create a macOS DMG with AutoDMG
Note: I mentioned earlier that I had 1 remark. The pre-release version I used worked fine, but I had to move the macOS Cataline installer into a DMG to make it work. To do this add the installer to a folder and use Disk Utility to create a new DMG from that folder. Without this step, the build process of AutoDMG errors.
- Run vFuse using the dmg above and the template. Run the following command in Terminal after installing vFuse:
vfuse -t /path/to/template.json
- Grab the .vmdk file from the package content of the VM and upload it to your ESXI Datastore.
Note: in my previous post I mentioned 2 VMDK files. A normal one and a flat one. In my current test I only get 1 .vmdk file. Need to check why, but just using that 1 file seemed to work fine.
- Run the ESXI Script in the ESXI console (or over SSH):
/vmfs/volumes/SSD/Scripts/esxi_macos_vm_creationCatalina.sh -n macOS10_15_1 -d /vmfs/volumes/5b6e08bb-4e1d2549-f33c-685b35d36842/Templates/macOS151.vmdk
Note: make sure to change the path to the script matching the location in your datastore, as well as the location and filename of your vmdk file.
Grab a coffee… and wait for your VM to be deployed. The heavy lifting is done only once. From the moment you have the vmdk and the script in ESXI, creating new VM’s over and over again is just a matter of running the ESXI script again, or adding a button in iOS with Shortcuts 🙂
Just remember that for those who are using VMWare Fusion, you can stop after creating the VM with vFuse. I’ll have a look at the manual creation of Catalina VM’s in VMWare Fusion and Parallels Desktop later, and update the blog accordingly where needed.
That’s all folks! I hope this quick first post post my absence is somewhere usefull for someone. At least it’s a start to get back into bloggin action!
As always, if you like this blog, tell your friends about it and leave a comment down below. Don’t hesitate to correct any mistakes or add some additonal value!
Brgds,
TTG
Good to see you back in action. I always have been following your blog.
This post is very useful for any MacAdmin.
About the following step => Create a macOS DMG with AutoDMG
If you put the Catalina installer on an external media it also works.
About the ESXI steps. Before running the script you need to change the permissions on it. I did a chmod 755. Otherwise you get a permission denied error.
Thanks again for this great post.
Hi Sebastien! Thanks!
Yes indeed, all good comments! I did indeed change the permission to 🙂
I believe the Apple licensing terms only allow you to install macOS in a VM on Apple hardware. That was the case last time I checked, anyway…. Meaning VMWare Fusion, yes, ESXI no? … or.. am I wrong…? Comments on that?
100% correct! That’s why I run ESXI on a Mac Mini 2012. Fine till Mojave, bit slow with Catalina. Guess a Mac Pro would be better.
How are you setting up DEP Enrollment with this, due to ESXI 6.7u3 not allowing keyboard input on the Guest OS setting when the guest is set to either macOS10.14 (for 10.15) or set to Linux Other (32-bit).
This is the thing that is preventing me from testing our DEP enrollment process as I can’t authenticate machines into our MDM server due to the lack of user input/keystroke input.
For me the keyboard works when setting the guest to 10.14. The only place where it does not work is the very first screen where you select your country. I need to scroll down and select the keyboard with the mouse. Hitting the first letter of the country does not jump to the list of countries starting with that letter, as it should do. Using the arrow keys works as well.
Hm, unfortunately that is not the case for me. :/ By default, after running your edited script, the guest boots (automatically) with (Other – 32bit), I have to change it to 10.14 manually.
I am also unable to select the location with the keyboard, but as soon as I pass to the next screen I have mouse input and minimal keyboard input (seems like everything maps to the escape key). If I change the input selection at the next screen after the location seletion, and select international english, it also seems to map to esc.
I also tried reinstalling esxi from scratch (this is only used for macOS testing) and still have the same issue. :/
Happen to know where I could diagnose this? Looking through the vmware.log file – I don’t see any obvious errors being mapped when keyboard input occurs.
Interesting. I just noticed the same behavior after leaving the guest VM ‘lock its screen’. When trying to put the user password I see the same behavior as you describe. Rebooted the guest vm and it’s fine again. Weird.
Just wanted to let other folks dealing with this that having your macmodel set to MacPro6,1 or MacPro7,1 is causing kernel panics when trying to upgrade to Catalina. I had to change my model and board to something else. https://github.com/acidanthera/bugtracker/issues/424
Thanks for the description. Running two OSX VM isn’t easy.
Nice article!
But you have forgotten to mention that VMWare Unlocker must be installed on ESXi
Depends where you install ESXI on. I did not need to install the unlocker as I virtualized my 2012 Mac Mini. Also, good to mention is that virtualizing macOS on non Apple Hardware is against Apple’s terms and conditions. Hence I did not go that route and did not mention the unlocker indeed.
Exceptionally helpful info, thank you!
Even after changing the permissions of the ESXi script (chmod 777) I’m still getting a permission denied error. Is there anything else I can try?
When just running the script? What is the user who owns the file? If you run ls -lsa , what attributes due you get?
Hello, we try to run MAC OS 10.15 on a MAC Pro 7.1. ESXi runs fine. We have also tried to install the VM with the script.
After creating the VM the VM starts and is running in a boot loop, but not starting the installation process.
Any idea?
Hi Alex, no experience with ESXI with Mac Pro 7.1 myself, but: https://www.virtuallyghetto.com/2020/01/esxi-on-the-new-2019-apple-mac-pro.html
Hi,
can you give me a favour and go on to your guest OS to network settings and try to edit (manually IP address) check if KEYBOARD actually functioning properly (as at my installation it just cancels with any key) for example : I try to change IP address to static with one of my internals (while I try to type 192…. it just cancels and goes to network home screen) if it the case with you too do you think it is a bug ?
Yeah I have that issue as well with any keystrokes. I moved to using ARD to use the guest macOS.