Python 3 support

Discussions related to using the OSE version of VirtualBox.
AndreasH
Posts: 8
Joined: 24. Aug 2009, 12:28
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Windows, Linux

Python 3 support

Post by AndreasH »

Hello,

can somebody tell me about the status of Python3 support for the XPCOM bindings?

The SDK installer installs a vboxapi module in /usr/lib/python3.5/dist-packages, but it doesn't work. Apparently there is no compatible VBoxPython:

Code: Select all

Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170118] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import vboxapi
>>> vm = vboxapi.VirtualBoxManager()
m=VBoxPython3_5m x=No module named 'VBoxPython3_5m'
m=VBoxPython3m x=No module named 'VBoxPython3m'
m=VBoxPython x=/opt/VirtualBox/VBoxPython.so: undefined symbol: _Py_ZeroStruct
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/vboxapi/__init__.py", line 970, in __init__
    self.platform = PlatformXPCOM(dPlatformParams)
  File "/usr/local/lib/python3.5/dist-packages/vboxapi/__init__.py", line 730, in __init__
    import xpcom.vboxxpcom
  File "/opt/VirtualBox/sdk/bindings/xpcom/python/xpcom/vboxxpcom.py", line 78, in <module>
    raise Exception('Cannot find VBoxPython module (tried: %s)' % (', '.join(_asVBoxPythons),))
Exception: Cannot find VBoxPython module (tried: VBoxPython3_5m, VBoxPython3m, VBoxPython)
I am using Debian 9 with the packaged Python 3.5. I tried both with the pre-built VirtualBox package for Debian 9 as well as the "manual" installer.
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: Python 3 support

Post by noteirak »

I got confirmation that the problem is at SDK build time, so nothing on your end. It is indeed broken...
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
klaus
Oracle Corporation
Posts: 1110
Joined: 10. May 2007, 14:57

Re: Python 3 support

Post by klaus »

Python 3 support is definitely working since the release of 5.1 at least. What you're running into is clearly a hiccup with package building on the Oracle side. For some reason the current packages for Debian 9 (Stretch) contain only the library for Python 2.7. Looking into it, probably will be fixed with the next maintenance release.
klaus
Oracle Corporation
Posts: 1110
Joined: 10. May 2007, 14:57

Re: Python 3 support

Post by klaus »

Ouch. I ran into a whole series of brick walls trying to cure this issue. The current state (not publicly available anywhere) is that installing vbox would also unconditionally install python 3.5 since the debian packaging tools are "too clever" and create dependencies, because they find the .so files which use the python library.

So far this is still unresolved. Really annoying when packaging is getting in the way of actually shipping functionality which would be long there...

Oh, and while the distro-independent .run installer wouldn't have such issues, it's highly unlikely that it could deliver working Python 3 support, since it's built on an old distro which (if at all) would have some Python version (e.g. 3.1) which you don't have.
klaus
Oracle Corporation
Posts: 1110
Joined: 10. May 2007, 14:57

Re: Python 3 support

Post by klaus »

BTW, this has absolutely nothing to do with the VirtualBox SDK. The Python support is part of the base package, covering only the system default python version. This limitation is a surprise for me, because it effectively nullifies all the work which went into the Python 3 support. One could build a VirtualBox package which supports Python 3, but only by pretending at build time that Python 3 is the system default python version. And that's really not how it should be. Rebuilding VirtualBox with weird hacks just to get Python 3 support isn't intentional.
AndreasH
Posts: 8
Joined: 24. Aug 2009, 12:28
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Python 3 support

Post by AndreasH »

klaus wrote:Ouch. I ran into a whole series of brick walls trying to cure this issue. The current state (not publicly available anywhere) is that installing vbox would also unconditionally install python 3.5 since the debian packaging tools are "too clever" and create dependencies, because they find the .so files which use the python library.

