When a Mac experiences bizarre hardware behavior—such as the screen resolution resetting on every boot, the internal speakers refusing to play sound, or the computer failing to remember the designated startup disk—reinstalling the macOS operating system will usually not fix it. These specific settings are not stored on the hard drive; they are stored on a small memory chip on the logic board called NVRAM (Non-Volatile Random-Access Memory). While the standard troubleshooting advice is to hold down a complex keyboard combination (Command-Option-P-R) during boot to reset the chip, this is impossible if you are managing the Mac remotely. Instead, you can read and write to this chip directly from the Terminal using the nvram command.
What is NVRAM?
In older Macs, this chip was called PRAM (Parameter RAM). In modern Intel and Apple Silicon Macs, it is NVRAM. Because this memory chip retains power (either from the main battery or a coin-cell battery) even when the Mac is completely shut down, it is the first place the bootloader looks for instructions before the operating system ever loads.
Step 1: View Current Variables
To see exactly what data is currently stored in the firmware chip, open the Terminal and run:
nvram -p
This prints all the variables. You will see cryptic keys and values. For example, SystemAudioVolume controls the loudness of the iconic Mac startup chime, and boot-args contains special kernel flags used during the boot process.
Step 2: Read a Specific Variable
If you are writing an MDM (Mobile Device Management) script and need to check if a specific flag is set, you don’t want to parse the entire output. You can query a specific key.
nvram SystemAudioVolume
The terminal will return the key and its current hex value (e.g., %46).
Step 3: Modify NVRAM Variables
Because modifying firmware variables can prevent the Mac from booting correctly, you must use sudo to write to the NVRAM.
A classic use case for system administrators is enabling “Verbose Boot.” Instead of displaying the Apple logo and a progress bar during startup, the Mac will print out hundreds of lines of Unix kernel logs. This is invaluable if a Mac is freezing halfway through the boot process and you need to see exactly which driver is crashing.
To set the verbose boot flag:
sudo nvram boot-args="-v"
Reboot the Mac, and you will see the scrolling text. If you want to disable the startup chime entirely in a quiet library environment, you can mute the hardware volume:
sudo nvram SystemAudioVolume=%80
Step 4: Delete Specific Variables
If you have finished troubleshooting with verbose mode, you should not set boot-args to a blank string. It is safer to delete the variable entirely from the firmware so the Mac reverts to its default behavior.
Use the -d (delete) flag:
sudo nvram -d boot-args
Step 5: Perform a Full NVRAM Reset
If a Mac is severely malfunctioning and deleting individual keys isn’t working, you can issue a command to wipe the entire NVRAM chip, simulating the physical “Command-Option-P-R” keyboard reset. (Note: This will clear all saved Wi-Fi networks in the recovery partition and reset the startup disk to the default).
Use the -c (clear) flag:
sudo nvram -c
You must immediately reboot the Mac for the firmware chip to re-initialize its default factory parameters. By using the nvram command, administrators can perform deep, hardware-level diagnostics and resets without ever physically touching the computer.