[Off-topic] E:V:A:
2. Installing the Niresh OS X Mavericks distro

Fortunately all this hard work has already been described in great

detail on the MacBreaker website in:

"How to install OS X Mavericks in Virtualbox with Niresh"

However, before you go there and rush through the instructions, please

listen to this first. If you're a smart-ass who think you can outsmart

the apple bootloaders and the many precise VirtualBox settings needed

to boot OSX, you are very likely to fail and will have serious booting

trouble and subsequent OSX driver issues. And as with all Apple products,

if you're not an expert yourself, nobody will/can help you, especially

since Googling any OSX related installation issues will give you millions

of hits.

So take good time to read every step in those instructions and carefully

examine all the screenshots to know exactly how you have to setup and

tune your VirtualBox VM to your device. I will provide some additional

pictures on a few things I found working for my setup.

You need to signup (or find a torrent) to download the file:

"Niresh Mac OS X Mavericks 10.9 with AMD & Intel USB"

This OSX distribution works on both Intel and AMD based machines, and

can be run on native Hackingtoshes, VirtualBox and VMware machines.

Very Important Note:

OSX Mavericks is now free from the Apple Store, so if you are looking for the latest update, or original distribution, don't try to use this. This is a distribution that is made to be run on Hackingtoshes or VMs. It is not up-to-date nor maintained in any way. That's why it is in ISO format and not in native Apple DMG. If you already know you want to use VMware, then perhaps you're better off trying to use the VMware Mavericks Image.

Google for: "OS_X_Mavericks_10.9_Retail_VMware_Image"
​

Converting a DMG to ISO:

If you want to convert a DMG to ISO from within OSX run the following,

in an OSX Terminal:

[SIZE=2]cd Desktop
sudo hdiutil convert ./InstallESD.dmg -format UDTO -o InstallESD
mv InstallESD.cdr InstallESD.iso[/SIZE]

or:

[SIZE=2]sudo hdiutil makehybrid -iso -joliet -hfs -o OSXMavericks.iso OSXMavericks.dmg[/SIZE]

I found the following "script" on the web. It is used to convert a Yosemite

DMG image to ISO. But it doesn't look like a real script, so probably it should

be entered one item at the time. (Also, I can't find the original author. So if you are, just let me know an I'll give you credit for it.)

[SIZE=2]# ==============================================================
# 10.10 How to make an ISO from the Install.app
# ==============================================================
# Mount the installer image. It assumes that the installation app is called "Install OS X Yosemite.app"
# located in your "Applications" folder. If not, change the first command accordingly.
hdiutil attach /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app

# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Yosemite

# Increase the sparse bundle capacity to 8GB to accommodate the packages
hdiutil resize -size 8g /tmp/Yosemite.sparseimage

# Mount the sparse bundle for package addition
hdiutil attach /tmp/Yosemite.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build

# Remove Package link and replace with actual files
rm /Volumes/install_build/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/install_build/System/Installation/
cp -rp /Volumes/install_app/BaseSystem.* /Volumes/install_build/

# Unmount the installer image
hdiutil detach /Volumes/install_app

# Unmount the sparse bundle
hdiutil detach /Volumes/install_build

# Resize the partition in the sparse bundle to remove any free space
hdiutil resize -size `hdiutil resize -limits /tmp/Yosemite.sparseimage | tail -n 1 | awk '{ print $1 }'`b /tmp/Yosemite.sparseimage

# Convert the sparse bundle to ISO/CD master
hdiutil convert /tmp/Yosemite.sparseimage -format UDTO -o /tmp/Yosemite

# Remove the sparse bundle
rm /tmp/Yosemite.sparseimage

# Rename the ISO and move it to the desktop
mv /tmp/Yosemite.cdr ~/Desktop/Yosemite.iso
[/SIZE]

VirtualBox Installation Instructions

:

Follow the MacBreaker installation instructions EXACTLY. When

installing on a Haswell based PC host, you MUST run the VBoxManage

commands to make your VM think it has an older/supported processor.

Before trying this, or if you get an error, make sure:

That your Windows system PATH contains both your Windows home directory and the VirtualBox

program directory:

a) "%HOMEDRIVE%%HOMEPATH%;" and

b) "C:\Program Files\Oracle\Virtualbox"

.

That after creating your OSX VM, that you close VirtualBox and restart it, in order to make all

the new settings take effect and get registered in the *.vbox file, used by VBoxManage.exe.