So far this is still unresolved. Really annoying when packaging is getting in the way of actually shipping functionality which would be long there...
First of all, thanks for taking the time to try and resolve this issue.

I am developing for Debian and understand the packaging system quite well. Actually, I see nothing wrong in that behaviour, at least it fits with the rest of the Debian system. What would be necessary is to split up the whole thing into multiple packages, one main virtualbox package without any python library and a "Recommends: virtualbox-python-support | virtualbox-python3-support", and two separate packages with python 2 and 3 libraries respectively.

If I could get my hands at something like a debianized source package, I might be able to help with this.
Oh, and while the distro-independent .run installer wouldn't have such issues, it's highly unlikely that it could deliver working Python 3 support, since it's built on an old distro which (if at all) would have some Python version (e.g. 3.1) which you don't have.
I already tried that, indeed it doesn't have any working Python 3 support.
klaus
Oracle Corporation
Posts: 1110
Joined: 10. May 2007, 14:57

Re: Python 3 support

Post by klaus »

Thanks for the offer to help... the VirtualBox source tarball is "debianized" out of the box. See the debian directory. If you dig around then you'll notice that it builds with VBOX_WITH_MULTIVERSION_PYTHON= (i.e. disables it). Oh, and debian/rules it's actually broken (only calls python without any script - check src/VBox/Installer/linux/debian/rules how to actually install the VirtualBox API support using vboxapisetup.py, which "only" needs to be run by the python version you want it installed for).

However, we're seriously allergic against package splitting... so far we resisted all good advice to split it in any way. Others (e.g. the official debian package) can do what they like, but for us every additional file is adding effort.
AndreasH
Posts: 8
Joined: 24. Aug 2009, 12:28
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Python 3 support

Post by AndreasH »

From what I read so far, it should be possible to change the behaviour of automatic dependencies by adding '--exclude=VBoxPython' to dh_makeshlibs and dh_shlibdeps in debian/rules.

I tried it myself, but didn't get far. The source one can download from https://www.virtualbox.org/wiki/Downloads or the code repository linked from that page can't possibly be the one the Debian packages for Debian 9 are generated from. The debian/ directory has multiple issues:
  • * The debhelper compatibility level specified in debian/compat and debian/rules (Level 4) is not supported anymore. Minimum supported but deprecated is 5, I would suggest at least 9 to stay compatible with Debian wheezy
    * The build dependencies listed in debian/control are way out-of-date.
    • they list qt4 while VirtualBox 5.1 requires Qt5. I replaced with qtbase5-dev and libqt5opengl5-dev. libqt5x11extras5-dev and qttools5-dev-tools are also required
      java-2-runtime and openjdk-6 is listed which should probably be default-jre resp. default-jdk
      libxinerama-dev, libdevmapper-dev, libvpx-dev, texlive-latex-base and genisoimage are missing
      libcurl-dev is not available anymore, I chose libcurl4-gnutls-dev instead
      ia32libs is not available anymore, we need to specify the exact needed libraries for i386 architecture
I tried fixing all of the above except for the ia32libs and started building, but it stopped with

Code: Select all

