You are here: Home >> Articles & Tutorials >> How To Use VMWare Install And Run Mac OS X 10.7 Lion In Virtual Machine

How To Use VMWare Install And Run Mac OS X 10.7 Lion In Virtual Machine

By lilingjie2015 on Mar 17, 2011 |Computers

Was this helpful? 0 0 Comments



If you want to run the latest Mac OS X 10.7 Lion Developer Preview, but you don't want to bother setting up another partition or upgrading your existing Mac OS X 10.6 installation, there is a third option to you, running Mac OS X Lion in a virtual machine with VMware. This guide will show you how to use VMWare install and run Mac OS X 10.7 Lion in virtual machine.

How To Use VMWare Install And Run Mac OS X 10.7 Lion In Virtual Machine



Step 1: Create a Blank Disk Image
First you need to use Disk Utility, create and mount a new image with the following settings

Name: MyInstaller or whatever you want
Size: 5GB
Format: Mac OS X Extended
Partitions: Single partition - Apple Partition Map
Image Format: DVD/CD master


Step 2: Mount the Lion Installer Image
The image I obtained mounts as 'Mac OS X Install ESD'. If yours mounts as something different, then you will need to make any necessary changes to reflect that in the following steps.

Step 3: Mount the Base System Image
Mac OS X Lion installer image included a bunch of hidden files, to get to them you will need to run the Terminal application. One of these hidden files is BaseSystem.dmg which is used to boot the system.

$ cd /Volumes/Mac OS X Install ESD
$ open BaseSystem.dmg

The volume will mount as 'Mac OS X Base System'

Step 4: Copy the Base System
The whole contents of the base system needs to be copied to your installer image. The 'Restore' feature in Disk Utility works great for this. When that is finished, you can eject BaseSystem image, it is no longer needed.

Notice: If you chose to Erase destination, your installer image will now have the same name as the source, 'Mac OS X Base System', I was rename mine back to 'My Installer'.

Step 5: Setup 'kernelcache'File
The First file you needs to copy from the Mac OS X Lion install image to your installer image, then the boot configuration file updated to specify the location of the file.

$ cp /Volumes/Mac OS X Install ESD/kernelcache /Volumes/MyInstaller/kernelcache
$ cd /Volumes/MyInstaller/Library/Preferences/SystemConfiguration/
$ sudo vi com.apple.Boot.plist

Make sure the boot file contains at least the following key/value to specify the location of the kernelcache file

Kernel Cache
kernelcache

Step 6: Copy the Installation Packages
Before the packages can be copied fro the Lion installer image, there is a file on your installer image that needs to be deleted.

$ sudo rm /Volumes/MyInstaller/System/Installation/Packages
$ sudo cp -R /Volumes/Mac OS X Install
ESD/Packages /Volumes/MyInstaller/System/Installation/Packages

Notice: The copy command will take a few minutes, it is copying a few gigabytes of data, so be patient.

Step 7: Flag The System As a Server Installation
In order to boot an OS X volume in VMware, it needs to be a server. The system checks for the existence of a file in a specific location, you can imitate a server installation simply by creating that file.

$ cd /Volumes/MyInstaller/System/Library/CoreServices
$ sudo touch ServerVersion.plist

That's it for the installation disk, both installer images can be ejected.

Step 8: Create a Virtual Machine
1. Open VMware Fusion and select "New…" from the File menu.
2. Click the "Continue without disc" button.
3. Select "Create a custom virtual machine" and then Continue.
4. Select 'Operating System: Apple Mac OS X' and 'Version: Mac OS X Server 10.6 64-bit', then click Continue.
5. Click the "Customize Settings" button, then name and save the new virtual machine.
6. Choose "CDs & DVDs" from Settings, then click "Use disc image" and select your installer image.
7. Choose "Hard disks" from Settings, deselect "Split into 2 GB files" for the pre-created hard drive and click Apply".
8. Feel free to make any other changes to the settings with one caveat, you must use a SCSI hard disk; IDE drives are not recognized by the installer after it boots. Also, if the hard disk is going to be used as a boot disk, it cannot be split into separate 2 GB files, so make sure to deselect that option when the HD is created.

Step 9: Replace the VMs NVRAM
The default NVRAM will boot up Mac OS X Snow Leopard, but it will not boot up a Mac OS X Lion volume. You can download the NVRAM file from that VM.

(1)Download and uncompress the nvram file.
(2)Locate your VM within the Finder, right click and select "Show Package Contents".
(3)Delete the current nvram file if one exists.
(4)Copy the downloaded nvram file into the folder and rename it to match the name of your VM; mine is named, "Mac OS X 10.7″, so the nvram file would be renamed to "Mac OS X 10.7.nvram"
(5)Now you should be able to run the VM and it will boot up to being the installation process.

Step 10: Installing Mac OS X Lion
After the installation disk boots up, you should run Disk Utility and format the hard drive first. All the norms apply; GUID partition map, Mac OS X Extended(Journaled) format, etc. Quit to return to the installer, when done. Then continue with the installation. When the installation is complete, it will attempt to reboot the VM by using the freshly installed OS on the hard disk. It won't boot, because it is not a server installation.

Step 11: Forcing the VM to Boot From CD
VMware is not allows you change the startup disk in the VMs settings, so you need to force the VMware to boot from CD.

Start VMware, and you will see the VMware splash screen, hit the escape key, and this will bring you to a boot menu, select "Boot Manager"

This will bring you to another menu where you choose which device to boot from. With "Mac OS X" selected, you can look at the "Device Path" info on the right side of the screen to see the path to the default Mac OS X boot device. Then you can move through the list to determine which device would be the CD to boot from. If you choose the wrong device at first time, you can just restart the VM and choose another until you get it right.

Step 12: Flag the New System As a Server Installation
After the VM boots from the install disk again, just run the Terminal from the Utilities menu

I labeled my HD, "OS X Lion HD" when I initialized it, so I would enter the following to "touch " the system,

# touch "/Volumes/OS X Lion HD/System/Library/CoreServices/ServerVersion.plist"

Now you can quit the Terminal, then choose Startup Disk from the utilities menu and restart from the hard disk.

Was this helpful? 0 0 Comments

Do you enjoy this post? Help us better!

You're reading How To Use VMWare Install And Run Mac OS X 10.7 Lion In Virtual Machine .

Comments

Hot Topics People Are Chatting

My Questions & Articles

Find latest questions, answers and articles.

Questions I Ask

Questions I Follow

Articles I Share

Do you like it? Share with friends!

Don't forget to follow us!

If you like our tutorials and answers, please give us a +1!