sharkcz (sharkcz) wrote,

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

  1. create directory structure
    cd somewhere
    mkdir dasd images
  2. get the Hercules config file
  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
  5. get the parameters file
    cd ..
  6. get the LPAR ins file
  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

  • Multi-arch solution for scanning

    You might know that I am using a Power9-based Talos II system running Fedora as my primary workstation not only for my job's duties. One of the few…

  • Why it's useful to use a deskop on ppc64le

    I want provide a short example what I've met in the past weeks when dog-fooding a ppc64le Fedora desktop environment on my OpenPOWER based Talos…

  • How to debug weird build issues

    When working on a secondary arch Fedora like s390x, we witness interesting build issues sometimes. Like a sudden test failure in e2fsprogs in…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded