Skip to main content

SMBIOS Identity Generation

What SMBIOS Identity Is​

SMBIOS (System Management BIOS) provides hardware identity data that macOS reads during boot to determine what machine it is running on. macOS uses this data to:

  • Select the correct kernel configuration and hardware drivers
  • Validate hardware for Apple services (iMessage, FaceTime, iCloud)
  • Apply model-specific power management and thermal profiles

In a VM, SMBIOS data must be injected via QEMU arguments so macOS sees a plausible Apple hardware identity. Without valid SMBIOS, macOS boots in a degraded state or refuses to activate services.

Identity Generation Flow​

Generated Identity Fields​

FieldFormatPurpose
Serial12 charsApple hardware serial number
MLB17 charsMain Logic Board serial (with checksum)
UUIDStandard UUID v4Unique machine identifier
ROM6-byte hexDerived from MAC address
Modele.g. MacPro7,1SMBIOS product name

All fields are represented in the SmbiosIdentity dataclass:

@dataclass
class SmbiosIdentity:
serial: str
mlb: str
uuid: str
rom: str
model: str
mac: str = ""

Serial Number Generation​

Apple serial numbers follow a 12-character format encoding manufacturing metadata:

{country:3}{year:1}{week:1}{line:3}{model_code:4}
SegmentLengthSource
Country code3Manufacturing location (C02, C07, CK2)
Year char1Encoded from year via _YEAR_CHARS lookup table
Week char1Encoded from manufacturing week (1-52) using base-34
Line code3Production line number (0-3399) encoded as 3 base-34 digits
Model code4Hardware model identifier (e.g. P7QM for MacPro7,1)

Base-34 Alphabet​

Apple uses a 34-character alphabet that excludes I and O to avoid ambiguity:

0123456789ABCDEFGHJKLMNPQRSTUVWXYZ

Year and Week Encoding​

Year characters cycle every 10 years from 2010 using the lookup table CDFGHJKLMN. Weeks 1-26 use the base year character; weeks 27-52 advance the year character by one position. The week position within the half-year is encoded as a base-34 digit.

Production Line Encoding​

The production line number (0-3399) is encoded as three base-34 digits using standard positional encoding:

d1 = line // (34 * 34)
d2 = (line // 34) % 34
d3 = line % 34

MLB Generation​

The Main Logic Board serial is a 17-character string with a built-in checksum:

{country:3}{year_dec:1}{week_dec:2}{block1:3}{block2:2}{board:4}{block3:2}
SegmentSource
CountrySame manufacturing location as serial
Year/WeekDecimal-encoded manufacturing date
Block1Random from pool (200, 600, 403, 404, etc.)
Block2Random from pool (Q0-QZ in base-34)
BoardBoard code for the model (e.g. K3F7 for MacPro7,1)
Block3Computed analytically to satisfy mod-34 checksum

Mod-34 Checksum​

The checksum uses an alternating weight scheme (3/1) across all characters:

def _verify_mlb_checksum(mlb: str) -> bool:
checksum = 0
for i, ch in enumerate(mlb):
j = BASE34.index(ch)
weight = 3 if ((i & 1) == (len(mlb) & 1)) else 1
checksum += weight * j
return checksum % 34 == 0

The final two characters (block3) are computed so the total weighted sum is divisible by 34. This matches the format Apple uses for genuine MLB serials.

ROM Derivation​

The ROM field is a 6-byte value derived from the VM's MAC address by stripping the colon separators:

MAC: AA:BB:CC:DD:EE:FF -> ROM: AABBCCDDEEFF

This ties the SMBIOS identity to the VM's network interface, which macOS uses for hardware binding in Apple services.

Pure Python Implementation​

The entire SMBIOS generation is implemented in Python using only standard library modules (secrets, string, uuid). There is no dependency on the external GenSMBIOS binary or any macOS-specific tools. All randomness uses secrets for cryptographic quality.

Platform Data​

Model-specific manufacturing data is stored in APPLE_PLATFORM_DATA:

ModelCountry CodesYear RangeBoard Code
MacPro7,1C02, C07, CK22019-2023K3F7

All supported macOS versions (Ventura through Tahoe) use MacPro7,1 as the SMBIOS model.