2

I need to create a container to run an old proprietary software that used to work in my old 32 bit computer with Ubuntu 8.04. I have been adapting this software in successive OS upgrades by linking the required libraries to the modern versions, but now it has reached a point where I cannot do that any more (not at least easily).

But, with Playonlinux it is possible to create a container with special libraries and an old Windows program will "believe" he is inside Windows 3.11 for instance and will work, unaware that he is in an alien world, a linux 64 bit machine in 2018... If that is possible, adapting my linux 32 bit software should be easier if only one knew how.

Words like "Fakeroot" come to my mind but I don't know where to begin.

Even when a complete answer is not possible, clues to start with are welcome.

PS. I'm using Debian 9

  • Is docker not an option? – Raman Sailopal Feb 20 '18 at 15:19
  • see also dpkg --add-architecture i386, apt-get install package:i368, I am not saying that this is the way to go. I have used it to install 32-bit programs. Not all dependencies seem to get installed. You often have to apt-get install the 32-bit libraries. – ctrl-alt-delor Feb 20 '18 at 16:57
  • @ctrl-alt-delor The problem seems to be that, even when I try to install the 32 bit libraries, they are either more modern versions or simply unavailable. It's also a software to do numerical stuff and I don't feel 100% secure doing so many patches and adaptations... I want to go now either for some kind of virtualization or a container. – Mephisto Feb 20 '18 at 17:01
  • So the problem is not the 64bit, but versions. – ctrl-alt-delor Feb 20 '18 at 17:03
  • @ctrl-alt-delor The problem is both the 64 bit and the versions... – Mephisto Feb 20 '18 at 17:22
2

Based on this page on the Ubuntu wiki, one approach for this is to run your program in a Ubuntu 8.04 chroot. These instructions assume Ubuntu or some other Debian derivative (or Debian itself).

  1. Install debootstrap and schroot:

    sudo apt install debootstrap schroot
    
  2. Create a configuration file for 32-bit Ubuntu 8.04 (also known as Hardy Heron), named /etc/schroot/chroot.d/hardy_i386.conf and containing the following:

    [hardy_i386]
    description=Ubuntu 8.04 Hardy for i386
    location=/srv/chroot/hardy_i386
    personality=linux32
    root-users=mephisto
    run-setup-scripts=true
    run-exec-scripts=true
    type=directory
    users=mephisto
    

    (replacing mephisto with appropriate user names; multiple users can be specified using commas).

  3. Install Ubuntu 8.04:

    sudo mkdir -p /srv/chroot/hardy_i386
    sudo debootstrap --variant=buildd --arch=i386 hardy /srv/chroot/hardy_i386 http://old-releases.ubuntu.com/ubuntu/
    
  4. Start using the chroot:

    schroot -c hardy_i386 -u root
    

    (this logs you in as root in the chroot, which may or may not be appropriate of course).

By default the chroot will bind-mount your home directories, which might be dangerous; if necessary you can disable this by commenting out the /home line in /etc/schroot/mount-defaults.

  • Wow, this seems to be exactly what I need. Let me test it and I will accept the answer. Thanks!!! – Mephisto Feb 20 '18 at 16:51
  • I also have problems adapting scientific software that is designed for RedHat (the authors give simply a tar.gz file you copy and unpack and it is supposed to work on RH/Fedora, and this does not goes always smoothly in my Debian). Would this work too? (I understand I would have to install install Fedora in step 3 of your answer) – Mephisto Feb 20 '18 at 16:56
  • For RHEL or Fedora or CentOS, you’d have to use some other form of installation — debootstrap won’t work. However the general idea is the same. Docker would be simpler for those distributions, or perhaps Vagrant (but using a VM then). – Stephen Kitt Feb 20 '18 at 17:22
1

A virtual machine (with, e.g., KVM or VirtualBox) is a better option for something like this than a chroot or a container system like docker or lxc.

Ubuntu 8.04 is ancient (2008) - far older than even Wheezy (2013-2016), and even wheezy is very difficult(*) to get running on a modern machine with current kernels and libc6 under docker. It might be easier in a chroot than a container, but I wouldn't count on it.

Installing Ubuntu 8.04 in a VM is trivially easy. Just download the installer ISO, set up a VM (e.g. with libvirt's virt-manager GUI), and boot up the VM using the ISO.

Alternatively, it's possible to use various "physical to virtual" techniques to clone an existing machine into a VM. IMO, it's better to start with a clean, fresh install of Ubuntu 8.04, and then configure it specifically to run your ancient app.

(*) e.g. over a year ago, I had to install libc6 and a bunch of other libraries from jessie into a wheezy container just to get it running on docker. The problem was that the host running docker had been upgraded to have libc6 2.24, and the ancient libc6 in the wheezy container did not work with that. It would have made more sense to just upgrade the container to jessie - but the app we were running in it was too old to run in jessie. so, I made a monstrous Frankenwheezy.


It sounds like your application might be a Windows 3.11 app (or maybe that was just an analogy...not sure) - with a VM, you might not even need to run Ubuntu 8.04. If that is the case, and if you have a valid license for a suitably ancient version of Windows (say, 95 or 98 or maybe XP. It's even possible to get Windows for Workgroups 3.11 itself running in KVM) then you could install that into a VM and then install your app into the VM.

If you don't have a valid license, you could try ReactOS, a Free Software clone of Windows (mostly intended to be compatible with Windows Server 2003, but might run software from earlier versions of Windows). BTW, there's a lot of crossover between ReactOS and WINE development.

Otherwise Ubuntu 8.04 + WINE would run well in a VM.

  • Thanks! (+1) It's a Linux scientific software somewhat similar to Matlab. I have been able to make it work in 10.04, 12.04 and 14.04. The problem with the VM is that it can only access a shared folder and I end up being a pain in the neck, I have already tried that. – Mephisto Feb 21 '18 at 2:49
  • Any network file system also works - including NFS and samba and FUSE-based stuff like sshfs. I guess the key factor is whether manually dealing with library version issues from time to time (chroots and containers have strong interactions/dependencies with the host OS. VMs are effectively isolated) is more, or less, hassle to you than the file sharing issues. – cas Feb 21 '18 at 2:54
  • BTW, i suppose you've already explored the idea of porting/rewriting whatever your proprietary app does in Octave? or R? or Python + Numpy + SciPy? – cas Feb 21 '18 at 2:56
  • I cannot port such thing, it's something as sophisticated and complex as Matlab, only I want to avoid naming it here for personal reasons. I don't use it myself but I am required to use it from time to time because other people that work with me still use it. But, wait a moment... Can I do ssh and sshfs from an virtual machine to the host???? That would solve everything. I could use the damn thing inside a virtual machine and mount the host home in a folder of the VM. – Mephisto Feb 21 '18 at 18:01
  • 1
    yes, if the VM has a network interface (even just a private network with only the VM and the host) you can certainly do that. You'd probably have to upgrade sshfs in the VM to match the version in the host. or use NFS. BTW, setting up ssh keys is one of the first things I do when I create a VM so that I can ssh from my terminal rather than have to use the VM's console. – cas Feb 22 '18 at 0:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.