Proper Assigning of Virtual Machines in an MDM

A Collection of Links and Configurations

I had a little trouble enrolling a macOS VM in my MDM(Jamf) earlier today. The VMs kept enrolling as iOS devices rather than as comptuers. Since I wasn’t testing DEP workflows I didn’t need to deal with adding an actual serial number to the VM, I just needed to enroll the VM through the enrollment portal. Through some conversation with some friends in a Mac Admins Slack channel and searching around on the web I was able to collect all the info I needed to get this working right.

Most of the information I found in my search was for getting a virtual machine working with a serial number from a broken macOS device that is still in one’s DEP. While helpful, I didn’t want to have to go digging up a serial number for this VM[1]. The following Reddit comment got me on the right track[2]:

I am using ESXI on a Mac Pro. works pretty well and is free (beyond the hardware).

I just create a MacOS vm as normal, when you get to the stage where it asks to create a user account I power down and I have a script that adds hw.model to the vmx file of the VM and then boot it up and keep going. It enrolls as whatever hardware model ive set it as not as a mobile device.[3]

For most of you, hw.model is probably all you need to be off and running. If you need a few more details[4], Mr. Macintosh has a good list of hardware model identifiers you can take a look at.

To make an increasingly long story short, do this:

  1. Power down the VM
  2. Right click the VM in your VM library and select “Show in Finder”
  3. Right click the VM in question and select “Show Package Contencts”
  4. Open the .vmx file in a text editor[5]
  5. Pick a computer model you want to use and copy the hardware identifier(e.g. MacBookPro11,5)
  6. Add the line hw.model = "$hardwareIdentifier" at the bottom and save[6]
  7. Power on the VM and enroll

The VM should now enroll as a “Computer” rather than a “Device”.

  1. I’m fortunate enough to have enough hardware lying around that I can use to test DEP workflows. I know that’s not the case for everyone, which is why I’m a big fan of the ability to set up VMs with actual serial numbers. If you need to read more about that there are a lot of great posts on it. Here’s one.  ↩
  2. To be fair if I’d actually read through the posts on getting VMs set up for DEP enrollment I would have noticed that they specify the need for a hardware identifier and tell you where to put it. But also to be fair that’s probably giving me too much credit and I would have spent a long time being frustrated about needing to figure out which serial number to use and would have ignored the fact that the answer was literally in the article I was frustrated about.  ↩
  3.  ↩
  4. Looking at you, future me.  ↩
  5. I like BBEdit.  ↩
  6. I ended up using hw.model = "MacBookPro11,5".  ↩

Leave a Reply

Fill in your details below or click an icon to log in: Logo

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

Facebook photo

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

Connecting to %s