Updates from November, 2014 Toggle Comment Threads | Keyboard Shortcuts

  • duncanbowring 12:48 on November 16, 2014 Permalink | Reply
    Tags: esxi, yosemite   

    OSX 10.10 Yosemite Virtualization – ESXi installation from ISO 

    Download Yosemite. To Applications “Install OSX Yosemite.app”

    Things changed since Mavericks so you can’t just convert the internal DMG to an ISO anymore.

    #!/bin/bash
    #
    # This executable converts a Yosemite .app (which allows to upgrade a machine
    # from Mac OS 10.6.7+ to Yosemite) into a Yosemite .dmg (which allows to
    # install Yosemite from scratch on a machine).
    #
    
    set -x
    set -e
    
    # The first argument is the path to the .app bundle (the input of the
    # executable).
    inputApp="$1"
    # The second argument is the path to the .dmg file (the output of the
    # executable), which must end with ".dmg".
    outputDmg="$2"
    [ "${outputDmg: -4}" = .dmg ]
    
    #
    # The problem: /System/Installation/Packages inside /BaseSystem.dmg inside
    # "$inputApp"/Contents/SharedSupport/InstallESD.dmg is a dangling symlink,
    # which prevents installing Yosemite from scratch.
    # The solution: Replace the symlink with the /Packages directory inside
    # "$inputApp"/Contents/SharedSupport/InstallESD.dmg.
    #
    
    tmpDir=`mktemp -d -t 'Create Yosemite Installer'`
    installMnt="$tmpDir"/install
    installPkg="$installMnt"/Packages
    outputMnt="$tmpDir"/output
    outputPkg="$outputMnt"/System/Installation/Packages
    
    cleanup() {
       if [ -d "$outputMnt" ]; then
          hdiutil detach "$outputMnt"
       fi
    
       if [ -d "$installMnt" ]; then
          hdiutil detach "$installMnt"
       fi
    
       rmdir -- "$tmpDir"
    }
    
    # Cleanup on failure.
    trap cleanup ERR
    
    # Mount InstallESD.dmg so we can access /BaseSystem.dmg and /Packages inside.
    hdiutil attach "$inputApp"/Contents/SharedSupport/InstallESD.dmg \
       -mountpoint "$installMnt" -noverify -nobrowse
    
    # Create "$outputDmg", a read/write copy of the read-only BaseSystem.dmg.
    hdiutil convert "$installMnt"/BaseSystem.dmg -format UDRW -o "$outputDmg"
    
    # Enlarge "$outputDmg" to accommodate for our modifications. The UDRW image
    # format is not sparse, so we must precisely compute the new size.
    curSectors=`hdiutil resize "$outputDmg" -limits | tail -1 | awk '{ print $2 }'`
    extraSectors=`BLOCKSIZE=512 du -s -- "$installMnt" | awk '{ print $1 }'`
    hdiutil resize "$outputDmg" -sectors $((curSectors + extraSectors))
    
    # Mount "$outputDmg".
    hdiutil attach "$outputDmg" -mountpoint "$outputMnt" -noverify -nobrowse
    
    # Modify "$outputDmg".
    rm -- "$outputPkg"
    cp -r -- "$installPkg" "$outputPkg"
    
    # It is the solution for the common error - The operation couldn't be completed. Undefined error: 0
    cp "$installMnt"/BaseSystem.chunklist "$outputMnt"/BaseSystem.chunklist
    cp "$installMnt"/BaseSystem.dmg "$outputMnt"/BaseSystem.dmg
    
    # Cleanup on success.
    trap ERR; cleanup
    
    ls -alh -- "$outputDmg"

    Make the above shell script executable and pass in the parameter of the downloaded .app and the output dmg.

    Once you’ve done this use Disk Utility – Convert Image to DVD/CDR Master (it will have a .cdr extension but it’s an ISO) then rename the cdr to iso

    Mount it in vmware and boot. It’ll boot properly now.

    It didn’t see my vmware disk.. but you can launch Disk Utility within the OSX installer. From here, you can partition the virtual disk with a Journaled Mac OS filesystem. The installer will be able to continue.

    Once finally into OSX, install vmware tools as normal and update OSX.

    FYI, I’m doing this on a Mac Mini – for licensing compliance reasons. I haven’t tried it on regular ESXi hypervisor.

    Screen Shot 2014-11-16 at 12.47.17 PM

    Advertisements
     
    • Anon 05:41 on April 1, 2015 Permalink | Reply

      You could also automate the final .dmg to .iso step. DiskUtility is just doing:

      hdiutil convert /path/imagefile.dmg -format UDTO -o /path/convertedimage.iso

    • John McDonald 18:43 on August 15, 2015 Permalink | Reply

      This worked perfectly. I spent hours trying to generate the right iso that would install in ESXi. Thank you so much!

    • Robert Pendell 09:29 on September 27, 2015 Permalink | Reply

      Thanks! I’m now uploading the resulting iso to my 2011 Mac Mini (5,2) running ESXi 6.0. 🙂

  • duncanbowring 02:04 on November 16, 2014 Permalink | Reply
    Tags: mac,   

    Managing free ESXi 5.5 on a Mac 

    Found out the hard way that you can’t use the web interface of VMware 5.5 on the free ESXi server. You need the vCenter appliance, which needs a license.

    If you don’t have a PC available, you can download VirtualBox and an appliance / pre-configured VM from Microsoft (of all places).

    https://www.modern.ie/en-us/virtualization-tools#downloads

    You’ll then be able to install the vSphere client to manage your ESXi instance.
    By the way, you can use VMware Workstation 10 to connect to the ESXi instance if you need to use the new features of 5.5.

    Not exactly a fantastic solution. A valid workaround, at least. One step closer to justifying the move to KVM…

     
  • duncanbowring 15:48 on November 15, 2014 Permalink | Reply
    Tags: virtualization,   

    Install ESXi 5.5 on 4GB machine (and a Mac Mini..) 

    Let’s say you’re waiting for more RAM to come in the post and you want to get your ESXi instance up, but you’ve only got 4GB RAM (Think Mac Mini). Well, there is a solution.

    By the way, if you’re installing ESXi on a Mac Mini, you NEED to look at this blog:

    http://www.virtuallyghetto.com/2013/09/running-esxi-55-on-apple-mac-mini.html

    Let’s begin:

    Boot the system from USB Stick with ESXi installer on it.
    Once the installer welcome screen shows up, press alt+F1 to go to the first console (login prompt)
    Login as root, no password.

    1. cd /usr/lib/vmware/weasel/util

    ::upgrade_precheck.py is where the magic happens.

    1. rm upgrade_precheck.pyc // (the compiled version)
    2. mv upgrade_precheck.py upgrade_precheck.py.old // because the file can not be edited due to some immortal flags and lack of tools to remove these flags
    3. cp upgrade_precheck.py.old upgrade_precheck.py
    4. vi upgrader_precheck.py // then search for line that has ((1024 * 2 ) – 32)

    Replace the 32 with 64 and save (:w! in vi)

    1. ps -c | grep weas // find the PID
    2. kill -9 #### // where #### is the python PID

    Return to the second console with installer (alt+F2)
    Voila.

     
    • Frank 02:58 on April 27, 2015 Permalink | Reply

      i downloaded the the the image, but it looks like the line with ((1024 * 2 ) – 32)
      doesn’t exit in the latest version.

c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel
%d bloggers like this: