Page 1 of 1

How to build VirtualBox 5.0.2 on Mac OS X 10.10.4 (Yosemite)

Posted: 30. Sep 2015, 22:49
by MickDeveloper
How to build VirtualBox 5.0.2 on Mac OS X 10.10.4 (Yosemite):

---------

Basic VirtualBox build instructions are found here:

https://www.virtualbox.org/wiki/Mac%20O ... structions

Additional, and somewhat more helpful VirtualBox build instructions:

http://blog.wildducktheories.com/buildi ... -osx-10-9/

---------

-- Create VirtualBox build directory

cd $HOME
mkdir VirtualBox
cd VirtualBox

---------

-- Download Xcode 4.1 (requires Apple Developer username and password)
-- from https://developer.apple.com/downloads/?q=xcode

-- http://adcdownload.apple.com/Developer_ ... eopard.dmg

-- If you already have the xcode_4.1_for_snow_leopard.dmg file in your Downloads folder:

-- Create Xcode folder and copy 4.1 from Downloads directory:

mkdir Xcode_4.1
cp $HOME/Downloads/installxcode_41_lion.dmg Xcode_4.1
cd Xcode_4.1

---------

-- Use this script to extract parts of Xcode 4.1:

git clone https://gist.github.com/f05d97da2b29d4a03192.git
mv f05d97da2b29d4a03192/extract-xcode41.sh .
rm -rf f05d97da2b29d4a03192/
chmod 755 extract-xcode41.sh
sudo ./extract-xcode41.sh

---------

-- Install Mac Ports from:
-- https://www.macports.org

-- Open a new terminal window and use the port command to install the following pieces:

sudo port install libidl +universal doxygen texlive texlive-latex-extra texlive-fonts-extra cdrtools

---------

-- Install homebrew:

-- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homeb ... er/install)"

---------

-- Use homebrew to install openssl source tree:

brew install openssl --build-from-source

---------

-- Use homebrew to install the Qt Framework:

brew install qt

---------

-- Use svn to checkout VirtualBox 5.0.2 source code:

cd ..

svn co -r r57334 http://www.virtualbox.org/svn/vbox/trunk vbox

cd vbox

rm -rf .svn

---------

Fix error in cofigure script:

---------

In configure: replace line at line #2151 with:

check_xcode_sdk_path "$WITH_XCODE_DIR"

---------

Run configure:

./configure --disable-hardening --target-arch=amd64 --with-xcode-dir=$HOME/VirtualBox/Xcode_4.1/xcode41-partial --disable-docs

---------

Finally, build VirtualBox:

source env.sh
kmk

---------

This step is necessary to disable the kernel extension signing requirement:

To disable the kext signing security setting:

sudo nvram boot-args=kext-dev-mode=1

After changing this setting you need to restart the computer to have OS X recognize it.

It is important to note that the kext-signing setting is global, if you disable it you should be careful to
only install system drivers from sources that you trust.

To reenable again use:

sudo nvram -d boot-args

Restart your computer

---------

Load kernel extensions:

cd $HOME/VirtualBox/vbox/out/darwin.amd64/release/dist/
./loadall.sh

Re: How to build VirtualBox 5.0.2 on Mac OS X 10.10.4 (Yosem

Posted: 1. Oct 2015, 09:43
by michaln
So now users are supposed to follow three sources instead two? Is that really helping?

Re: How to build VirtualBox 5.0.2 on Mac OS X 10.10.4 (Yosem

Posted: 1. Oct 2015, 10:59
by socratis
@michaln
Well, if you manage to make a successful build, on a newly installed OSX system, with the official instructions given, I'd be more than happy to hear it. I haven't tried MickDeveloper's recipe. Will try again although both recipes, just to make sure I wasn't messing up something...

Re: How to build VirtualBox 5.0.2 on Mac OS X 10.10.4 (Yosem

Posted: 1. Oct 2015, 12:26
by michaln
The point is that if it works, the official wiki needs to be updated. Having multiple incomplete recipes hanging around the Internet ultimately isn't helping anyone.

Basically what would help is detailed suggestions what to change in the wiki page on virtualbox.org. Anything else makes the problem worse. Sure, it's normal that folks figure it out for themselves and leave it at that, because helping others is too much work. So actually posting anything is a good start.

What's needed is a couple of volunteers who need to try it out. Oracle developers use a different process and do not have "clean" machines to try it out and verify the instructions.

Re: How to build VirtualBox 5.0.2 on Mac OS X 10.10.4 (Yosem

Posted: 1. Oct 2015, 15:05
by socratis
As I said, I'm going to try it again. I have "clean" VMs ranging from 10.5 to 10.11. I will try to see what's going on with each and every version. But, some hints (like XCode 4.1 is required) is going to help a lot from pulling another set of hair...

So, could you potentially provide a recipe of what tools and/or configurations are the developers using? For example, if you only use 10.7.x systems to do the build, that would be an excellent hint to have in mind...

Re: How to build VirtualBox 5.0.2 on Mac OS X 10.10.4 (Yosem

Posted: 1. Oct 2015, 18:35
by MickDeveloper
There are a number of things that aren't covered well in the links I included at the top of the post.

- Installing XCode 4.1 is necessary - not sure if more recent versions of XCode work, but this works for me.

- There are a list of prerequisites that need to be installed, some use MacPorts, and others use Homebrew.

- These instructions work with Yosemite - the other recipes I looked at didn't - there is a spot in the configure script that had to be changed for it to work.

- Yosemite requires kernel extensions be signed - I include a way (for development) to not have to sign the extensions:

$ sudo nvram boot-args=kext-dev-mode=1

(Then reboot your machine).

I've been using this "recipe" for the last few weeks, and it's worked every time.

I'm interested in whether anyone else has tried it, and if so, what are the results.

Thanks,

-Mick