- Setting up Mac OS X Yosemite on VirtualBox
- Download:
- Setting it up
- Pointer Lag and Resolution
- Pointer Lag
- Resolution
- Mac OS X build instructions
- Prerequisites on Mac OS X
- Building VirtualBox
- Running VirtualBox
- Building OSE packages for distribution
- Relative vs. absolute paths in the used libraries
- Mac OS X build instructions
- Prerequisites on Mac OS X
- Building VirtualBox
- Running VirtualBox
- Building OSE packages for distribution
- Relative vs. absolute paths in the used libraries
Setting up Mac OS X Yosemite on VirtualBox
Feb 3, 2016 · 5 min read
I have recently been asked to work on an iOS project with some friends. However, one of the friends in question do not own a mac, and some method for development on Windows was necessary. He was having some issues finding reliable information online, and to be honest, I had some of the same issues. A large amount of information was outdated or simply plain incorrect.
I figured out how to get it working properly, through a combination of searching and looking up tutorials and I will list the concise method that worked for me right here.
Download:
Fir s t of all, you need to download the ISO of Yosemite and VirtualBox.
The Yosemite ISO is here, as well as a mirror:
Next, download VirtualBox from Oracle’s website.
Setting it up
Now, install VirtualBox and open up the application. You will see a screen as such.
Next, click the “New” button in the top left, and configure a new virtual machine as a 64-bit Mac OS.
Pick Create VDI and dynamic scaling. For RAM and HD space, I picked 2G and 40G respectively, but it really doesn’t matter too much. Then finish creating the VM.
Now, go into the settings for your new machine and select options as follows:
- In “System”, turn off the checkbox for “enable EFI”
- In “Display”, turn up the slider for video memory to max
- In “Storage”, select and mount your ISO file onto the disc
- In “USB”, make sure USB is enabled
The next step is to trick VirtualBox so it thinks we have a valid CPU for the Mac OS. Close VirtualBox before proceeding.
First of all, we want to find the correct location of VirtualBox on our computer. By default it is under C:\\Program Files\Oracle\VirtualBox\
Open up the command prompt by going to Windows->Run->cmd
Then inside the command prompt, type: “cd ”. This will allow you to access the VirtualBox configuration files.
Now input the command (replacing with the name you selected earlier):
Now, start up VirtualBox and start up the VM you created. Once you reach the set-up screen, enter option -v and wait for it to finish.
Once it is ready, set up the VM with whatever settings you desire.
After you set it up, on the disc select page, go to disc utility.
Then select your 40GB partition, select the erase option, create any name you’d like, make sure the format is Mac OS Journaled and proceed with erasing the partition.
Once this step is done, you should be able to close the Disc Utility and begin the Mac OS installation onto your new partition. This will take
2 minutes. The installation will freeze. You can look at the little hard drive on the bottom of VirtualBox to see if the installation has frozen (if it’s not flashing the download is done).
At this point, go to the options and reset the Virtual Machine.
Now, on this boot up, you should have some additional selections. Start your hard drive with options “-s -v -n”.
Now wait for the installation to continue. They suggest some things we want to do, but there are additional steps we need to do.
Enter these commands:
Then, start typing “Hackintosh.Zone.Post-Script” and press tab to auto-complete. Press enter and then type:
to start up the post installation configuration.
After this finishes executing, enter “exit”.
Start up your VM again, boot up with “-x -v” if necessary and now you should see:
Follow the setup steps and voila, your hackintosh is complete.
Pointer Lag and Resolution
Finally, we have two issues. The first is that there is a lag on the mouse pointer and the second is that the resolution might not match that of your monitor.
Pointer Lag
Simply download the BeamOff application run it. Your performance should improve drastically.
A mirror is here:
Resolution
We can fix the resolution by opening the Finder, then going to Computer -> Extras.
Edit the file called org.chameleon.Boot.plist and find the resolution string and replace it with your screens resolution, whether it is 1920×1080 or 1600×900 like my laptop.
Then simply shut down and restart your VM. And when it starts up, press ctrl-F to see it in full screen glory!
Here is a final screenshot of my VirtualBox Mac running at my screens resolution.
Источник
Mac OS X build instructions
Prerequisites on Mac OS X
- 10.10.x (Yosemite) or later running on Intel hardware (PowerPC hardware is not supported nor is building an X11 variant).
- Xcode matching your Mac OS X version ( http://developer.apple.com/tools/download/). Until recently the official builds were done using Xcode 6.2 (you may use the tools/darwin.amd64/bin/xcode-6.2-extractor.sh script to ‘install’ the necessary bits on later OS X versions).
- Some things from MacPorts ( http://www.macports.org/).
After installing MacPorts, do not forget to make sure the following two lines are in your/.zprofile file and actually loaded in the shell you’re using:
Then perform the following command:
Doxygen, texlive* and x86_64-elf-gcc are optional (first two for documentation, latter for the validation kit).
- Qt/Mac 5.6 or later ( http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x)
- Loading self-built kernel extensions (kexts) on more recent OS X may require changes to the system config unless you have a kext signing certificate and is running 10.14 (High Sierra) or earlier. For 10.11 (El Capitan) and later boot to the recovery partition and either enabling loading of unsigned kexts: or disable SIP all together: For 10.15 (Catalina) and later you also need to disable the reboot requirement (also from recovery partition): If you are running 10.10 (Yosemite) there is a boot-args option for allowing the loading of unsigned kexts. Run the following and reboot:
Building VirtualBox
- Change to the root directory of the sources and execute the configure script: You can manually set the target architecture with --target-arch=x86 or amd64, if some architecture related problems occur.
If it finds everything it needs, it will create a file called !AutoConfig.kmk containing paths to the various tools on your system. Also, it will create an environment setup script called env.sh. This step only has to be done once (if something changes in your build tool setup, you might have to repeat it but keep in mind that both output files will be overwritten).
- Whenever you want to build VirtualBox, you have to open a shell and source the generated environment setup script env.sh, i.e. do
- To build type The default is to a release build, should you wish to do a debug or profile build add BUILD_TYPE=debug or BUILD_TYPE=profile as argument to kmk or export it as an environment variable in your shell.
Running VirtualBox
- Load all the kernel extension modules. These can be found in out/darwin.x86/release/dist along with a small script (loadall.sh) to load them. Execute and make sure the modules loads successfully.
- Enter out/darwin.x86/release/dist/VirtualBox.app/Contents/MacOS/.
- Run ./VirtualBox
Building OSE packages for distribution
Never disable hardening (see previous section) when creating packages for redistribution.
Hardening needs some additional configuration and post-build steps. The default install directory of VirtualBox is /Applications/VirtualBox.app/. If you like to change that, say into /Applications/OpenSource/VirtualBox.app/, you need to add the following to the LocalConfig.kmk:
It may also make sense to disable some of the development only stuff, like test cases. Add the following to LocalConfig.kmk:
Starting with VirtualBox 4.1, extra debug symbols are created. You can prevent that by adding the following to LocalConfig.kmk:
Next rebuild VirtualBox and install it into /Applications/OpenSource/. There isn’t any support for installing VirtualBox into a target directory. Just copy the files to the destination. Now make sure that the setuid stubs have the correct permissions:
Another requirement of hardening is that every path component of the parent directory of VirtualBox.app/ is owned by root and not world writable. Make sure this is the case.
Relative vs. absolute paths in the used libraries
If you see something like the following error when starting VirtualBox you need to change the used libraries to use absolute paths.
On Mac OS X it isn’t allowed to use libraries with relative paths for referencing to other libraries when the executable is setuid. You can display all linked libraries by the following command:
Источник
Mac OS X build instructions
Prerequisites on Mac OS X
- 10.10.x (Yosemite) or later running on Intel hardware (PowerPC hardware is not supported nor is building an X11 variant).
- Xcode matching your Mac OS X version ( http://developer.apple.com/tools/download/). Until recently the official builds were done using Xcode 6.2 (you may use the tools/darwin.amd64/bin/xcode-6.2-extractor.sh script to ‘install’ the necessary bits on later OS X versions).
- Some things from MacPorts ( http://www.macports.org/).
After installing MacPorts, do not forget to make sure the following two lines are in your/.zprofile file and actually loaded in the shell you’re using:
Then perform the following command:
Doxygen, texlive* and x86_64-elf-gcc are optional (first two for documentation, latter for the validation kit).
- Qt/Mac 5.6 or later ( http://qt.nokia.com/downloads/qt-for-open-source-cpp-development-on-mac-os-x)
- Loading self-built kernel extensions (kexts) on more recent OS X may require changes to the system config unless you have a kext signing certificate and is running 10.14 (High Sierra) or earlier. For 10.11 (El Capitan) and later boot to the recovery partition and either enabling loading of unsigned kexts: or disable SIP all together: For 10.15 (Catalina) and later you also need to disable the reboot requirement (also from recovery partition): If you are running 10.10 (Yosemite) there is a boot-args option for allowing the loading of unsigned kexts. Run the following and reboot:
Building VirtualBox
- Change to the root directory of the sources and execute the configure script: You can manually set the target architecture with --target-arch=x86 or amd64, if some architecture related problems occur.
If it finds everything it needs, it will create a file called !AutoConfig.kmk containing paths to the various tools on your system. Also, it will create an environment setup script called env.sh. This step only has to be done once (if something changes in your build tool setup, you might have to repeat it but keep in mind that both output files will be overwritten).
- Whenever you want to build VirtualBox, you have to open a shell and source the generated environment setup script env.sh, i.e. do
- To build type The default is to a release build, should you wish to do a debug or profile build add BUILD_TYPE=debug or BUILD_TYPE=profile as argument to kmk or export it as an environment variable in your shell.
Running VirtualBox
- Load all the kernel extension modules. These can be found in out/darwin.x86/release/dist along with a small script (loadall.sh) to load them. Execute and make sure the modules loads successfully.
- Enter out/darwin.x86/release/dist/VirtualBox.app/Contents/MacOS/.
- Run ./VirtualBox
Building OSE packages for distribution
Never disable hardening (see previous section) when creating packages for redistribution.
Hardening needs some additional configuration and post-build steps. The default install directory of VirtualBox is /Applications/VirtualBox.app/. If you like to change that, say into /Applications/OpenSource/VirtualBox.app/, you need to add the following to the LocalConfig.kmk:
It may also make sense to disable some of the development only stuff, like test cases. Add the following to LocalConfig.kmk:
Starting with VirtualBox 4.1, extra debug symbols are created. You can prevent that by adding the following to LocalConfig.kmk:
Next rebuild VirtualBox and install it into /Applications/OpenSource/. There isn’t any support for installing VirtualBox into a target directory. Just copy the files to the destination. Now make sure that the setuid stubs have the correct permissions:
Another requirement of hardening is that every path component of the parent directory of VirtualBox.app/ is owned by root and not world writable. Make sure this is the case.
Relative vs. absolute paths in the used libraries
If you see something like the following error when starting VirtualBox you need to change the used libraries to use absolute paths.
On Mac OS X it isn’t allowed to use libraries with relative paths for referencing to other libraries when the executable is setuid. You can display all linked libraries by the following command:
Источник