The location of the *.vobx settings file is the same as where you have the VB images.

(This used to be VirtualBox.xml in VB < 4.0.)

To test, open a CMD or Cygwin shell as administrator and run:

VBoxManage.exe list hostcpuids
...

If it works without any error, go on and change the CPU ID of the VM where you're installing OSX with:

[SIZE=2]VBoxManage.exe modifyvm "name_of_your_vm" --cpuidset 00000001 000306a9 00020800 80000201 178bfbff[/SIZE]

(Technically you're entering: [--cpuidset <leaf> <eax> <ebx> <ecx> <edx>].)

If you're having trouble, you can also edit <name_of_your_vm>.vbox file

directly, by adding/removing the following lines:

[SIZE=2] <CpuIdTree>
<CpuIdLeaf id="1" eax="1787" ebx="2048" ecx="2147484169" edx="126614527"/>
</CpuIdTree>
[/SIZE]

(As you can see these are the same values in Dec as those in Hex above.)

When successful, restart VirtualBox to make sure your changes has

taken effect. After starting the properly setup OSX VM on a Haswell

machine, the only bootflag you may want is: "-v" for verbose bootup.

3. Install the Official Apple OS X Mavericks (10.9.4) Update Combo

Go into the OSX control panel and disable automatic updates. Then go to Apple Store and

download the latest Mavericks Combo Update. Updating should not change any of your

working settings, but to be safe, make a snapshot before doing this. Once downloaded,

just open and run the update. Installation will take a while.

4. Post installation instructions

So now that you got your basic OSX system running, the first thing to

do is to make a VirtualBox Snapshot, so that you can revert to this

point in case any of the subsequent procedures fails or mess up your

working system.

Once you are up and running with your virtual OS X machine you need to

do a couple of housekeeping tasks to ensure your virtual machine does

not freeze. Firstly go to "System Preferences" and select "Energy Saver"

and set "Computer sleep:" and "Display sleep:" to Never and also uncheck

"Put hard disks to sleep when possible", "Wake for Ethernet network

access" and "Allow power button to put the computer to sleep". In

"Desktop & Screen Saver" set "Screen Saver" to "Start after:" Never.

Then there are 3 things everyone have to have:

Shared folders between the host and guest OS.

Shared clip-board data, so that you can copy/paste between host and guest OS.

Change the default Display size

Since the VirtualBox maffia refuse to release the Guest Additions (GA)

for OSX, we have to work around these issues. Or if you are a brave OSX

developer, you can try to patch and compile the GA from their sources

and if you're successful, don't forget to share and give us a way to

send you some gold donations.

Folder Sharing

Folder sharing is most easily accomplished by setting up a network

share between host and guest OS. There are many ways and variations

on how to do this. But what most instructions miss, is that you would

probably like to keep your host more secure than your guest. This

means that the guest should be configured as the server and the

host as a client. (Which is contrary to most simpler instructions.)

So here are 3 easy ways to accomplish this.

1. Use Windows 8.1 and OSX internal file sharing capabilities.

2. Use Dropbox to share a folder and enable LANsync to make it fast.

3. Use one of the 3rd party tools below.

Of these, I prefer to use something where I don't need to depend on

an internet connection and having to sign up with any new services.

The easiest way I found to accomplish folder sharing using method (1)

was to use Windows 8.1 built in NFS functionality. To use this, you

need to enable NFS sharing of a folder in your OSX VM and then mount

this folder in your W81 host.

Setup OSX NFS (guest)

:

(Thanks to linoceros post at FreeBSD.org forums.)

(a) Check your network conection with 'ifconfig" and note your IP

on the local network. (I use a bridged-ethernet interface.)

(b) Read the OSX man pages for "export".

(c) Find the UID and GID of the OSX user you are using.

[SIZE=2]$ id
uid=501(eva) gid=20(staff) groups=20(staff),
...
[/SIZE]

(d) Edit the file: /etc/exports (usually not present.)

In this file, the syntax is basically:

<shared folder> <options> <client IP>

$ sudo vi /etc/exports

[SIZE=2]/Users/eva/Desktop/winshare -mapall=501:20 -alldirs 127.0.0.1[/SIZE]

(You may need to change this for more security...)

(e) Edit the file: /etc/nfs.conf (usually already present.) And add the following line:

$ sudo vi /etc/nfs.conf

[SIZE=2]...
nfs.server.mount.require_resv_port = 0[/SIZE]

(f) Then let NFS know you've made a change by running:

$ nfsd update

Setup on Win8.1 (host)

:

(g) Now go to your Windows host and in "This PC" (or equivalent)

left-click and select "Add a network location". You will be asked to

provide a an "internet or network location". There you simply write

the IP you noted in step (a) and the "shared" folder you selected

in step (d). Written in windows notation as:

\\192.168.1.102\Users\eva\Desktop\winshare\

NOTE: Do not try to "edit" the files in the share. The behavior is a

bit unpredictable, so it's better to copy to another location and

then back again after edit. Not sure at the moment why that is...

Clip-board sharing

To keep things simple we should limit ourselves and be satified

with copy/paste operations. Just like before, here there are many

variations on KMS (Keyboard-Mouse-Screen) sharing solutions from

3rd parties. Even Apple themselves has a lame solution called

"Back To My Mac" that require you to sign up to, and use iCloud

before being able to have all your stuff snatched up by Apples

NSA employees. Here are the links.

[1] "How to set up Back To My Mac..."

[2] "Set up and use Back to My Mac"

[3] "Set up security options for Back to My Mac"

BUT No thanks! Let's find another solution.

So what we need, is a way to only share the clipboard data over

the local network. We don't need mouse sharing as all that already

works great in VB, unfortunately its not so easy to find something

with only clipboard sharing. So we choose the most easy one, which

means the one with best instructions, and that is ShareMouse.

The most popular and free ones are:

[SIZE=2][URL="http://www.keyboard-and-mouse-sharing.com/index.html"]ShareMouse[/URL] (cross-platform mouse-keyboard-file share)
[URL="http://synergy-project.org/"]Synergy[/URL] (cross-platform mouse-keyboard-file share)
[URL="https://github.com/coralw/share-clipboard"]ShareClipboard[/URL] ([URL="http://nodejs.org/"]Node.js[/URL] based OSX/WIN clipboard sharing)
[/SIZE]

Other solutions to consider.

Ducto R6 (cross device file/clipboard share) http://www.msec.it/dukto/
IP.SHARE (web based file/clipboard share) http://www.ipshare.net/
ClipboardSync (Google Chrome Clipboard Sync) [instructions] https://github.com/mihaip/clipboard-sync

Installation of ShareClipboard

:

ShareClipboard depend on the Node.js API which can be downlaoded and

installed from HERE. It's available for all platforms and need to be

installed on each VM. One done, it is easy to starts the clip-board

sharing. There are two ways to use this:

1. Use as client-to-client sharing.

2. Use a server to act as a redirector, broadcasting the clipboard

text from a ShareClipboard client to the other ones, while the

server clipboard is left untouched.

To use ShareClipboard with Clients only (1):

[SIZE=2]a) Install the copy-paste module with the Node Package Manager*:
npm install copy-paste

