Building VB 6.1.0 on/for Windows

Discussions related to using the OSE version of VirtualBox.
Post Reply
Todd Almighty
Posts: 51
Joined: 13. Nov 2013, 13:44

Building VB 6.1.0 on/for Windows

Post by Todd Almighty »

I used the guide here to build VB 6.0.14 from source, as Oracle's page is really outdated. His instructions worked well, and yield MSIs for x64 and x86, and then a combined "MultiArch" exe.

However, when I attempt to use his same guide for 6.1.0, I ported his code "patch", but there seem to be some issues building the x86 side, which prevents the final MultiArch exe from getting built. Specifically, a large number of objs (compiler output) don't get built with 6.1.0 using just "kmk". I'm trying to track down exactly why, but it's difficult as you don't get an error message as to why stuff is not getting built.

Has anyone sorted out the problem?

If you follow his guide, you'll see he builds the x64 side first, and that seems to finish OK with 6.1.0, but the MSI it produces isn't enough to install VB - there are some pieces that get picked up from outside the MSI that are apparently in the MultiArch exe wrapper. I'm not sure the shipping VB is built using the same process, but if so I suppose I could try to replace the x64 MSI from the official package with the one I built, but of course that's not guaranteed to work.

I didn't see any thread on building for Windows in the tutorials section, so I assume this is the right place to ask...
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: Building VB 6.1.0 on/for Windows

Post by socratis »

Moving to "VirtualBox OSE" from "Windows Hosts".
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.
Todd Almighty
Posts: 51
Joined: 13. Nov 2013, 13:44

Re: Building VB 6.1.0 on/for Windows

Post by Todd Almighty »

Wow, this subforum gets virtually no traffic at all. So much for any hope of getting help. The last non-moderator post was from October.

BTW, what is OSE? I thought when we build from source we're building the same way the official release is built?
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: Building VB 6.1.0 on/for Windows

Post by socratis »

Todd Almighty wrote:Wow, this subforum gets virtually no traffic at all.
Then you can guess how many people build VirtualBox from source...
Todd Almighty wrote:BTW, what is OSE?
Open Source Edition.
Todd Almighty wrote:I thought when we build from source we're building the same way the official release is built?
You'd think! Have you tried the official instructions? :P

The developers have been building VirtualBox with a series of patches, fixes, etc. I once (couple years ago) challenged them to create a new OSX build from their own instructions. Still waiting... ;)
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.
Todd Almighty
Posts: 51
Joined: 13. Nov 2013, 13:44

Re: Building VB 6.1.0 on/for Windows

Post by Todd Almighty »

I've made some progress on the problem with VB 6.1.0. Apparently, the devs decided to disable "cross compiling" (for x86 on x64), at least for certain resources. I'm not sure why, as it was fully supported by the toolset. There's some new Makefile code that disables portions of the build on the x86 side if you're on an x64 host.

Now, my machine has 64GB and I've been using 64-bit for a long time, so I don't really care about support for 32-bit, but the point is that it wasn't removed cleanly. Instead, it appears to have been broken in a confusing way.

In any event, one solution, and the one I've taken, is to avoid the "combo" build, and thus only build the exe for 64-bit. If you're following the VB 6.0.14 build guide linked above, you want to update LocalConfig.kmk to disable the combo build:

Code: Select all

VBOX_WITH_COMBINED_PACKAGE :=  
With that change in place, then you can just follow the build guide for the x64 build, up to the "kmk" line. (You'll also need an updated version of the patch file the author discusses in the guide, which I've attached. No guarantees there.) After running kmk, then the final command should now be:

Code: Select all

kmk C:/Devel/VirtualBox-src/out/win.amd64/release/bin/VirtualBox-6.1.0_OSE-r135406-MultiArch.exe
Yes, it's still called "MultiArch" though it's not. For me this generates a 104mb file. I tested it inside a VMware installation of Windows 8.1 with the latest updates and was able to run Windows XP.

