Discussion:
[vbox-dev] Sketch of how to build on OSX 10.9?
Jon Seymour
2014-06-17 03:18:23 UTC
Permalink
It seems the source tree has support for OSX 10.7 (Lion) but not later
versions of OSX.

Could someone provide a sketch of what would be required to make my
OSX 10.9 system capable of building VirtualBox for OSX from source?

Would I be better off editing the source to allow it to build against
the 10.9 SDKs or, alternatively, trying to find copies of the earlier
SDKs and building against those?

Has anyone managed to build it on a system that only has homebrew as
distinct from MacPorts? I understand TeX is problematic with homebrew
systems. Can MacTex be substituted as required?

jon.
Klaus Espenlaub
2014-06-17 16:53:09 UTC
Permalink
Jon,
Post by Jon Seymour
It seems the source tree has support for OSX 10.7 (Lion) but not
later versions of OSX.
Depends how you mean this... the resulting build definitely works on
Mavericks.
Post by Jon Seymour
Could someone provide a sketch of what would be required to make my
OSX 10.9 system capable of building VirtualBox for OSX from source?
The sketch is in the build prereqs page for OSX. You *need* to use the
mentioned Xcode version, otherwise you end up with either build errors
or a crippled build. Not all parts of VirtualBox can be built with
llvm/clang (even though I heard that the very newest versions have
implemented the missing functionality, no idea if Apple picked them up
already), they need proper gcc.
Post by Jon Seymour
Would I be better off editing the source to allow it to build against
the 10.9 SDKs or, alternatively, trying to find copies of the earlier
SDKs and building against those?
To my knowledge you need an older SDK, too. Don't know if they're as
annoying as Xcode (its installer simply refuses to run on newer OSX
versions, leaving only the tedious manual extraction of the contained
files which needs using "xar" at least twice - the result runs just fine
on Mavericks).
Post by Jon Seymour
Has anyone managed to build it on a system that only has homebrew as
distinct from MacPorts? I understand TeX is problematic with
homebrew systems. Can MacTex be substituted as required?
Building the docs is something we don't usually do on Macs (even though
it should be possible), there's no point in building them many times.
One box builds them and the others fetch it...

Klaus
Post by Jon Seymour
jon.
Vadim Galitsyn
2014-06-18 14:05:54 UTC
Permalink
Hi Jon,
Post by Jon Seymour
Would I be better off editing the source to allow it to build against
the 10.9 SDKs or, alternatively, trying to find copies of the earlier
SDKs and building against those?
Please do not use 10.9 SDK, but use 10.6 one instead which comes with Xcode 3.2.0.
I understand that it is currently not possible to install Xcode 3.2.0 on Mavericks host,
but if you have it previously installed into some other location, you may ?svn up? your local copy of OSE
repository and configure it in the following way (--with-xcode-dir option was introduced just today):

./configure --disable-hardening --with-xcode-dir=<path to Xcode 3.2.0> --with-qt-dir=/opt/local/Library

Hope this helps,
Vadim
Jon Seymour
2014-06-18 17:59:29 UTC
Permalink
Vadim + Klaus,

Thanks for the advice.

jon.

On Thu, Jun 19, 2014 at 12:05 AM, Vadim Galitsyn
Post by Vadim Galitsyn
Hi Jon,
Post by Jon Seymour
Would I be better off editing the source to allow it to build against
the 10.9 SDKs or, alternatively, trying to find copies of the earlier
SDKs and building against those?
Please do not use 10.9 SDK, but use 10.6 one instead which comes with Xcode 3.2.0.
I understand that it is currently not possible to install Xcode 3.2.0 on Mavericks host,
but if you have it previously installed into some other location, you may ?svn up? your local copy of OSE
./configure --disable-hardening --with-xcode-dir=<path to Xcode 3.2.0> --with-qt-dir=/opt/local/Library
Hope this helps,
Vadim
Vadim Galitsyn
2014-06-18 18:04:47 UTC
Permalink
Jon,

Please let us know if it helped. Btw, note that path to Xcode should not contain space characters (it will confuse the build system).