b) Open a terminal and run the script with one of the following:
node share-clipboard.js
node share-clipboard.js <IP_ADDRESS>

c) If you haven't specified the IP address in the previous step,
connect other Share Clipboard (or Share Clip) instances to
this instance .
d) Now you can copy among the Share Clipboard clients.
[/SIZE]

To use your host as the ShareClipboard Server (1):

a) Open a terminal and run the script with:
node share-clipboard-server.js

b) Connect the ShareClipboard clients to the server IP.
c) Now you can copy among the Share Clipboard clients.

* Reagrdless of the BS written on their FAQ, "npm" IS a Node package manager.

Changing Display size

To change the default video/display size, from 1280x1024 (or 1024x768)

to 1920x1080, you need to edit the OSX bootloader plist.

1. Use Finder to open the file: /Extra/org.chameleon.Boot.plist

in Editor or use Terminal App in shell with:

sudo vi /Extra/org.chameleon.Boot.plist

2. Then between the <dict> and </dict> tags, in the file, insert the

following lines:

[SIZE=2] <key>Graphics Mode</key>
<string>1920x1080x32</string>
[/SIZE]

3. Save and shutdown VM, but keep VirtualBox open.

4. Similarly as above, open an administrative CMD/Cygwin shell and issue the command:

[SIZE=2]vboxmanage setextradata "name_of_your_vm" "CustomVideoMode1" "1920x1080x32"[/SIZE]

5. Restart VirtualBox.

PS. I found 1600x900x32 in non-scaled mode, more useful on this Laptop.

Additional Enhancements and Fixes

To remove window flickering in Safari, remove the zero byte file:

/Library/Preferences/com.apple.windowserver.plist

Good Luck!