Note that with self-signed certificates, as you will have if you use the guide, you cannot run VB with hardening enabled. VB somehow knows that it was installed without "real" MS certs (or perhaps it's that you have to install in test signing mode with self-signed certs for the kernel drivers).

That sort of sucks, since I did plan to use this setup to debug hardening issues, like why I'm still having problems getting the Outpost DLL accepted even though the logs report that it passes fWinVerifyTrust. I suppose as part of that investigation I will need to (locally) hack out whatever checks are blocking VB from even starting.
Attachments
vbox_build.patch
VB 6.1.0 source patch
(24.21 KiB) Downloaded 86 times
Last edited by Todd Almighty on 25. Jan 2020, 21:12, edited 1 time in total.
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: Building VB 6.1.0 on/for Windows

Post by socratis »

With 6.0.x, the official support for 32-bit Hosts was removed, but the pieces were there, you could still build a 32-bit version if you wished to engage in such an endeavor.

With 6.1.x the 32-bit pieces have been removed from the source code.
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.
Jeancaf
Posts: 1
Joined: 14. Nov 2010, 22:29
Primary OS: Debian other
VBox Version: OSE self-compiled
Guest OSses: Windows XP, Windows 7

Re: Building VB 6.1.0 on/for Windows

Post by Jeancaf »

Todd Almighty wrote:I've made some progress on the problem with VB 6.1.0.
Hi,
How apply the patch to svn sources?
Last edited by socratis on 10. Feb 2020, 13:18, edited 2 times in total.
Reason: Remove verbatim quote of entire previous post.
Todd Almighty
Posts: 51
Joined: 13. Nov 2013, 13:44

Re: Building VB 6.1.0 on/for Windows

Post by Todd Almighty »

If you followed the guide I referenced, then you installed Cygwin. One of the Linux tools Cygwin provides is the patch command. If you didn't install it originally, rerun the Cygwin installer and install patch. It should install the docs so you can do "man patch".

You'll want to copy vbox_build.patch into VirtualBox-src and then run something like:

Code: Select all

patch -p1 < vbox_build.patch
This will generate output reporting the success/failure of the patch attempts. The procedure above still works for me as of VB 6.1.2.
mhanor
Volunteer
Posts: 321
Joined: 7. Oct 2009, 12:40
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: various

Re: Building VB 6.1.0 on/for Windows

Post by mhanor »

Todd Almighty wrote:you cannot run VB with hardening enabled.
You can run VirtualBox with hardening, but I'm not sure how you would debug it.
Todd Almighty
Posts: 51
Joined: 13. Nov 2013, 13:44

Re: Building VB 6.1.0 on/for Windows

Post by Todd Almighty »

Well, I'm not able to run the self-built, self-signed version with hardening enabled. It fails with an error message. if you know how, please let us know. Yes, I've registered the certs properly with the local machine so that they come back as "OK" when I display them in explorer.
mhanor
Volunteer
Posts: 321
Joined: 7. Oct 2009, 12:40
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: various

Re: Building VB 6.1.0 on/for Windows

Post by mhanor »

Hello,

I compile all libraries (curl, openssl, Qt) with /integritycheck added to the linker parameters and I sign them with my test certificate.
I've just tested this and it's still possible to run the hardened self-build VirtualBox. Be sure to sign all dlls that are loaded by VirtualBoxVM.exe, especially the Qt ones, from bin and from subdirectories of plugins. If a library fails to load, it may be silent (no message box is displayed) or Windows may display a message box with error code 0xc0000428. Also, it wanted the Qt libraries owned by TrustedInstaller, this was something new for me. Always check that the dlls are signed and integrity check is set (dumpbin /headers).

To build Qt (5.6.3) with integrity check, before building, you have to edit qtbase\mkspecs\common\msvc-desktop.conf, adding /integritycheck to the line that starts with QMAKE_LFLAGS=. You'll also need to sign binaries (*.exe and *.dll) as they are being built. The build will periodically stop due to something not being able to execute, then you run signtool to sign the files. I haven't been able to understand the Qt build system, to automate this.
To build OpenSSL (1.1.1d) with integrity check, before building, you have to edit Configurations\00-base-templates.conf, the line that starts with LDFLAGS=, in BASE_Windows section, adding /integritycheck. Sign the binaries after the build.
For curl (7.68.0), edit WinBuild\MakefileBuild.vc, the line starting with LFLAGS=.
test.jpg
test.jpg (50.34 KiB) Viewed 34315 times
Attachments
Logs.7z
(65.03 KiB) Downloaded 52 times
Post Reply