Vadim
Post by Jon Seymour
Vadim + Klaus,
Thanks for the advice.
jon.
On Thu, Jun 19, 2014 at 12:05 AM, Vadim Galitsyn
Post by Vadim Galitsyn
Hi Jon,
Post by Jon Seymour
Would I be better off editing the source to allow it to build against
the 10.9 SDKs or, alternatively, trying to find copies of the earlier
SDKs and building against those?
Please do not use 10.9 SDK, but use 10.6 one instead which comes with Xcode 3.2.0.
I understand that it is currently not possible to install Xcode 3.2.0 on Mavericks host,
but if you have it previously installed into some other location, you may ?svn up? your local copy of OSE
./configure --disable-hardening --with-xcode-dir=<path to Xcode 3.2.0> --with-qt-dir=/opt/local/Library
Hope this helps,
Vadim
Jon Seymour
2014-06-19 02:59:51 UTC
Permalink
Vadim,

Will do. Just to let you know I am about to hit the road for 9 weeks
which means my access to large amounts of bandwidth may be somewhat
variable which may impede my progress on this task somewhat.

My plan at this stage is to try building it with XCode 4.1 which I
have fetched and am starting to unpack as I discover things I need
such as gcc-4.2 etc. Once I am done, I will write up what I needed to
do.

Regards,

jon


On Thu, Jun 19, 2014 at 4:04 AM, Vadim Galitsyn
Post by Vadim Galitsyn
Jon,
Please let us know if it helped. Btw, note that path to Xcode should not contain space characters (it will confuse the build system).
Vadim
Post by Jon Seymour
Vadim + Klaus,
Thanks for the advice.
jon.
On Thu, Jun 19, 2014 at 12:05 AM, Vadim Galitsyn
Post by Vadim Galitsyn
Hi Jon,
Post by Jon Seymour
Would I be better off editing the source to allow it to build against
the 10.9 SDKs or, alternatively, trying to find copies of the earlier
SDKs and building against those?
Please do not use 10.9 SDK, but use 10.6 one instead which comes with Xcode 3.2.0.
I understand that it is currently not possible to install Xcode 3.2.0 on Mavericks host,
but if you have it previously installed into some other location, you may ?svn up? your local copy of OSE
./configure --disable-hardening --with-xcode-dir=<path to Xcode 3.2.0> --with-qt-dir=/opt/local/Library
Hope this helps,
Vadim
Jon Seymour
2014-06-19 04:53:54 UTC
Permalink
Ok, I haven't had a chance to write up exactly what I needed to copy,
nor have I yet tested the result, but I have apparently managed to
build VirtualBox to completion on OSX 10.9 using the new
--with-xcode-dir option pointing to a partial copy of Xcode 4.1
extracted from the Xcode 4.1 package I downloaded from apple.

Some notes.

- I used xcode 4.1, with one exception
- I couldn't find ./Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin
in the 4.1 xcode package, so I used the version from xcode 5.1 since I
had that handy
- I used the Qt dependencies that had been ( I think ) installed by homebrew

jon.
Post by Jon Seymour
Vadim,
Will do. Just to let you know I am about to hit the road for 9 weeks
which means my access to large amounts of bandwidth may be somewhat
variable which may impede my progress on this task somewhat.
My plan at this stage is to try building it with XCode 4.1 which I
have fetched and am starting to unpack as I discover things I need
such as gcc-4.2 etc. Once I am done, I will write up what I needed to
do.
Regards,
jon
On Thu, Jun 19, 2014 at 4:04 AM, Vadim Galitsyn
Post by Vadim Galitsyn
Jon,
Please let us know if it helped. Btw, note that path to Xcode should not contain space characters (it will confuse the build system).
Vadim
Post by Jon Seymour
Vadim + Klaus,
Thanks for the advice.
jon.
On Thu, Jun 19, 2014 at 12:05 AM, Vadim Galitsyn
Post by Vadim Galitsyn
Hi Jon,
Post by Jon Seymour
Would I be better off editing the source to allow it to build against
the 10.9 SDKs or, alternatively, trying to find copies of the earlier
SDKs and building against those?
Please do not use 10.9 SDK, but use 10.6 one instead which comes with Xcode 3.2.0.
I understand that it is currently not possible to install Xcode 3.2.0 on Mavericks host,
but if you have it previously installed into some other location, you may ?svn up? your local copy of OSE
./configure --disable-hardening --with-xcode-dir=<path to Xcode 3.2.0> --with-qt-dir=/opt/local/Library
Hope this helps,
Vadim
Jon Seymour
2014-06-19 06:29:07 UTC
Permalink
Testing results.

