views:

120

answers:

4

One of the things I've run across on Windows is when a web browser plugin or program you're developing makes an assumption that something is installed that, by default, isn't always present on Windows. A perfect example would be .NET - a whole lot of people running Windows XP have never installed any versions of .NET and so the installer needs to detect and remedy this if necessary.

The way I've been testing this in Windows is to have a virtual machine with a snapshot of a clean, patched, but otherwise untouched install of XP or Vista or 7 or whatever. When I'm done testing I just discard any changes since the snapshot. Works great.

I'm now developing something for the Macintosh, a platform which is very new to me, and I'm seeing that virtualization does not appear to be an option. It's explicitly forbidden in the EULA of Mac OS X, it's only allowed from Mac OS X Server, which seeing as how I'm targeting an end product is of no use to me, and the one program I see which can virtualize it - VirtualBox - only supports the server and actively nukes any discussion of running the consumer/client version of Mac OS X. And the only instructions I find anywhere on the topic seem to involve the use of "hacking" programs which is very much incompatible with the full-time gig I'm trying to do this for.

So it looks like virtualization is out, but at various points I'm going to want or need to simulate what it's like to install and run this software on a "clean" Macintosh. How do people usually do this? Just buy multiple Macintoshes and use Time Machine? Am I thinking about this all wrong and everything Just Works?

To be clear

  • I'm not trying to run Mac OS X on a Windows machine. I have a Macintosh, I'm fine with virtualizing Mac OS X on Apple hardware, I'm just not seeing a route to making the non-Server version do this.
  • I'm aware that Mac OS X Server can be virtualized but that's not what I'm going for.
  • I'm aware that there are unsanctioned/unsupported methods of making Mac OS X run in virtualization programs like VirtualBox but for legal reasons I am not interested in those.
  • My question is not "how can I do this?" but rather "so this thing I do on Windows seems to not be possible, generally, on the Macintosh, so what do people do to achieve what I'm going for?"
+1  A: 

You don't need a second Mac, you could just install a second OS X Installation on another partition or hard drive.

Michael Stum
A: 

This is generally what you have a "test bed" for. Get a second Mac, image the clean install, then install/re-image as needed.

samoz
+2  A: 

As I sit here with umpteen versions of various windows VMs on my work machine I never really need that on the Mac. The biggest reason is the way that applications are deployed in bundles on the Mac. Ideally, installation is a copy and uninstallation is dragging the app to the trash. On windows you have much more shared state between applications that must be accounted for that most apps don't have on the Mac. Now if you are writing a device driver or VPN client or something that needs to get into those parts of the system then you don't have that luxury.

Where I really feel the need for virtualization is when I want to target different versions of OS X, or do some sort of regression check to see if things really did work different under version X.Y.X.

So how do we achieve what you are going for, the default is don't care because you don't have the same risks due to app bundles. Or if you care then buy a bunch of external hard drives to boot off of and swap them out as need be. (I only did that once for two versions of OS X, so I cannot say it really is industry practice.)

Ukko
How often do you run into the situation where the thing you're developing is relying on some file or piece of technology that you have installed for some reason (Xcode, iWork, whatever) but that the fresh-out-of-the-box Macintosh won't have?
Schnapple
Not often, Apple seems to be really good about providing a strong baseline and the other stuff I need so too odd to assume it is present so I just include my own frameworks inside the app bundle. I do pretty specialized stuff though so YMMV.
Ukko
A: 

Am I thinking about this all wrong and everything Just Works?

This isn't a very good answer on my part, but kinda, yes! There aren't really any frameworks that the user is expected to have that aren't installed by the application itself.

To make this a better answer, it is certainly possible to virtualise OS X "Client" under say VMWare Fusion. From my answer to an older question:

VMWare Fusion can run 10.5/10.6 client VMs, but you will have to trick it into installing by editing the OS install disc.

There are some problems with this method, as enumerated by someone who tried it (mostly due to lack of 3D acceleration):

  • DVD Player Does not function has error (-70017)
  • Most Of The Screen Savers do not work.
  • Front Row Loads to Black Screen
  • Screen recording in Quicktime produces error (OSStatus error -108)
  • Sound Does not Work Bug in all Mac os's When Virtualised
  • System Profiler cannot find alot of information about the system components .
  • Startup time is slow under the virtual environment of 20 Seconds

Depending on the requirements of your testing, these may or may not be deal-breakers for you.

To trick VMWare into thinking that a client 10.5 or 10.6 disc is actually server, you have to edit Fusion's base image for new VMs:

sudo bash
cd "/Library/Application Support/VMware Fusion/isoimages"
mkdir original
mv darwin.iso tools-key.pub *.sig original
sed "s/ServerVersion.plist/SystemVersion.plist/g" < original/darwin.iso > darwin.iso
openssl genrsa -out tools-priv.pem 2048
openssl rsa -in tools-priv.pem -pubout -out tools-key.pub
openssl dgst -sha1 -sign tools-priv.pem < darwin.iso > darwin.iso.sig
for A in *.iso ; do openssl dgst -sha1 -sign tools-priv.pem < $A > $A.sig ; done
exit

Then to install the OS:

If you try to install it will give an Eboot error so you need to go to the advanced install by pressing F8. Then while in there use -v -install and it should install.

Coxy
The parameters to the question specified that hacking/tricking a VM program into using Mac OS X is not an option.
Schnapple
not an option for you, maybe, but the next person to need an answer to this question might not be so fussy.
Coxy