Can't compile VitualBox

New to Debian (Or Linux in general)? Ask your questions here!

Can't compile VitualBox

Postby sparky25 » 2018-06-16 00:55

I am a novice at linux. I attempted to compile Vitrual Box from source on Debaian 9.4. After much time resolving dependency issues, I came to a problem during the compilation process (after a successful ./config):

Code: Select all
root@ferrarideb:/home/bill/vbox# source /home/bill/vbox/vbox/env.sh
root@ferrarideb:/home/bill/vbox# kmk
...
kmk: /usr/lib/x86_64-linux-gnu/qt5/bin/lrelease: Command not found
kmk: *** [/home/bill/vbox/vbox/out/linux.amd64/release/obj/VirtualBox/qtnls/VirtualBox_bg.qm] Error 127


The only lrelease file in my system is here:

Code: Select all
root@ferrarideb:/usr/lib/x86_64-linux-gnu# locate lrelease
/usr/bin/lrelease


The $PATH variable:

Code: Select all
root@ferrarideb:/home/bill/scripts# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


The needed qt5 files are not in /usr/lib/x86_64-linux-gnu/qt5/bin. They appear to be in /usr/lib/x86_64-linux-gnu:

Code: Select all
root@ferrarideb:/usr/lib/x86_64-linux-gnu# dpkg -l | grep libqt5
ii  libqt5clucene5:amd64                     5.7.1-1                                     amd64        Qt 5 CLucene module
ii  libqt5concurrent5:amd64                  5.7.1+dfsg-3+b1                             amd64        Qt 5 concurrent module
ii  libqt5core5a:amd64                       5.7.1+dfsg-3+b1                             amd64        Qt 5 core module
ii  libqt5dbus5:amd64                        5.7.1+dfsg-3+b1                             amd64        Qt 5 D-Bus module
ii  libqt5designer5:amd64                    5.7.1-1                                     amd64        Qt 5 designer module
ii  libqt5gui5:amd64                         5.7.1+dfsg-3+b1                             amd64        Qt 5 GUI module
ii  libqt5help5:amd64                        5.7.1-1                                     amd64        Qt 5 help module
ii  libqt5network5:amd64                     5.7.1+dfsg-3+b1                             amd64        Qt 5 network module
ii  libqt5opengl5:amd64                      5.7.1+dfsg-3+b1                             amd64        Qt 5 OpenGL module
ii  libqt5opengl5-dev:amd64                  5.7.1+dfsg-3+b1                             amd64        Qt 5 OpenGL library development files
ii  libqt5printsupport5:amd64                5.7.1+dfsg-3+b1                             amd64        Qt 5 print support module
ii  libqt5script5:amd64                      5.7.1~20161021+dfsg-2                       amd64        Qt 5 script module
ii  libqt5scripttools5:amd64                 5.7.1~20161021+dfsg-2                       amd64        Qt 5 script tools module
ii  libqt5sql5:amd64                         5.7.1+dfsg-3+b1                             amd64        Qt 5 SQL module
ii  libqt5sql5-sqlite:amd64                  5.7.1+dfsg-3+b1                             amd64        Qt 5 SQLite 3 database driver
ii  libqt5svg5:amd64                         5.7.1~20161021-2+b2                         amd64        Qt 5 SVG module
ii  libqt5test5:amd64                        5.7.1+dfsg-3+b1                             amd64        Qt 5 test module
ii  libqt5widgets5:amd64                     5.7.1+dfsg-3+b1                             amd64        Qt 5 widgets module
ii  libqt5x11extras5:amd64                   5.7.1~20161021-2                            amd64        Qt 5 X11 extras
ii  libqt5x11extras5-dev:amd64               5.7.1~20161021-2                            amd64        Qt 5 X11 extras development files
ii  libqt5xml5:amd64                         5.7.1+dfsg-3+b1                             amd64        Qt 5 XML module


Again, I know almost nothing of linux, so this may not even be an appropriate question. But is it possible that the newest version Debian linux places the installed qt5 packages - or at least the file 'lrelease' - in a place that VirtualBox does not expect?
sparky25
 
Posts: 3
Joined: 2018-06-15 23:58

Re: Can't compile VitualBox