I am able to load the kernel extensions and start the Virtual Box GUI.

I successfully started a virtual machine that wasn't configured to use
host-only networking, but can't start or reconfigure virtual machines
that use host-only networking. The vboxnet0 interface does not appear
in the ifconfig -a output. I am attempting to find a diagnostic that
tells me why or a previous report of a similar problem.

jon.
Post by Jon Seymour
Ok, I haven't had a chance to write up exactly what I needed to copy,
nor have I yet tested the result, but I have apparently managed to
build VirtualBox to completion on OSX 10.9 using the new
--with-xcode-dir option pointing to a partial copy of Xcode 4.1
extracted from the Xcode 4.1 package I downloaded from apple.
Some notes.
- I used xcode 4.1, with one exception
- I couldn't find ./Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin
in the 4.1 xcode package, so I used the version from xcode 5.1 since I
had that handy
- I used the Qt dependencies that had been ( I think ) installed by homebrew
jon.
Post by Jon Seymour
Vadim,
Will do. Just to let you know I am about to hit the road for 9 weeks
which means my access to large amounts of bandwidth may be somewhat
variable which may impede my progress on this task somewhat.
My plan at this stage is to try building it with XCode 4.1 which I
have fetched and am starting to unpack as I discover things I need
such as gcc-4.2 etc. Once I am done, I will write up what I needed to
do.
Regards,
jon
On Thu, Jun 19, 2014 at 4:04 AM, Vadim Galitsyn
Post by Vadim Galitsyn
Jon,
Please let us know if it helped. Btw, note that path to Xcode should not contain space characters (it will confuse the build system).
Vadim
Post by Jon Seymour
Vadim + Klaus,
Thanks for the advice.
jon.
On Thu, Jun 19, 2014 at 12:05 AM, Vadim Galitsyn
Post by Vadim Galitsyn
Hi Jon,
Post by Jon Seymour
Would I be better off editing the source to allow it to build against
the 10.9 SDKs or, alternatively, trying to find copies of the earlier
SDKs and building against those?
Please do not use 10.9 SDK, but use 10.6 one instead which comes with Xcode 3.2.0.
I understand that it is currently not possible to install Xcode 3.2.0 on Mavericks host,
but if you have it previously installed into some other location, you may ?svn up? your local copy of OSE
./configure --disable-hardening --with-xcode-dir=<path to Xcode 3.2.0> --with-qt-dir=/opt/local/Library
Hope this helps,
Vadim
Vadim Galitsyn
2014-06-19 08:40:34 UTC
Permalink
Hi Jon,
Post by Jon Seymour
I successfully started a virtual machine that wasn't configured to use
host-only networking, but can't start or reconfigure virtual machines
that use host-only networking.
This is a permissions issue. Please update owner and mode for out/darwin.{amd64, x86}/{release, debug}/dist/VirtualBox.app/Contents/MacOS/VBoxNetAdpCtl.

sudo chown root ./VBoxNetAdpCtl
sudo chmod u+s ./VBoxNetAdpCtl

