Tuesday, September 04, 2012

ESXi 5 on older MacBook 4,1

I'm looking to get my MacBook 4,1 under a little more utilization and I thought playing with VMWare's ESXi-5 on it would be interesting.  As well, I'm hoping that I'll be able to install a virtualized Mountain Lion in there (unsupported natively on this MacBook).  My first attempt at installing ESXi 5U1 was a miserable disaster.  ESXi won't let you complete the installation process without a NIC.  This triggered a search to find what NIC was in my MacBook (Marvell Yukon 88E8055 VEN_11AB&DEV_436A) and a requirement to get it working.

I found this thread:
http://www.vm-help.com/forum/viewtopic.php?f=25&t=3558&start=10

It got me started on the path I needed to enable the drivers for my MacBook.  I found that the Marvell driver is already included but it is only enabled for two device ID's and neither were the same as my macbook's; but they were from the same family.

http://www.vm-help.com/esx41/sky2_driver.php

I later found that the driver supports my device ID but you need to edit a text file in the VMWare driver files to enable it.  This will not work though, because VMWare signs their files and if there is a mismatch it will error out (unable to boot or corrupt image or some such).  To get around this we need to inject the driver into the ESXi installer.

In order to do this I needed to understand how to make a driver injectable.  It appears whatever you make will overwrite files during the unpacking process when ESXi is booting.  I was able to "sort-of" confirm this by packing up the sky2 driver and including my Device ID in the ESXi driver ID file.  When I packed up the sky2 binary driver in addition to the text files the install would error out.  Since it's redundant to include the driver as well, I just tried including the driver text file that enables the deviceID.  This file could be located here:

"\etc\vmware\driver.map.d\sky2.map"

To also make this more complicated I did everything on Windows and had to install UnxUtils and UnxUpdates and some Cygwin tools to do the archiving/unarchiving.

By editing sky2.map I could add my device ID:

regtype=linux,bus=pci,id=11ab:4354 0000:0000,driver=sky2,class=network
regtype=linux,bus=pci,id=11ab:4362 0000:0000,driver=sky2,class=network
regtype=linux,bus=pci,id=11ab:436A 0000:0000,driver=sky2,class=network

I compressed the file into a .tgz (bsdtar  -cvzf sky2.tgz "etc") and then used ESXi Customizer 2.7 to inject it into a generic ESXi 5.0U1 image.  I then used Linux  Live USB Creator to move the ISO to a USB key that was made bootable.

I could now boot my MacBook4,1 off the USB key.  At least, it worked to a point.  I got to a stage where I was notified that I had no Network Adapters Found.  At this point I dropped into the ESXi console (Fn-Option-F1), logged in to root and ran the following commands:


vmkload_mod sky2
#loads the sky2 driver
lspci -p
#confirms sky2 driver is loaded for 436A DEV ID
esxcfg-init -n
#initializes network for default settings
installerhelper.sh
#preps install command
install

The install command kicked me out to the default console where I was sitting at the "Network Adapters Not Found" screen.  Simply Fn-Option-F1 to return to the console and run through the install prompts.  Choose the same USB key you used earlier (or choose a new one if you prefer) and do the install.  Once it's complete; restart onto the USB key.  You should go into a full ESXi install but the network (for me anyways) was still no working correctly.  I had to enable the console through the "GUI" of the text screen, drop into the console and run vmkload_mod sky2 and I had network again and was up and running.  Once I can figure out how to automatically run that command I will come back and update this post.  But for now I have ESXi working on a old MacBook and hopefully I'll be able to install Mountain Lion on this old workstation   :)



3 comments:

Macintosh said...

cool

Joe McShinsky said...

Did you make an ISO of it? Any chance you might still have it?

Trentent said...

Unfortunately, I no longer have the ISO and my MacBook is now a Windows 8.1 box.