Sink Or Swim: My Trouble With VirtualBox

By | 05/04/2008

I spent quite some time yesterday trying to build a package “just for fun” and realize that it is way over my n00b-packager head, but I do feel like I learned quite a bit in the process.  I feel like it has been a bit like jumping into the deep end of the pool and figuring it out as you go.  Granted I won’t die if I don’t figure it out, but you learn a lot very quickly when you’re in over your head.

What I was trying to do was build a .deb for VirtualBox 1.6 that was released just a few days ago.  I downloaded it to tinker with, assuming I would have to just compile the source, but I noticed it had a debian/ directory.  I figured it couldn’t hurt to give it a try, so I tried building it.  I wanted to outline what I tried to do (so all of the real packagers out there can correct me), but I will say that I am still stuck on getting it built in pbuilder.  I do have it built and running on my local machine, but when I build it in pbuilder something dies.

What I tried (please comment with tips / corrections)

The first thing I did was download the VirtualBox 1.6 OSE from Sun (Yes, if you hadn’t heard, Innotek was recently bought by Sun).  From this I ended up with a VirtualBox-1.6.0-OSE.tar.bz2.

I unpacked this, which created a VirtualBox-1.6.0_OSE directory to work in.

Now, to try and appease the source-package-gods I re-packed that directory into a .orig.tar.gz and created a .orig/ directory as well.

QUESTION: Why does the source need to be in a .tar.gz format?

The .orig.tar.gz that I created used the naming convention virtualbox_ose_1.6.0.orig.tar.gz.

The .orig/ directory also had the naming convention virtualbox_ose_1.6.0.orig/.

QUESTION: I understand the naming convention should be <packagename>-<version>.  How is this handled when <packagename> is two words?

I first tried to build the package with the default debian/ directory that came with the download.  I quickly found that this had some things wrong with it.

  1. The debian/changelog latest revision referred to 1.5.51~svn-1.
  2. There were missing Build-Depends on my machine (libxml2-dev, libxslt-dev, libpng-dev,…)

I then used dch -v 1.6 to create a new changelog version (This is 1.6 after all, not 1.5.51~svn), and added the details of my changes:

  • Corrected changelog version reference
  • Added required build-depends (libxml2-dev, libxslt-dev, libpng-dev,…)

QUESTION: Is this the proper way to document what I needed to change to build 1.6?

At this point the package did build using dpkg-buildpackage and it installed properly on my machine.  I did not yet run lintian, as I’m sure there are still plenty of things that are broken.

I tried to take this one step further and build it in pbuilder.  This is where things really got stuck.  I get into the build process and then it dies on finding Xlibs.  It is frustrating because it will build on my machine, but not in pbuilder, and I can’t figure out what package provides what it is looking for.

Here is a snippet of the build and the error.  I would appreciate any tips on how to figure out what package is needed to resolve this.

Checking for environment: Determined build machine: linux.x86, target machine: linux.x86, OK.
Checking for kBuild: found, OK.
Checking for gcc: found version 4.2.3, OK.
Checking for as86: found version 0.16.17, OK.
Checking for bcc: found version 0.16.17, OK.
Checking for iasl: found version 20061109, OK.
Checking for xslt: found, OK.
Checking for pthread: found, OK.
Checking for libxml2: found version 2.6.31, OK.
Checking for libxslt: found version 1.1.22, OK.
Checking for libIDL: found version 0.8.10, OK.
Checking for zlib: found version 1.2.3.3, OK.
Checking for libpng: found version 1.2.15beta5, OK.
Checking for SDL: found version 1.2.12, OK.
Checking for X libraries:
Xlibs not found at -L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib -lXext -lX11 -I/usr/local/include or Xlibs headers not found

I have tried a few X packages but they don’t seem to do the trick.  I even peeked into the PUEL pre-packaged version available for download and added any missing depends they had that I didn’t.  At this point I’m stuck wondering how to figure out the issue.  Any tips?

7 thoughts on “Sink Or Swim: My Trouble With VirtualBox

  1. Kevin Mark

    re:tar.gz
    saving space. Debian has 11 archs and who wants to store 11 copies of each revision uncompressed? There is also a choice recently to use bzip or gzip. And proposals for allowing others(7zip).

    re;2 words
    I dont think its allowed to have a package name contain a space, so if it did, it would be renamed using some convention(use underscore?) in the dev-ref or packaging guide.

  2. Zelut

    @Kevin Mark – I understand the importance of keeping it commpressed. I guess the real question is why not bzip2 or something? Why specifically gzip?

    @Mackenzie – I did try libx11-dev, x11-common and a few others that looked obvious.

    @Philip – Yes, my pbuilder has main universe and multiverse enabled..

  3. Danyel Lawson

    Are you building the 64bit version? I ask because it looks like the build is looking for a 64bit library. Maybe pbuilder needs the 64bit x11 library installed to build a version that is good for 32 and 64 bit.

  4. Jonathan Rogers

    Zelut, which distribution are you using? The post doesn’t say, but in an earlier post, you mention Ubuntu Intrepid. Is that what you managed to build VirtualBox 1.6 on? I’m trying to build it on Ubuntu Hardy. I noticed the debian directory in the tarball from Sun. However, I replaced it with the one from svn://svn.debian.org/svn/pkg-virtualbox/trunk, since that’s what the Ubuntu source package seems to be based on. It’s not working for me yet, apparently because I need a newer version of kBuild.

  5. Kenneth Larsen

    I believe this is what you are looking for:

    sudo apt-get install xorg-dev

Comments are closed.