Vadim
Post by Jon Seymour
Testing results.
I am able to load the kernel extensions and start the Virtual Box GUI.
I successfully started a virtual machine that wasn't configured to use
host-only networking, but can't start or reconfigure virtual machines
that use host-only networking. The vboxnet0 interface does not appear
in the ifconfig -a output. I am attempting to find a diagnostic that
tells me why or a previous report of a similar problem.
jon.
Post by Jon Seymour
Ok, I haven't had a chance to write up exactly what I needed to copy,
nor have I yet tested the result, but I have apparently managed to
build VirtualBox to completion on OSX 10.9 using the new
--with-xcode-dir option pointing to a partial copy of Xcode 4.1
extracted from the Xcode 4.1 package I downloaded from apple.
Some notes.
- I used xcode 4.1, with one exception
- I couldn't find ./Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin
in the 4.1 xcode package, so I used the version from xcode 5.1 since I
had that handy
- I used the Qt dependencies that had been ( I think ) installed by homebrew
jon.
Post by Jon Seymour
Vadim,
Will do. Just to let you know I am about to hit the road for 9 weeks
which means my access to large amounts of bandwidth may be somewhat
variable which may impede my progress on this task somewhat.
My plan at this stage is to try building it with XCode 4.1 which I
have fetched and am starting to unpack as I discover things I need
such as gcc-4.2 etc. Once I am done, I will write up what I needed to
do.
Regards,
jon
On Thu, Jun 19, 2014 at 4:04 AM, Vadim Galitsyn
Post by Vadim Galitsyn
Jon,
Please let us know if it helped. Btw, note that path to Xcode should not contain space characters (it will confuse the build system).
Vadim
Post by Jon Seymour
Vadim + Klaus,
Thanks for the advice.
jon.
On Thu, Jun 19, 2014 at 12:05 AM, Vadim Galitsyn
Post by Vadim Galitsyn
Hi Jon,
Post by Jon Seymour
Would I be better off editing the source to allow it to build against
the 10.9 SDKs or, alternatively, trying to find copies of the earlier
SDKs and building against those?
Please do not use 10.9 SDK, but use 10.6 one instead which comes with Xcode 3.2.0.
I understand that it is currently not possible to install Xcode 3.2.0 on Mavericks host,
but if you have it previously installed into some other location, you may ?svn up? your local copy of OSE
./configure --disable-hardening --with-xcode-dir=<path to Xcode 3.2.0> --with-qt-dir=/opt/local/Library
Hope this helps,
Vadim
Jon Seymour
2014-06-19 09:11:09 UTC
Permalink
On Thu, Jun 19, 2014 at 6:40 PM, Vadim Galitsyn
Post by Vadim Galitsyn
Hi Jon,
Post by Jon Seymour
I successfully started a virtual machine that wasn't configured to use
host-only networking, but can't start or reconfigure virtual machines
that use host-only networking.
This is a permissions issue. Please update owner and mode for out/darwin.{amd64, x86}/{release, debug}/dist/VirtualBox.app/Contents/MacOS/VBoxNetAdpCtl.
sudo chown root ./VBoxNetAdpCtl
sudo chmod u+s ./VBoxNetAdpCtl
Indeed, so it does. Thanks for your all your help. I'll write up
exactly what I did so that others can reproduce it as required.

Thanks!

jon.
Jon Seymour
2014-06-19 14:20:17 UTC
Permalink
I've created a gist with the script I used to extract the components
of Xcode 4.1 required to build VirtualBox on an OSX 10.9 system.

See https://gist.github.com/jonseymour/f05d97da2b29d4a03192

For the record, the packages required are:

DevSDK.pkg
DeveloperTools.pkg
MacOSX10.6.pkg
MacOSX10.7.pkg
XcodeTools.pkg
llvm-gcc4.2.pkg
gcc4.2.pkg

The script assumes that the script in the gist and
installxcode_41_lion.dmg (downloaded from Apple) are in the current
directory. A directory called xcode41-partial will be created
containing the subset of xcode41 required to successfully compile
VirtualBox.

jon.
Jon Seymour
2014-06-20 10:38:33 UTC
Permalink
I wrote up the steps for build Virtual Box on OSX 10.9. There is
nothing new here for experienced OSX or VirtualBox hackers, but it
might be helpful for others like myself who are novices. Let me know
if you want me to suggest edits to the official documentation.

http://blog.wildducktheories.com/building-virtual-box-on-osx-10-9/

Thanks again to Klaus and Vadim for pointing me in the right direction.

jon.
Post by Jon Seymour
I've created a gist with the script I used to extract the components
of Xcode 4.1 required to build VirtualBox on an OSX 10.9 system.
See https://gist.github.com/jonseymour/f05d97da2b29d4a03192
DevSDK.pkg
DeveloperTools.pkg
MacOSX10.6.pkg
MacOSX10.7.pkg
XcodeTools.pkg
llvm-gcc4.2.pkg
gcc4.2.pkg
The script assumes that the script in the gist and
installxcode_41_lion.dmg (downloaded from Apple) are in the current
directory. A directory called xcode41-partial will be created
containing the subset of xcode41 required to successfully compile
VirtualBox.
jon.
Continue reading on narkive:
Loading...