Update: I have created a CentOS 2 virtual machine image for
VirtualBox which is available for download
I’ve created a VMWare image of a RedHat 7.2 operating system. I need one for compiling and testing programs since a cluster that I sometimes use runs this aging OS, and programs that I compile on my Ubuntu laptop or the Fedora Core 6 server at the lab don’t work properly on that system.
I would love to redistribute the base image for other people who might require it but unfortunately Red Hat’s trademark protection policy prevents this. I don’t have time to go through the image and remove all the trademark-covered files, so here’s a quick guide to getting a useful system in a short time. By useful, I mean with Subversion, GSL and Boost libraries.
- Download the Red Hat 7.2 “enigma” ISOs. These are available, currently, at a few mirror sites, but here a link to cd1 and cd2.
- Download and install the free-as-in-beer VMWare Player (unless you have bought VMWare Workstation or similar). In Ubuntu this is as easy as
apt-get install vmware-player.
- Create a VMWare config file, also known as a “.vmx” file. I used the fantastic Easy VMX to help with mine. I added two virtual CDROM drives which I used to mount the two Red Hat ISOs. You can download my own vmx file which shows how to do this. Note also that you should use the ‘vlance’ virtual network card since the virtual Intel card didn’t work automatically in Red Hat 7.2 for me.
- Create (or download from Easy VMX) a virtual hard disk file. Using qemu-img this is as easy as
qemu-img create -f vmdk redhat72.vmdk 10G.
- Start the virtual machine, with the ISO images mounted as virtual CDROM drives.
- Proceed with the installation, which is pretty straightforward. I chose the “workstation” installation option, with the “development” packages selected. I also added ‘screen’, ‘sudo’ and ‘openssh-server’ packages.
- After installation, I had a virtual machine with a working network, taking up about 1.7GB of disk space in total.
I really need the Subversion revision control system, which was not included in the original Red Hat 7.2 packages since it was a young project at the time. Luckily there are reasonably recent third-party packages available, since it has a few dependencies that make compiling it from source non-trivial. From that repository, download and install at least the apache-libapr, db4, libxml2, neon, subversion and zlib packages. The zlib, libxml2 and db4 packages will be an upgrade to the original Red Hat packages, so use, e.g.
rpm -U zlib-1.1.4-0.1.i386.rpm to install. You may also require the -devel packages too, depending on your needs.
Install GCC 3.4.6
Red Hat 7.2 came by default with GCC 2.96 installed, an unofficial fork of GCC that was quite controversial and broke binary compatibility with other versions of GCC. It also included GCC v3.0.2, which as an early version of GCC 3.x was not perfect, but is better. I chose to install both of the GCC versions, with the v3.0.2 being installed to “/usr/bin/gcc3”.
My own software uses parts of the Boost libraries and I found that Boost does not compile with GCC 3.0.2. The quickest way around this was to install a later version of GCC, and the latest version of GCC v3.X is 3.4.6. Luckily, that is really easy to do…
- Download GCC 3.4.6
The new compiler will be installed at /usr/local/bin/gcc and will be used by default since /usr/local/bin is in the $PATH before /usr/bin in this OS.
In my case, I only need boost_filesystem, but this should work for all of Boost if necessary. As noted above, I installed GCC v3.4 from source since Boost failed to build with GCC v3.0.2
- Download Boost (the latest version, 3.4.1, worked fine)
make(will build the ‘jam’ build tool first, then boost_filesystem)
make install(installs boost_filesystem, also most of the header-only libraires).
Installing Gnu Scientific Library
The latest version of GSL (v1.9) compiles and installs easily with either GCC 3.0.2 or GCC 3.4.6. I didn’t try it with v2.96.
The Final Product
I wish I could provide a download link to my virtual machine, but if you follow these instructions it will only take a couple of hours to reproduce it. With the source directories of the software I installed, the total size of the image is 2GB, although the actual disk usage shows less than that.