Build Virtualbox from source

Discussions related to using the OSE version of VirtualBox.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Build Virtualbox from source

Post by noteirak »

Code: Select all

noteirak@debian:~# sudo apt-get install gsoap
Reading package lists... Done
Building dependency tree
Reading state information... Done
gsoap is already the newest version.
I guess some config is missing?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Build Virtualbox from source

Post by Perryg »

Never had this issue with Debian but here is what you would need to do if it can't find the path. Add this to the LocalConfig.kmk

Code: Select all

VBOX_GSOAP_INSTALLED := 1
VBOX_PATH_GSOAP := <absolute path>/gsoap
VBOX_PATH_GSOAP_BIN    := <absolute path>/gsoap/bin
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Build Virtualbox from source

Post by noteirak »

Code: Select all

noteirak@debian:~/vbox$ sudo find / -name gsoap
/usr/share/gsoap
/usr/share/doc/gsoap
noteirak@debian:~/vbox$ cd /usr/share/gsoap
noteirak@debian:/usr/share/gsoap$ ls
custom  import  plugin  WS
noteirak@debian:/usr/share/gsoap$
No bin.. should I try to reinstall the package maybe?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Build Virtualbox from source

Post by noteirak »

Interesting error when I try to reinstall gsoap :

Code: Select all