Postby stevepusser » 2018-06-16 02:16

You can try QT_SELECT to have the system configured to use the Qt5 versions:

Code: Select all
export QT_SELECT=qt5


However, if you just want virtualbox on Stretch, 5.2.10 is in stretch-backports. (backports.org)

FWIW, I've backported virtualbox 5.2.12 from upstream Debian for the MX 17 test repository. The only thing it needs to build that's not in vanilla Stretch is a newer kbuild, which I backported first. The newer kbuild is also in stretch-backports. http://mxrepo.com/mx/testrepo/pool/test/v/virtualbox/

Simple backporting guide: https://wiki.debian.org/SimpleBackportCreation

Learning how to backport saves all that time wasted solving the missing build-dependency problems, plus you end up with a much better product.

Note that you'll end up with several different deb packages, so will have to install those in the correct order, instead of letting apt sort them out automatically...or you could get them from the MX repo.

Another option is to backport them in the openSUSE Build Service, and add the resulting repo. There's a guide to doing that in the HOWTO section here. That way, others can share your work.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.10.6, Pale Moon 28.1.0, wine-staging 3.16, qBittorrent 4.1.3, Linux kernel 4.18.8, virtualbox 5.2.18
User avatar
stevepusser
 
Posts: 9906
Joined: 2009-10-06 05:53

Re: Can't compile VitualBox

Postby sparky25 » 2018-06-17 21:37

Thanks for the possible solution:

Code: Select all
export QT_SELECT=qt5


I have been unable to make this work. I entered the command, recompiled. But the compile failed at the same step. Is there something else that I need to do to configure the above? Do I need to purge the qt5 packages and reinstall them?

In any case, I am learning some things about backports. It appears to be a very useful technique for getting applications to work on my system.
sparky25
 
Posts: 3
Joined: 2018-06-15 23:58

Re: Can't compile VitualBox

Postby stevepusser » 2018-06-18 18:43

The Qt 5 version of lrelease is in the qttools5-dev-tools package, and is in a different folder than /usr/bin, depending on the architecture, so for amd64:

Code: Select all
/usr/lib/x86_64-linux-gnu/qt5/bin/lrelease


But if you just follow the backporting directions, you don't have to learn all this extra stuff. It helps if the backport doesn't build right out of the box so you can try and fix it, but otherwise, no. The /usr/bin/lrelease you have is probably the Qt 4 version.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.10.6, Pale Moon 28.1.0, wine-staging 3.16, qBittorrent 4.1.3, Linux kernel 4.18.8, virtualbox 5.2.18
User avatar
stevepusser
 
Posts: 9906
Joined: 2009-10-06 05:53

Re: Can't compile VitualBox

Postby sparky25 » 2018-06-21 21:10

My objective is 2-fold:

1. Learn how to compile from source using Virtual Box as the platform
2. Learn a better way to run newer versions of software via backports

Now to attempt objective 1:
Thanks to stevepusser for getting me to the next level on my Virtual Box compile by suggesting the needed package:

Code: Select all
apt-get install qttools5-dev-tools
./configure
source /home/bill/vbox/vbox.sh
source /home/bill/vbox/vbox/env.sh
kmk
cd ./out/linux.amd64/release/bin/src
make
make install


Now that everything seems to have worked, I should be able to run Virtual Box. But what do I do to execute?

The following seemed to be a candidite, but with unsatifactory results:

Code: Select all
root@ferrarideb:/home/bill/vbox/vbox/out/linux.amd64/release/bin/src# cd ..
root@ferrarideb:/home/bill/vbox/vbox/out/linux.amd64/release/bin# ./VirtualBox
VirtualBox: supR3HardenedVerifyDir: Failed to open "/opt/VirtualBox": No such file or directory (2)


I would have thought that once 'make install' executed properly, I would be OK. What did I do wrong?

Toward objective 2:
Thanks again to stevepusser for the suggested simple backports example. But I got stuck.

Here is the relevant source information:
https://wiki.debian.org/SimpleBackportCreation

This is what I did:

Code: Select all
sudo apt-get install packaging-dev debian-keyring devscripts equivs
sudo dget -x http://http.debian.net/debian/pool/main/m/mame/mame_0.195+dfsg.1-2.dsc
dir
cd mame-0.195+dfsg.1