xsltproc docbook2latex.xsl  - {T}/manual/en_US/UserManual.xml
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/UserManual.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                           ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Introduction.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Introduction.xml:1086: parser error : Entity 'rarr' not defined
              <para>Use the items in the "Input" → "Keyboard" menu of the
                                                       ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Introduction.xml:1125: parser error : Entity 'rarr' not defined
          found under "File" → "Preferences" → "Input" →
                                   ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Introduction.xml:1125: parser error : Entity 'rarr' not defined
          found under "File" → "Preferences" → "Input" →
                                                        ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Introduction.xml:1125: parser error : Entity 'rarr' not defined
          found under "File" → "Preferences" → "Input" →
                                                                       ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Introduction.xml:1697: parser error : Entity 'rarr' not defined
      </footnote> Alternatively, select "File" → "Import appliance" from
                                                     ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Introduction.xml:1727: parser error : Entity 'rarr' not defined
    machines that you already have in VirtualBox, select "File" → "Export
                                                                      ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Installation.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Installation.xml:78: parser error : Entity 'ge' not defined
                <note><para>Python version ≥ 2.6 is required. Since VirtualBo
                                               ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Installation.xml:158: parser error : Entity 'ge' not defined
                <note><para>Python version ≥ 2.6 is required. Since VirtualBo
                                               ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_BasicConcepts.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_GuestAdditions.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_GuestAdditions.xml:887: parser error : Entity 'rarr' not defined
            look for it under "My Networking Places" → "Entire Network"
                                                           ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_GuestAdditions.xml:888: parser error : Entity 'rarr' not defined
            → "VirtualBox Shared Folders". By right-clicking on a shared
                  ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Storage.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Networking.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Networking.xml:706: parser error : Entity 'rarr' not defined
      "File" → "Preferences" → "Network" → "Host-only network"
                   ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Networking.xml:706: parser error : Entity 'rarr' not defined
      "File" → "Preferences" → "Network" → "Host-only network"
                                        ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Networking.xml:706: parser error : Entity 'rarr' not defined
      "File" → "Preferences" → "Network" → "Host-only network"
                                                         ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Networking.xml:707: parser error : Entity 'rarr' not defined
      → "(+)Add host-only network", or via command line with</para>
            ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Networking.xml:718: parser error : Entity 'rarr' not defined
          all these items in the global settings via "File" → "Preferences"
                                                                  ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Networking.xml:719: parser error : Entity 'rarr' not defined
          → "Network", which lists all host-only networks which are
                ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Frontends.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Frontends.xml:86: parser error : Entity 'rarr' not defined
            find it under "Start" → "All Programs" → "Accessories"
                                        ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Frontends.xml:86: parser error : Entity 'rarr' not defined
            find it under "Start" → "All Programs" → "Accessories"
                                                              ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Frontends.xml:87: parser error : Entity 'rarr' not defined
            → "Remote Desktop Connection". If you use the "Run" dialog,
                  ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_VBoxManage.xml:20: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_VBoxManage.xml:1278: parser error : Entity 'ndash' not defined
          – if so – which type. The list of supported audio types de
                 ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_VBoxManage.xml:1278: parser error : Entity 'ndash' not defined
          – if so – which type. The list of supported audio types de
                               ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_VBoxManage.xml:4479: parser error : Entity 'rarr' not defined
                  (CR + LF → LF). Not yet implemented. Optional.</para>
                                 ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_VBoxManage.xml:4487: parser error : Entity 'rarr' not defined
                  line endings (LF → CR + LF). Not yet implemented. Optiona
                                         ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/user_VBoxManage_CommandsOverview.xml:2: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
D DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
                                                                               ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_AdvancedTopics.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Technical.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_VirtualBoxAPI.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                           ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Troubleshooting.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Troubleshooting.xml:423: parser error : Entity 'rarr' not defined
  → offset to COREDESCRIPTOR
        ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Troubleshooting.xml:425: parser error : Entity 'rarr' not defined
  → Memory offset of range
        ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Troubleshooting.xml:426: parser error : Entity 'rarr' not defined
  → File offset
        ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Troubleshooting.xml:429: parser error : Entity 'rarr' not defined
  → Magic
        ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Troubleshooting.xml:430: parser error : Entity 'rarr' not defined
  → VM core file version
        ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Troubleshooting.xml:431: parser error : Entity 'rarr' not defined
  → VBox version
        ^
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Troubleshooting.xml:432: parser error : Entity 'rarr' not defined
  → Number of vCPUs etc.
        ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Security.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_KnownIssues.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_ChangeLog.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                           ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_ThirdParty.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                           ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_PrivacyPolicy.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                           ^
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/user_Glossary.xml:3: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
                                                         ^
  IPRT: Testing mangling and visiblity for newer gcc... 
  LD      VMMRC
