The Virtualized Mac Mini Lab

VMware vSphere 5.0 Update 1 on Apple Mac Mini and virtualized Apple Mac OS X 10.7.

For many of my professional years my opinion has been that I don’t need a to run an own lab. I have changed my mind. With all the amazing software that’s been released on increasingly tighter release cycles, I’ve found myself not being able to cope with knowledge wise. Since, I am living in a small apartment I am very limited in space. Therefore, I need a lab environment that is very space efficient. My first obvious choice was an Apple Mac Mini, despite of only supporting one Gigabit network interface (which is a shortage on a Mac Mini server system, IMHO). Blogs released in 2011didn’t sound promising that vSphere on a Mac Mini might ever work. Hence, besides being constrained on time, I stopped my own investigations on this topic. Instead, I started to spend a decent amount of time finding the right equipment equal to the size of a Mac Mini. I was only partially successful. But after reading the blog post from Paraguin (thank you for everything!) earlier this year, I got really excited that he got vSphere 5 running on an Apple Mac Mini. The next day I went to an Apple Reseller and bought a Mac Mini 5,1 (Intel Core i5, 2.3GHz, 2 GB RAM) as well as a 16GB RAM Kit (Corsair CMSA16GX3M2A1333C9).

I shortly want to explain to you what I did in order to get it working. First of all, in preparation, I spent some time reading these posts: VMware Community thread, ESXi on Mac Mini, Lion on ESXi, recommended RAM, RAM checker how-to, unetbootin, and register & download ESXi. Many thanks to all of the bloggers and other folks who contributed to making it happen! Now, let me introduce you to the 7 steps to have your Lion running on top of vSphere!

1. Pre-installation process

I replaced the RAM with 2x 8GB memory DIMMs (you can find the how-to here). Thanks to Apple to build in the slightly more expensive chipset that supports 16GB of RAM, although it is by no means officially supported (that’s why you want to keep your 2GB modules). This was one of the time consuming tasks, when I was evaluating motherboards to build custom systems. And it pretty much narrowed down the choices, too.

2. Installation of Lion

Yes, I started out installing Lion, first. You need to connect your Mac Mini to a monitor (HDMI works fine – also for ESXi installed later on), keyboard and mouse. Connect it to the Gigabit Ethernet interface. The reasons for doing this step was to see if everything is running fine, to register the Mac Mini at Apple, and to run a RAM integrity check (download). Install the software. To run the memory check open a Terminal session (Launchpad – Utilities) and run the command memtest all.

myWPEdit Image

It takes easily an hour to complete. Should an error occur you need to change your affected RAM module (I checked one at a time and then both at the same time – a bit paranoid you might think, but only thorough testing shows errors). The RAM slots in a Mac Mini are as follows: the lower slot is shown right in the picture, below and the upper slot to the left, respectively.

myWPEdit Image

If you have no other computer available you can also use it to download the vSphere image here. Make sure you are downloading vSphere 5.0.0 Update 1 as it supports Lion. Store the image on a memory stick. In order to do that you need unetbootin (available here).

Insert your memory stick (I used one with 4GB capacity, but 1GB will be sufficient). Then start the Disk Utility application (Launchpad – Utilities). Select your memory stick on the left pain and click on erase in the upper menu that pops up. Choose MS-DOS (FAT) as your format and hit Erase…. This process makes sure that your stick contains no data.

myWPEdit Image

Without removing your memory stick, install unetbootin and launch it. Browse to the downloaded ESXi-ISO file and check the correct USB Drive has been automatically chosen for you. Click ok. The ISO is copied to your memory stick. There’s no need to remove it. In contrary to the note in unetbootin, the memory stick will boot from a Mac.

myWPEdit Image

3. Installation of ESXi