Here is where i had the problem:

Code: Select all
bill@black:/usr/bin$ cd /home/bill/mame/mame-0.195+dfsg.1
bill@black:~/mame/mame-0.195+dfsg.1$ sudo mk-build-deps --install --remove
dh_testdir
dh_testroot
dh_prep
dh_testdir
dh_testroot
dh_install
dh_install: Compatibility levels before 9 are deprecated (level 7 in use)
dh_installdocs
dh_installdocs: Compatibility levels before 9 are deprecated (level 7 in use)
dh_installchangelogs
dh_installchangelogs: Compatibility levels before 9 are deprecated (level 7 in use)
dh_compress
dh_fixperms
dh_installdeb
dh_installdeb: Compatibility levels before 9 are deprecated (level 7 in use)
dh_gencontrol
dh_md5sums
dh_builddeb
dpkg-deb: building package 'mame-build-deps' in '../mame-build-deps_0.195+dfsg.1-2_amd64.deb'.

The package has been created.
Attention, the package has been created in the current directory,
not in ".." as indicated by the message above!
Selecting previously unselected package mame-build-deps.
(Reading database ... 149963 files and directories currently installed.)
Preparing to unpack mame-build-deps_0.195+dfsg.1-2_amd64.deb ...
Unpacking mame-build-deps (0.195+dfsg.1-2) ...
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies...Starting pkgProblemResolver with broken count: 1
Starting 2 pkgProblemResolver with broken count: 1
Investigating (0) mame-build-deps:amd64 < 0.195+dfsg.1-2 @iU mK Nb Ib >
Broken mame-build-deps:amd64 Depends on debhelper:amd64 < 10.2.5 @ii mK > (>= 11)
  Removing mame-build-deps:amd64 because I can't find debhelper:amd64
Done
 Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following packages will be REMOVED:
  mame-build-deps
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 9,216 B disk space will be freed.
Do you want to continue? [Y/n] n
Abort.
(Reading database ... 149966 files and directories currently installed.)
Removing mame-build-deps (0.195+dfsg.1-2) ...
mk-build-deps: Unable to install all build-dep packages


It appears that I am missing a package that contains 'debhelper:amd64'.

Is this the problem? If so, how do I find out where it is located?

(FWIW, here are the repositories in my sources.list:

Code: Select all
deb http://debian.uchicago.edu/debian/ stretch main contrib

deb http://security.debian.org/debian-security stretch/updates main contrib
deb-src http://security.debian.org/debian-security stretch/updates main contrib


Are other repositories required?)

Thanks for the help.
sparky25
 
Posts: 3
Joined: 2018-06-15 23:58

Re: Can't compile VitualBox

Postby stevepusser » 2018-06-22 21:56

Well, mame is not a simple backport. You're getting that error because at least debhelper 11 is not available in stock Stretch, though it is in stretch-backports: https://packages.debian.org/stretch-backports/debhelper (Though currently you can change it to 10 and most packages will build anyway)

The dsc file is just a text file, so opening it and looking at the list of build-depends:

Code: Select all
Build-Depends: debhelper (>= 11), dpkg-dev (>= 1.17), libexpat1-dev, libflac-dev, libfontconfig1-dev, libglm-dev, libjpeg-dev, liblua5.3-dev, libportmidi-dev [linux-any], libsdl2-ttf-dev, libsdl2-dev, libsqlite3-dev, libutil-freebsd-dev [kfreebsd-any], libutf8proc-dev, libxinerama-dev, portaudio19-dev, python-dev, qtbase5-dev, rapidjson-dev (>= 1.0), zlib1g-dev
Build-Depends-Indep: python3-sphinx


shows at least one other trouble spot with rapidjson-dev being too old in Stretch, but 1.1.0 is in stretch-backports...I hope that's all of those.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.10.6, Pale Moon 28.1.0, wine-staging 3.16, qBittorrent 4.1.3, Linux kernel 4.18.8, virtualbox 5.2.18
User avatar
stevepusser
 
Posts: 9906
Joined: 2009-10-06 05:53


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable