Log in

No account? Create an account

Previous Entry | Next Entry

Installing Fedora 20 in Hercules

Hercules is a software implementation of the IBM mainframe architectures and serves as a viable solution for various tasks for people who don't have access to the real mainframe hardware. Using these steps you can install the latest Fedora in Hercules on one emulated ECKD DASD device with CTC adapter used for networking. The procedure doesn't require manual intervention as it is using a kickstart file for unattended installation. LVM is used for managing the storage, so it's easy to add new DASDs to expand the available space. The resulting product of the procedure bellow can be found at http://s390.koji.fedoraproject.org/test/hercules/20/

  1. create directory structure
    cd somewhere
    mkdir dasd images
  2. get the Hercules config file
    wget http://s390.koji.fedoraproject.org/test/ks/fedora.cnf
  3. create an empty ECKD DASD image
    cd dasd
    dasdinit -bz2 -linux linux-ckd.130 3390-9 LNX000
    cd ..
  4. get the installer kernel and initrd
    cd images
    wget http://s390.koji.fedoraproject.org/tree/releases/20/Fedora/s390x/os/images/kernel.img
    wget http://s390.koji.fedoraproject.org/tree/releases/20/Fedora/s390x/os/images/initrd.img
    wget http://s390.koji.fedoraproject.org/tree/releases/20/Fedora/s390x/os/images/initrd.addrsize
  5. get the parameters file
    wget http://s390.koji.fedoraproject.org/test/ks/generic.prm.kslvm
    cd ..
  6. get the LPAR ins file
    wget http://s390.koji.fedoraproject.org/test/ks/ks-lvm.ins
  7. the resulting directory structure is then
    ├── dasd
    │   └── linux-ckd.130
    ├── fedora.cnf
    └── images
        ├── generic.prm.kslvm
        ├── initrd.addrsize
        ├── initrd.img
        └── kernel.img
  8. add the masquerade rule to your local firewall and enable forwarding
    sudo iptables -t nat -A POSTROUTING -s -d -j MASQUERADE
    sudo echo 1 > /proc/sys/net/ipv4/ip_forward
    You should also check whether there are other firewall rules the could conflict with the Hercules traffic.
  9. start Hercules
    sudo hercules -f fedora.cnf
    and check that you see the devices 0130 (DASD) and 0600-0601 (CTC network interface)

  10. IPL Fedora installer
    ipl ks-lvm.ins
  11. the installation is now running

  12. log into the running installation as root (no password is set) and apply the workaround for bug 904245
    You need to wait until you see these messages on the console
    Started OpenSSH server daemon.
    Started Network Manager.
    then do:
    ssh -l root
    chmod 0644 /sys/firmware/reipl/ccw/loadparm
  13. wait some time (cca 3 hours on my dated workstation) until Hercules starts to throw some exceptions (from MSCH opcode), then quit Hercules and you are done
    HHCCP014I CPU0000: Operand exception CODE=0015 ILC=4
    CPU0000:  PSW=00001000 80000000 00000000001167F0 INST=B232D116     MSCH  278(13)                modify_subchannel
    EDIT 2014-01-20: after an advice from Robert Knight I changed the reboot command in the kickstart to poweroff, so the guest will shutdown correctly after installation, no more tons of error messages

  14. enjoy Fedora 20 on your virtual mainframe
    sudo hercules -f fedora.cnf
    ipl 130
    and from another terminal run
    ssh -l root (password=fedora as set in the kickstart file)

More information

  • if you see on console
    Warning: /dev/root does not exist
    Starting Dracut Emergency Shell...
    then the root= parameter doesn't exist in your generic.prm or points to inaccessible file or firewall rules block IP traffic, either the HTTP connection or DNS queries

  • description of Anaconda options
  • read the Release notes, also follow the links to the previous releases
EDIT 2016-07-11: the referenced files should be all available here


( 7 comments — Leave a comment )
Xose Vazquez Perez
Jan. 10th, 2014 02:23 pm (UTC)
8 and 9 = hercules-run
Steve White
Jul. 11th, 2016 08:16 pm (UTC)
Dead links
Hi, great post - but links now appear dead. Any idea where I can get the files linked in this post? (namely kickstart and hercules fedora.cnf)
Jul. 11th, 2016 08:37 pm (UTC)
Re: Dead links
Hi Steve,
http://fedora.danny.cz/s390/ should carry all the needed files.
Jan. 21st, 2017 10:14 pm (UTC)
Fedora 25
I wanted to use the latest Fedora build, but could only find the .iso. Since it doesn't contain the initrd.addrsize or kernel.img files, how should I proceed? Thanks.
Jan. 23rd, 2017 04:44 pm (UTC)
Re: Fedora 25
Where were you looking for the ISO? The ISO from https://alt.fedoraproject.org/alt/ or http://dl.fedoraproject.org/pub/fedora-secondary/releases/25/Server/s390x/ have the correct content.
Yudhajit Kar
Jan. 27th, 2017 01:07 pm (UTC)
Running Fedora 20 on Hercules on Windows?
If I am running Hercules on Windows 10 what would be the corresponding steps should I follow?
Jan. 31st, 2017 02:49 pm (UTC)
Re: Running Fedora 20 on Hercules on Windows?
I have no experience with Hercules on Windows, but I think the biggest difference might be the network setup, see Hercules docs. The rest of the instruction should translate smoothly to Windows.
( 7 comments — Leave a comment )



Latest Month

June 2019
Powered by LiveJournal.com
Designed by Lilia Ahner