Installing CentOS 4.x under z/VM

Changes since last version

changeset:   12:e5ab4d0d4407
tag:         tip
user:        Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date:        Fri Nov 07 12:51:45 2008 -0500
summary:     zvm-centos4: finished the first version


Let's get started

If you follow this HOWTO, at the end of it you'll have a 31-bit CENTOS 4.6 running under z/VM.

The following howto assumes, that you know at least a little bit of:

The following software is required:

The install can take anywhere from half hour to a couple of hours depending on a couple of things, including your internet connection speed, as well as how much CPU time your VM guest gets.

First of all, you'll need to get the installation files to get things going.

So, point your browser to the mirror nearest you, navigate to this path:

/centos-4/4.6/os/s390/images/
and grab these files:
kernel.img
initrd.img
generic.prm
I used CentOS 4.6 to write this howto, but a newer version should work just as well.

Note: If you want a 64-bit system, you'll want to use s390x in the path instead.

I used this REXX script as to make my life easier. I called it redhat.exec (you'll notice that some of the files are called redhat or rhel, that's because I based my install steps on scripts/config files used to install RHEL on s390):
/* */                    
'CL RDR'                 
'PURGE RDR ALL'          
'SPOOL PUNCH * RDR'      
'PUNCH KERNEL IMG A (NOH'
'PUNCH REDHAT PARM A (NOH'
'PUNCH INITRD IMG A (NOH'
'CH RDR ALL KEEP NOHOLD' 
'I 00C'

Login to your VM id, and start CMS

ipl cms
. Then transfer the files you got to your A minidisk. You can either use FTP, or IND$FILE through your 3270 terminal emulator. I used the IND$FILE method via c3270.

Note: The .img files should be transfered as binaries, and the other two need to be converted to EBCDIC. Both, FTP and IND$FILE support converting between ASCII and EBCDIC.

I used the following commands in c3270 to do the transfers:
transfer host=vm ... mode=binary localfile=kernel.img "hostfile=kernel img a"
transfer host=vm ... mode=binary localfile=initrd.img "hostfile=initrd img a"
transfer host=vm ... mode=ascii localfile=redhat.exec "hostfile=redhat exec a"
transfer host=vm ... mode=ascii localfile=generic.prm "hostfile=generic prm a"
As one might easily guess, the first is the kernel image, and the second is the initrd. The third file is a short REXX script that'll punch the files in the proper order to your rdr, and then IPLs from device 000c - which by convention is your rdr. The last file contains the kernel command line options, which on systems like i386, you specify via a keyboard to the bootloader.

At this point, your CMS A minidisk should look like something like this:
CMS listing the files on A

The RHEL5.CONF file contains configuration options for the installer. Here's an example config file from the CentOS install docs:

DASD=200
HOSTNAME=client.z900.example.com
NETTYPE=ctc
IPADDR=192.168.0.10
SUBCHANNELS=0.0.0150,0.0.0151
NETWORK=192.168.0.0
NETMASK=255.255.255.0
SEARCHDNS=example.com:dns.example.com:z900.example.com
BROADCAST=192.168.0.255
GATEWAY=192.168.0.1
DNS=192.168.0.254
MTU=1492 
CTCPROT=0
You will want to change the DASD to list all your DASDs that Linux should bring online. The HOSTNAME, IPADDR, NETWORK, NETMASK, SEARCHDNS, BROADCAST, GATEWAY, DNS, and MTU need to be changed to match your network config. And chances are that you'll want to change NETTYPE to qeth, or something other than ctc (possible values are: ctc, qeth, iucv, lcs). Go read the CentOS documentation to figure out what are all the options you can use in the config file.

Now, it is time to run the REXX script. Just type

redhat
and press enter. You'll see the reader getting purged, and then three files getting punched:
Files punched to RDR

Shortly after, you'll see the kernel banner displayed. Since I installed CentOS 4.x, the kernel version is 2.6.9. If you use 5.x, the version will be obviously different.
Kernel banner

Some more scrolling later, you'll see a message prompting you to telnet or ssh into the system, and continue with the installation process:
SSH/telnet prompt
SSH or telnet in as root. The password is the empty string, so when prompted for it, simply press the enter key.

At this point, the install process is much like network install on any other architecture.

The regular CentOS installer will kick in. It'll prompt you for the type of install (http, ftp, nfs). I went with HTTP.

The next screen prompts you for the hostname and path on the HTTP server that contains the CentOS packages:
SSH/telnet prompt
Right after, the installer tries to grab stage 2 of itself: Stage2 being downloaded

Partition your DASDs whichever way you want. It's a good idea to use LVM, since DASDs are limited to about 2.2GB (3338 cylinders). On my setup, I made /home a logical volume of 5 3390-3 DASDs.

Most of the questions the installer normally asks you get answered by the options in the RHEL5.CONF file. And before long, you'll see the install process doing its thing:
Install!

Although this howto was aimed at 31-bit CentOS...

Final Note

I hope this HOWTO helped you get started with CentOS under z/VM. I tried to be as accurate and specific with the details where I thought it was necessary - the S/390 specific parts. If you have any suggestions, or comments (content, spelling, etc.) feel free to contact me via email: jeffpc@josefsipek.net.


Full history

changeset:   12:e5ab4d0d4407
tag:         tip
user:        Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date:        Fri Nov 07 12:51:45 2008 -0500
summary:     zvm-centos4: finished the first version

changeset:   11:43f87a840ead
user:        Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date:        Wed Sep 03 14:32:37 2008 -0400
summary:     zvm-centos4: a few fixups

changeset:   10:1d96f0b77f23
user:        Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date:        Sun Aug 31 18:56:26 2008 -0400
summary:     revamp of the build system + zvm-centos4 howto begining


Copyright ©2008 Josef "Jeff" Sipek <jeffpc@josefsipek.net>