noteirak@debian:/usr/share/gsoap$ sudo apt-get purge gsoap
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libconfig-inifiles-perl libgsoap2 liblist-moreutils-perl libsvn-perl python-subversion rsync
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  gsoap*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 5,022 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 211306 files and directories currently installed.)
Removing gsoap ...
Processing triggers for man-db ...
noteirak@debian:/usr/share/gsoap$ sudo apt-get install gsoap
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libconfig-inifiles-perl liblist-moreutils-perl libsvn-perl python-subversion rsync
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  gsoap
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,403 kB of archives.
After this operation, 5,022 kB of additional disk space will be used.
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
Selecting previously unselected package gsoap.
(Reading database ... 211157 files and directories currently installed.)
Unpacking gsoap (from .../gsoap_2.8.7-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up gsoap (2.8.7-1) ...
noteirak@debian:/usr/share/gsoap$
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Build Virtualbox from source

Post by noteirak »

I've launched the build with your settings (and replacing the path), we'll see how it goes.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Build Virtualbox from source

Post by Perryg »

VBox uses an older version of gsoap and the new one may not work properly. IIRC this is only needed to build the webservice.
On newer OSes where they changed gsoap I normally install the older version in my user land and be done with it. I know this was an issue with fedora but I guess Debian has finally updated it too.

gsoap version 2.7.9 is the one I keep handy. It does not need to be installed installed

http://sourceforge.net/projects/gsoap2/ ... %20stable/
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Build Virtualbox from source

Post by noteirak »

Thank you for the link, if the build fails, I try it.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Build Virtualbox from source

Post by Perryg »

OK I am done for today. I will check on your progress tomorrow.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Build Virtualbox from source

Post by noteirak »

The build went fine, I could install, here is the session from the install command :

Code: Select all

noteirak@debian:~$ sudo ./VirtualBox-4.*.*_OSE-r*.run install
Verifying archive integrity... All good.
Uncompressing VirtualBox for Linux installation...........
VirtualBox Version 4.2.51_OSE r43953 (2012-11-25T01:49:30Z) installer
Installing VirtualBox to /opt/VirtualBox
Python found: python, installing bindings...
Building the VirtualBox kernel modules

VirtualBox has been installed successfully.

You will find useful information about using VirtualBox in the user manual
  /opt/VirtualBox/UserManual.pdf
and in the user FAQ
  http://www.virtualbox.org/wiki/User_FAQ

We hope that you enjoy using VirtualBox.

noteirak@debian:~$ cd /opt/VirtualBox/
noteirak@debian:/opt/VirtualBox$ ls
additions         sdk                VBoxAutostart         VBoxDD2.so             VBoxEFI32.fd            VBoxHeadless.so     VBoxNetDHCP.so          VBoxPython.so  VBoxSharedClipboard.so  VBoxTestOGL    VirtualBox
components        src                VBoxBalloonCtrl       VBoxDDGC.gc            VBoxEFI64.fd            VBoxHostChannel.so  VBoxOGLhostcrutil.so    VBoxREM.so     VBoxSharedCrOpenGL.so   VBoxTunctl     virtualbox.desktop
icons             uninstall.sh       VBoxCreateUSBNode.sh  VBoxDDR0.r0            VBoxExtPackHelperApp    VBoxKeyboard.so     VBoxOGLhosterrorspu.so  VBoxRT.so      VBoxSharedFolders.so    VBoxVMM.so     VirtualBox.so
libvboxjxpcom.so  UserManual.pdf     VBoxDbg.so            VBoxDD.so              VBoxGuestControlSvc.so  VBoxManage          VBoxOGLrenderspu.so     VBoxSDL        vboxshell.py            VBoxXPCOMC.so  virtualbox.xml
nls               VBoxAuthSimple.so  VBoxDD2GC.gc          VBoxDDU.so             VBoxGuestPropSvc.so     VBoxNetAdpCtl       VBox.png                VBoxSDL.so     VBoxSVC                 VBoxXPCOMIPCD  VMMGC.gc
routines.sh       VBoxAuth.so        VBoxDD2R0.r0          VBoxDragAndDropSvc.so  VBoxHeadless            VBoxNetDHCP         VBoxPython2_7.so        VBox.sh        VBoxSysInfo.sh          VBoxXPCOM.so   VMMR0.r0
noteirak@debian:/opt/VirtualBox$
So in the end, it did install in the /opt dir like you said, even tho I've set the variable in LocalConfig.kmk :

Code: Select all

noteirak@debian:~/vbox$ cat LocalConfig.kmk
VBOX_WITH_ORIGIN           :=
VBOX_DOCBOOK_WITH_LATEX    := 1
KBUILD_MSG_STYLE           := brief
VBOX_PATH_APP_PRIVATE_ARCH := /usr/lib/virtualbox
VBOX_PATH_SHARED_LIBS      := $(VBOX_PATH_APP_PRIVATE_ARCH)
VBOX_WITH_RUNPATH          := $(VBOX_PATH_APP_PRIVATE_ARCH)
VBOX_PATH_APP_PRIVATE      := /usr/share/virtualbox
VBOX_JAVA_HOME             := /usr/lib/jvm/jdk1.7.0_09-adm64
VBOX_WITH_TESTCASES :=
VBOX_WITH_TESTSUITE :=
VBOX_PATH_APP_DOCS := /usr/share/doc/virtualbox
VBOX_GSOAP_INSTALLED := 1
VBOX_PATH_GSOAP := /usr/share/gsoap
VBOX_PATH_GSOAP_BIN    := /usr/share/gsoap/bin
noteirak@debian:~/vbox$
Just to be certain, I've tried to run vboxmanage :

Code: Select all

noteirak@debian:~$ vboxmanage
/opt/VirtualBox/VBoxManage: error while loading shared libraries: VBoxDDU.so: cannot open shared object file: No such file or directory
noteirak@debian:~$
And obviously, running a strace to check it out, it does try to look for it in /usrb/lib/virtualbox...

Code: Select all

noteirak@debian:~/vbox$ grep -i VBoxDDU.so vboxmanage_trace.txt
10773 open("/usr/lib/virtualbox/tls/x86_64/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/usr/lib/virtualbox/tls/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/usr/lib/virtualbox/x86_64/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/usr/lib/virtualbox/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/lib/x86_64-linux-gnu/tls/x86_64/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/lib/x86_64-linux-gnu/tls/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/lib/x86_64-linux-gnu/x86_64/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/lib/x86_64-linux-gnu/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/usr/lib/x86_64-linux-gnu/tls/x86_64/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/usr/lib/x86_64-linux-gnu/tls/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/usr/lib/x86_64-linux-gnu/x86_64/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/usr/lib/x86_64-linux-gnu/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/lib/tls/x86_64/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/lib/tls/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/lib/x86_64/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/lib/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/usr/lib/tls/x86_64/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/usr/lib/tls/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/usr/lib/x86_64/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 open("/usr/lib/VBoxDDU.so", O_RDONLY) = -1 ENOENT (No such file or directory)
10773 writev(2, [{"/opt/VirtualBox/VBoxManage", 26}, {": ", 2}, {"error while loading shared libra"..., 36}, {": ", 2}, {"VBoxDDU.so", 10}, {": ", 2}, {"cannot open shared object file", 30}, {": ", 2}, {"No such file or directory", 25}, {"\n", 1}], 10) = 136
noteirak@debian:~/vbox$
So I created /usr/lib/virtualbox & did some symlink :

Code: Select all

noteirak@debian:~$ sudo mkdir /usr/lib/virtualbox
noteirak@debian:~$ sudo ln -s /opt/VirtualBox/* /usr/lib/virtualbox
noteirak@debian:~$ vboxmanage -version
4.2.51_OSEr43953
noteirak@debian:~$
Everyone is happy.

Finally trying what I wanted to for days :

Code: Select all

noteirak@debian:~$ java -Dvbox.home=/usr/lib/virtualbox -cp vboxjxpcom.jar:sample.jar rrr
VirtualBox version: 4.2.51_OSE

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007ff70396867b, pid=10924, tid=140698885871360
#
# JRE version: 6.0_37-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.12-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x51867b]  unsigned+0xfb
#
# An error report file with more information is saved as:
# /home/noteirak/hs_err_pid10924.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Aborted
noteirak@debian:~$
Sooo... not fixed in SVN :(

Perryg, I just can't thank you enough for your guidance & help! - This is a very good experience and I will definitly get my VBox from source from now on.

My last humble request would be to see if we can fix the fact it has been installed in /opt/Virtualbox
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Build Virtualbox from source

Post by noteirak »

Some update : the SVN version build on openJDK 6 seems to fix something :

Code: Select all

noteirak@debian:~$ java -Dvbox.home=/usr/lib/virtualbox -cp vboxjxpcom.jar:sample.jar Sample
VirtualBox version: 4.2.51_OSE

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
        at org.mozilla.xpcom.internal.XPCOMJavaProxy.callXPCOMMethod(Native Method)
        at org.mozilla.xpcom.internal.XPCOMJavaProxy.invoke(XPCOMJavaProxy.java:143)
        at $Proxy1.getMachines(Unknown Source)
        at org.virtualbox_4_3.IVirtualBox.getMachines(IVirtualBox.java:110)
        at Sample.main(Sample.java:9)
noteirak@debian:~$
Just need a bit more digging....
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Build Virtualbox from source

Post by noteirak »

My last humble request would be to see if we can fix the fact it has been installed in /opt/Virtualbox
Any advice for this?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Build Virtualbox from source

Post by Perryg »

Working on it. I always use /opt (my choice) so building one now to see why it failed for you. One thing that comes to mind is if you already had VirtualBox and did not use the VBox uninstaller it may confuse the install.

Edit: my choice for using /opt is everything is located in one single location. As much as I build it would be time consuming going to different locations to check/test the build files.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Build Virtualbox from source

Post by Perryg »

For some reason or the other the LSB settings do not work in the OSE run build. The config settings that should be overridden with the LocalConfig.kmk don't work. I seem to remember this happened a ways back but since I did not build to LSB compliance on my OSE run builds it did not matter to me. If you want to build with LSB you will need to build the deb package. Basically the same configuration and you use the same lines in the LocalConfig.kmk but it is located in the following.

/trunk/src/VBox/Installer/linux/debian/LocalConfig.kmk (already created)
Then follow the instructions here: viewtopic.php?f=31&t=43102

You can actually use the same build env. but I build both so I have separate build env. for each.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Build Virtualbox from source

Post by noteirak »

Thank you, I'm going to give it a try and post back
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Build Virtualbox from source

Post by noteirak »

Code: Select all

<lots of line>
....
dh_pycentral
make[1]: dh_pycentral: Command not found
make[1]: *** [binary] Error 127
make[1]: Leaving directory `/home/noteirak/vbox-deb/src/VBox/Installer/linux'
make: *** [binary] Error 2
noteirak@debian:~/vbox-deb/src/VBox/Installer/linux$
lots of posts on google saying it is deprecated, Debian wiki about how to replace here but I do not want to start going overboard.
What would you recommend?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply