How to Use nvram to Set Startup Disk for a Dual Boot MacBook (Vista Beta2)

A little background before I go into the details of this guide. If you install Vista Beta 2 on a MacBook using BootCamp Assistant, you cannot set the default startup disk at ease. You can only set Mac OS X as the default startup disk using the Startup Disk tool in System Preferences. You cannot set the Vista Beta 2 as the startup disk once you set the MacBook’s default startup disk as Mac OS X.

nvram is a command line utility to manage firmware NVRAM varialbles. Even though MacBook uses EFI instead of OpenFirmware, it still uses NVRAM to store boot information. After some experiments, I was able to use nvram to set startup disk to either Mac OS X partition or Vista Beta 2 partition. The following steps are for a dual boot machine whose startup disk is Vista Beta 2.

  1. Boot the machine to Mac OS X.
  2. Open up Terminal application and type in
    sudo bash

    to get root access.

  3. In the Terminal window, type in the following to save the Vista boot information to the windows.nvram file.
    nvram -p > windows.nvram
  4. Open the Startup Disk tool in System Preferences and set the startup disk to Mac OS X.
  5. Reboot the machine to Mac OS X.
  6. Repeat step 2.
  7. In the Terminal window, type in the following to save the Mac OS X boot information to the mac.nvram file.
    nvram -p > mac.nvram

Now you have two NVRAM files: windows.nvram and mac.nvram. If you want to set the default startup disk, just do the steps 1 ~ 2 and the following:

  • Set startup disk to Vista Beta 2
    nvram -f windows.nvram
  • Set startup disk to Mac OS X
    nvram -f mac.nvram

When you use the nvram command with -f switch, you might get an error message like this:

nvram: Error (-1) setting variable - 'efi-boot-device-data'

It’s OK. The system boots to the OS as we specified regardless the error.

This post may contain affiliated links. When you click on the link and purchase a product, we receive a small commision to keep us running. Thanks.

1 Trackback / Pingback

  1. Uber Geek Links 08-30-08 « UberTechnica

Leave a Reply