if readelf -S /media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/VMMRC/VMMRC.rc|grep -q "[cd]tors"; then echo "Found ctors/dtors in /media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/VMMRC/VMMRC.rc!"; exit 1; fi
  INST    VBoxAPIWrap => {C}/out/debian/builddir/lib/VBoxAPIWrap.a
  INST    RuntimeR0 => {C}/out/debian/builddir/lib/RuntimeR0.a
kmk_builtin_install /media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/VBoxRT/VBoxRT.so /media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/bin/VBoxRT.so
chcon -t texrel_shlib_t /media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/bin/VBoxRT.so || true
chcon: can't apply partial context to unlabeled file '/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/bin/VBoxRT.so'
  INST    VMMRC => {C}/out/debian/builddir/bin/VMMRC.rc
  LD      VBoxDTraceR0
if readelf -S /media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/VBoxDTraceR0/VBoxDTraceR0.r0|grep -q "[cd]tors"; then echo "Found ctors/dtors in /media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/VBoxDTraceR0/VBoxDTraceR0.r0!"; exit 1; fi
  VMM: Testing for undefined symbols in VMMRC using nm... 
  IFIL    {C}/out/debian/builddir/stage/debug/bin/VMMRC.debug
  IFIL    {C}/out/debian/builddir/bin/VMMRC.debug
  IFIL    {C}/out/debian/builddir/stage/debug/bin/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.amd64/VBoxDTraceR0.debug
  IFIL    {C}/out/debian/builddir/bin/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.amd64/VBoxDTraceR0.debug
  LD      VBoxXPCOM
  LD      VBoxRTDummy
  LD      VBoxVMMPreload
  LD      VBoxVMM
  LD      VBoxDDU
  LD      VBoxSVGA3D
  LD      VBoxAuth
  LD      VBoxOGLhostcrutil
  LD      DbgPlugInDiggers
  LD      VBoxDTraceMain
  LD      VBoxDTraceCmd
  LD      VBoxXPCOMIPCC
  LD      scm
  LD      VBoxExtPackHelperApp
  LD      RTRm
  LD      RTManifest
  LD      RTLdrFlt
  LD      RTGzip
  LD      RTHttp
  LD      RTShutdown
  LD      RTTar
  LD      RTUnzip
  LD      RTDbgSymCache
  LD      RTSignTool
  LD      tstGlobalConfig
  LD      tstSSM-2
  LD      SUPInstall
  LD      SUPUninstall
  LD      SUPLoggerCtl
  LD      tstSDL
  LD      rdesktop-vrdp
  LD      VBoxDTrace
  IPRT: Testing mangling using nm... 
  LD      VBoxXPCOMIPCD
  INST    VBoxDTraceR0 => {C}/out/debian/builddir/bin/ExtensionPacks/Oracle_VBoxDTrace_Extension_Pack/linux.amd64/VBoxDTraceR0.r0
  pdflatex {T}/manual/en_US/UserManual.tex (four passes) -> {T}/manual/en_US/UserManual.pdf 
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
  INST    VBoxXPCOM => {C}/out/debian/builddir/bin/VBoxXPCOM.so
  LD      VBoxCAPI
entering extended mode
kmk: *** [/media/ah/daten/Software/VirtualBox-5.1.22/out/debian/builddir/obj/manual/en_US/UserManual.pdf] Error 1
kmk: *** Waiting for unfinished jobs....
kmk: *** Exiting with status 2
debian/rules:98: recipe for target 'debian/build-stamp' failed
make: *** [debian/build-stamp] Error 2
Will try to continue later...
klaus
Oracle Corporation
Posts: 1110
Joined: 10. May 2007, 14:57

Re: Python 3 support

Post by klaus »

We definitely do use the stuff from src/VBox/Installer/linux/debian for building packages. The toplevel debian directory is intentionally somewhat different (catering for differences between our build env and what we expect "normal" people to have), but the aim is to have them reasonably similar. Could be bit rot in toplevel debian...
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Python 3 support