Note: I chose to use a prepared ISO-Image that is patched with the NIC driver that the Mac Mini needs (if you’re also a Windows user, The ESXi-Customizer tool comes in handy. It saves you some time on a cumbersome process of patching the NIC driver, afterwards (download). The blog post from Paraguin explains you how to patch your system, once it ESXi is installed (tip: search for Portugal on the given URL).

Insert your memory stick or CD-ROM containing the ESXi-build, if not done so. Reboot or boot your Mac. Whilst doing that keep the Alt / Option key pressed during the boot up sequence until the boot menu appears (you need to attach a USB-Keyboard – the Bluetooth Keyboard doesn’t work, at least not for me). It gives you the option to boot from either the memory stick or the CD-ROM. If this boot option does not appear you have to upgrade the Mac Mini firmware, first (Mac mini EFI Firmware Update 1.6 – this can be done via the Apple software update process – please read here ). In either case choose to boot from EFI (not the Windows option that might appear, too). This starts the VMware Installer.

The installation process is straight-forward. First, you are being asked to select your hard disk drive to install vSphere, too. The remaining capacity is not lost, it is rather presented as a VMFS Datastore (datastore1) to store your Virtual Machines or whatever you prefer. Second, select a keyboard layout that best suits your needs. And third, choose a root password (you can also set it at a later time, but it is less secure).

myWPEdit Image

4. Configure ESXi:

4.1 Networking:

By default, DHCP is selected. However, you might want to set a static IP address for your server. By pressing F2 and providing your root password you can enter the DCUI. Navigate to Configure Management Network and choose IP Configuration. Follow the online instructions to set your IP address, net mask, and gateway. Save your configuration and go to DNS Configuration. A working DNS configuration will be needed for the NTP service to work, which makes sense to synchronize clocks in your lab environment (helpful for troubleshooting).

Configure troubleshooting options (optional, but helpful):

In the DCUI got to Troubleshooting Options and enable both ESXi Shell and SSH. This will allow you to enter the shell of your host and to remotely log in to the shell via ssh (exposure to security risks!). It might be a little confusing, you have to click on enable ssh and it returns disable ssh. To your right you see the status of the option (whether it is enabled or disabled). My pictures from the DCUI are taken from remotely logging into the shell, btw (run the command dcui in putty to get there).

myWPEdit Image

5. Download & install the vSphere client:

Boot up a Windows host and open Internet Explorer. Point it to your ESXi server and download the vSphere Client software. Run the setup to install the client software. It will install all the component it needs in addition, if they are not present (e.g. dotnet 3.5).

myWPEdit Image

6. Prepare your Lion build

Since you can only upload ISO files to your VMFS Datastore as OS installation target, you need to convert the Mac OS X installation app. Download your Lion copy from the Mac App Store. After it is successfully downloaded, it appears in Applications. Right-click on Install Mac OS X Lion. Choose Show Package Contents. Browse to Contents – SharedSupport – InstallESD.dmg. Copy InstallESD.dmg to a convenient location (e.g. Downloads folder).

myWPEdit Image

Open up a Terminal session (Launchpad – Utilities) and run the command hdiutil convert -format UDTO -o Downloads/Lion.iso Downloads/InstallESD.img.

myWPEdit Image

It will add the file extension dmg at the end of the file. Simply remove it and do not keep the extension dmg. Copy the Lion.iso file to your Windows host (in VMware Fusion you can simply use its Shared Folders-option – you can get your 60-day evaluation copy of VMware Fusion here).

On your Windows host, launch the vSphere client and log in with your root credentials. Select your host and go to the “Summary” tab. Click on Browse Datastore… on a datastore of your choice (most likely this will be datastore1, but I recommend a NFS Datastore from a NAS device – it allows for sharing files across ESXi hosts). Choose the option Upload file… and point the browser to the Lion.iso file.

myWPEdit Image

7. Create your Mac OS X-VM and install Lion

myWPEdit Image

Click on New Virtual Machine (icon on the top left of the vSphere Client for Windows). Select CustomOther, Choose Mac OS X 10.7 – 64bit, select two vCPUs, 8GB RAM, and create a new thin provisioned 320GB dependent mode hard disk (you can waste a lot less resources than I did, depending on how you plan to use the VM). Make sure you are keeping the default SCSI Controller: LSI Logic Parallel. Do not select to Start your VM after its creation.

myWPEdit Image

Prior to firing up you VM for the first time, I recommend to edit the Virtual Machine. Select your Lion VM in vSphere client and go to Edit Settings. First, mount your ISO-image and check both boxes Connected and Connect at start.

myWPEdit Image

This allows the VM to boot from the image. Second, add the following line in Advanced Settings: keyboard.typematicMinDelay with a value of 2000000. It helps when you need to work with the Remote Console.

myWPEdit Image

Please follow these steps:

  • Power off the virtual machine, if powered on
  • Right click virtual machine select Edit Settings
  • Click Options > Advanced >  General >  Configuration Parameters
  • Click Add Row
  • Under Name enter keyboard.typematicMinDelay  In the Value field  2000000
  • Click OK
  • Power on the virtual machine

Start your Lion VM and follow the installation instructions.

myWPEdit Image

If it should happen to you that you aren’t presented with a hard disk drive to install Lion to, you need to go back to the menu and start Disk Utility and erase your Virtual Disk. If you are unsure about this procedure, follow these instructions. Then, you can start the installation of Lion. After 45 minutes the installation process should be completed. Congratulations!

3 thoughts on “The Virtualized Mac Mini Lab

  1. Pingback: Running Mountain Lion on vSphere « Cloud Jockey

  2. Pingback: ESX 5.0 Update 1 on Mac Mini 5,3 | - The Blog

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 )

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s