How To: Run OSX in Virtual Box

Whats the deal with OSX? Seems like all the rage but really it’s just another OS. Mac users will swear they are impervious to viruses, malware etc.. But we need only look as far as the exploit db to see that this is certainly not the case at all. Search for osx as the platform and see what you get. Check it out here and dispel the myth.

Now I will certainly agree that the rate of instances with malicious software / virus activity with osx is not nearly as rampid as with a Windows platform. That being said my two cents on this all comes down to your habits with your machine. Bad habits (like downloading lots of stuff that you shouldn’t, or visiting sites that may be questionable) equals a high risk of something bad happening to your system, it’s just that simple.

Moving on, lets take a look at how to install OSX (for your testing and personal use of course) inside a virtual machine with Virtual Box. This tutorial is designed as a starting point and by no means should be viewed as a perfect solution to getting osx up and running in a production environment.

—>You Have Been Warned<—

To start we are going to need a few things. I am running an AMD setup with a Phenom 2 X4 955 Black Edition cpu and a measly 4 gigs of ram. The more cpu and memory power you have to spare the less painful the experience will be once your virtual machine is up and running. Consider this a primer for Virtual Box as well.

So here is the list of the things we will need.

1. A working install of Virtual box. Download it here.
2. A copy of an OSX DVD. I am using the 10.6.1-10.6.2 release from HAZARD. Google it as a torrent or whatnot, check the usual placesĀ  :)
3. CPUz. This may or may not be necessary but can come in handy. Find it here.
4. Patience. This can be tedious. Remember that Apple is not really wanting you to run osx on anything other than a mac.
5. Coffee. Lots of it.

OK. Now that we have the softs we need we can get started.

Watch the video, then refer back to the tut here for more detail as needed.

Part 1 – Set up the Virtual Machine

01. Start Vbox and create a new machine
02. The defaults here should be fine
03. Select how much memory you want to give the machine, up this to whatever you can spare (I will keep the default here)
04. Create a new disk, dynamic is ok, fixed may give you a bit better performance
05. How big do you want the HDD to be? (The default 20GB is fine here)
06. Select settings
07. System options.
08. Memory, (we just set this, adjust if you want more or less)
09. ICH9 for the chipset
10. Select all extended features but turn off the EFI :)
11. On the processor tab.. you can experiment with this as you see fit. I am going to use 2 processors as I have a quad core and set the execution cap to 80% (This is not something you need to do however I maintain a bit better system wide stability limiting the execution cap.. you decide)
12. Enable PAE/NX and on the acceleration tab the defaults should be ticked.
13. Display..
14. Select how much memory to use for the graphics, I will up this to 128 and enable 3d acceleration
15. Remote display = set this up if you want.
16. Storage-
17. On the IDE controller, select the OSX ISO you are going to be using.
18. The sata controller options are fine as they are (AHCI)
19. Audio
20. The windows direct sound Intel HD audio should work fine
21. Network
22. NAT is default, this passes your physical connection to your v machine (If you want a physical address on your network then select a bridged connection)
23. The remaining defaults for serial ports, usb and shared folders are fine as is. You can set up shared folders if you like.

Part 2 – Boot the OSX DVD and get to the installer

01. Start your machine with the green start arrow
02. Click through vbox’s info dialogs and press f8 to get a boot prompt.
03. We are going to let it run with no special parameters other than a “-v” for verbosity. type -v and press enter. (This will allow us to see any errors that may occur as we will likely encounter some. Maybe or maybe not.)
04. Looks like a kernel panic Ooops.. “the real time clock was not properly initialized”
05. This can happen with non supported cpu’s. Remember, I am using an amd setup, MAC plays really well with intel but not so well with amd. We can work around this.
06. Read the error messages, in your case it could vary. This guide will proceed with the error I have encountered. If you see something different Google it, there is likely a workaround on insanely mac, osx86 wiki, Infinite Mac etc..
07. Back to the problem..”the real time clock was not properly initialized”
08. This can be fixed passing a busratio=x at boot time where x is your cpu multiplier thus telling the kernel what your real time clock is.
09. If you don’t know what that is then this is where cpuz can come in handy.
10. Power off your virtual machine.
11. run cpuz, look for your cpu multiplier. In my case it’s 15.
12. Close cpuz and restart your virtual machine
13. f8 at boot and type busratio=15 (or busratio=xx for what yours is) and the -v to watch for errors again.
14. If all goes well you will be at the installer in a jiffy.

Part 3 – Prepare the drive and install the OS

01. Select the disk utility from the utilities menu
02. Select your virtual disk on the left and go to erase
03. Call your volume whatever you want.
04. Erase. This will repartition your virtual disk with one main partition for osx with whatever name you specified.
05. Select the drive and click continue.
06. **Important. Select the customize button on the left.
07. Select the 10.6.1 and 2 updates
08. Kernels – I am using an amd cpu so I will need the Legacy kernel
09. I will also need the AMD support patches
10. If you are using an Intel setup then you may need to select the Chameleon boot-loader from the drop-down menu.
11. Click ok and then install when back to the main window.
12. Congrats, OSX is installing. Go get a cup of coffee.
13. When the install finishes you will need to eject the DVD from the virtual drive and restart.
14. You should be looking at the boot-loader.
15. Any key will stop the boot sequence for additional options..
16. Down arrow to see options, they should be self explanatory, if not Google is your friend.
17. Enter to boot into your shiny new snow system.
18. Success!!
19. ***A warning*** – Your system will eventually show you a popup with “updates are available”. If you select the 10.6.8 combined update (which is mighty tempting) you will break your system. There is a workaround for this that we can try in another tutorial, stay tuned for this next week.
20. Play around with your new virtualized OSX and have fun!!

Thanks for reading / viewing as always. Any +1′s thumbs up, diggs, tweet’s etc are always appreciated!

-Joe

8 comments on “How To: Run OSX in Virtual Box

  1. Pingback: Cannot Install Guest Additions For VirtualBox 4.1.2? Having d3d9.dll Error? What’s The Deal With Virtualizing Windows 7 Inside VirtualBox On Linux? | EssayBoard

  2. Pingback: Watching Netflix On Linux? | EssayBoard

  3. Pingback: VirtualBox’s Seamless Mode Saves Users From Switching In And Out Between The Virtual And The Real Machine Computing Environments | EssayBoard

  4. Joe – you are awesome. FINALLY a person who has the answer to “the real time clock” problem. I was dual booting but it worked, thank you so much! I was planning on doing my own dual boot tutorial and if I do I will mention this post in reference to that error. If there is a way I could ever repay you, then just say!

  5. I am gonna echo to what “simongo7″ said, You are AWESOME! You have proper explanbation to “real time clock” problem. Spent hours on this and happy to see your post.

    Keep up the good work :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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