Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is it possible to have a vanilla installation of Ubuntu 14.04 (Trusty) and run inside it containerized older Ubuntu versions that originally came with older kernels?

For example for 12.04 I'd assume the answer is yes as it has linux-image packages for subsequent Ubuntu releases, such as linux-image-generic-lts-saucy and linux-image-generic-lts-quantal. For 10.04 that isn't the case, though, so I'm unsure. But is there documentation available that I can use to deduce what's okay to run?

The reason I am asking is because the kernel interface undergoes updates every now and then. However, it's sometimes beneficial to run newer versions of the distro and at the same time keeping a build environment based on a predecessor.

share|improve this question
    
I would simply try it out. If you happen to have access to the older 10.04 + 12.04 install media I would setup Docker images for these and try it out. –  slm Jun 13 at 14:26
    
No need to use install media, there're several docker containers of older Ubuntu releases in the registry. –  sr_ Jun 13 at 15:52
    
This mailing list thread (and the linked answer by jpetazzo) could provide some insight. –  sr_ Jun 15 at 17:05

1 Answer 1

up vote 4 down vote accepted

You can run older Linux programs on newer kernels. Linux maintains backward compatibility (at least for all documented interfaces), for the benefit of people who are running old binaries for one reason or another (because they don't want to bother recompiling, because they've lost the source, because this is commercial software for which they don't have the source, etc.).

If you want to have a build environment with older development tools, or even a test environment for anything that doesn't dive deeply into kernel interfaces, then you don't need to run an older kernel, just an older userland environment. For this, you don't need anything complex: a chroot will do. Something more advanced like LXC, Docker, … can be useful if you want the older (or newer, for that matter) distribution to have its own network configuration. If you don't want that, you can use what Debian uses precisely to build software in a known environment (e.g. build software for Debian stable on a machine with a testing installation): schroot. See How do I run 32-bit programs on a 64-bit Debian/Ubuntu? for a guide on setting up an alternate installation of Debian or a derivative in a chroot.

If you want to run the older distribution's kernel, you'll need an actual virtual machine for that, such as KVM or VirtualBox. Linux-on-Linux virtualization with LXC or the like runs the same kernel throughout.

share|improve this answer
    
I know there is a backward compatibility. But it's not so trivial, is it? Why else would linking against GLIBC leave an annotation header in ELF files stating a certain kernel ABI. Think about the move from 32bit time_t to 64bit time_t which is an incompatible change. So what's the cutoff point? –  0xC0000022L Jun 16 at 7:52
    
@0xC0000022L Linux still supports a.out binaries. Which have been obsoleted by ELF since 1998 or so. Newer Linux kernels support the older ABI; the kernel ABI indication is there because newer applications may not run on other kernels. –  Gilles Jun 16 at 8:06
    
other == newer? With GLIBC unfortunately things are even more convoluted, but that's a different story. Thanks. –  0xC0000022L Jun 16 at 8:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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