Post by Perryg »

The deb build is broken as you see but you can build the *.run version.
  • <Snip from rules>
    # for some reason, the Qt libraries couldn't be found on newer releases (e.g. Ubuntu hardy)
    LD_LIBRARY_PATH=$(prefix)/usr/lib/virtualbox dh_shlibdeps
    </Snip>
Dependencies below are what should allow you to build.
viewtopic.php?f=31&t=70118&p=393332#p393332
debian-9.png
debian-9.png (12.41 KiB) Viewed 17760 times
AndreasH
Posts: 8
Joined: 24. Aug 2009, 12:28
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Python 3 support

Post by AndreasH »

klaus wrote:We definitely do use the stuff from src/VBox/Installer/linux/debian for building packages. The toplevel debian directory is intentionally somewhat different (catering for differences between our build env and what we expect "normal" people to have), but the aim is to have them reasonably similar. Could be bit rot in toplevel debian...
Thanks for pointing this out. This directory is indeed very similar to the toplevel debian. But the build dependencies in debian/control are definitely not satisfiable with Debian 9, e.g. a package 'linux-headers-generic' has never existed in Debian 7, 8 or 9. This is an Ubuntu package. Additionally, there is still libqt4 given as build dependency, while it's clear that VirtualBox 5.1 needs Qt5. Maybe your build environment contains what is really needed to build, but then it's not completely specified in debian/control and therefore hard to recreate.

If you have a build environment where you can successfully build a package for Debian 9, I'd be interested in the output of 'dpkg-query -l'.

I will now try to install the deps from the thread linked in Perryg's Post, which is right now downloading another 2.3G of packages :shock:
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Python 3 support

Post by socratis »

Moving to "VirtualBox OSE" from "VirtualBox API".
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
AndreasH
Posts: 8
Joined: 24. Aug 2009, 12:28
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Python 3 support

Post by AndreasH »

I think I finally got some things sorted out:

1. The top-level debian directory is indeed bit-rotten. The rules from src/VBox/Installer/linux/debian/rules work, but only if run from that directory (some paths are hard-coded). So this package cannot be built with dpkg-buildpackage, which in turn means that the dependencies from debian/control never get checked. Instead you have to manually take care that you have all dependencies and run 'debian/rules binary' from the 'src/VBox/Installer/linux' directory. By merging the deps which I found out myself, from PerryG and the official debian package of virtualbox, I ended up with a control file that contains the right dependencies. The top-level debian directory should be removed since it is useless, IMHO.

2. Managing the python module and dependencies works as I assumed. I attached a patch that will make the rules build and install modules for both python 2 and 3, while *not* creating a dependency on python 2 or 3. It will likely need some modification to also work on systems with Python 3 earlier than 3.5, but I cannot do that at this time. Minor glitch is that the vboxapi modules get placed in /usr/local/lib/pythonX/dist-packages instead of /usr/lib/..., but that's not important.

3. For the python 3 module to work, you need my patch from https://www.virtualbox.org/ticket/16899 as well
Attachments
rules.diff.txt
(2.35 KiB) Downloaded 200 times
control.txt
(2.85 KiB) Downloaded 186 times
klaus
Oracle Corporation
Posts: 1110
Joined: 10. May 2007, 14:57

Re: Python 3 support

Post by klaus »

The toplevel debian directory shouldn't be removed, it should be turned into one which directly works again.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Python 3 support

Post by Perryg »

While I can not speak of how to do this with "the debian way", I do know that the official way to build the package is to do so using the VirtualBox build process and not the hosts.

Example: running the following

Code: Select all

/trunk/src/VBox/Installer/debian/rules binary
To clean if you need to rebuild:

Code: Select all

/trunk/src/VBox/Installer/debian/rules clean
Post Reply