Iscsid not starting on a centos6 docker on MacOS host

I am trying to run iscsid on a centos docker. But the command fails with, “FATAL: Could not load /lib/modules/4.9.13-moby/modules.dep: No such file or directory”

[root@7627d06541cc opt]# iscsiadm -m node -o new -T bilbo:cdisk0 -p 127.0.0.1
Starting iscsid: FATAL: Could not load /lib/modules/4.9.13-moby/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/4.9.13-moby/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/4.9.13-moby/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/4.9.13-moby/modules.dep: No such file or directory
                                                       [  OK  ]
iscsiadm: can not connect to iSCSI daemon (111)!
New iSCSI node [tcp:[hw=,ip=,net_if=,iscsi_if=default] 127.0.0.1,3260,-1 bilbo:cdisk0] added

Docker is being started using,

  • Problems with Dockerbeats dashboard containerName field
  • docker image error downloading package
  • Oracle DB+Weblogic in a single container
  • docker container does not start with json unmarshal error
  • OS Container vs Application Container
  • X11 forwarding of GUI app in Docker container
  • msingh$ docker run -it cent6 bash
    

    Info Inside the docker

    [root@7627d06541cc opt]# uname -a
    Linux 7627d06541cc 4.9.13-moby #1 SMP Sat Mar 25 02:48:44 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
    [root@7627d06541cc opt]# ls /lib/modules/
    2.6.32-642.13.1.el6.x86_64
    

    I have also tried creating a soft link from

    [root@7627d06541cc opt]# ln -s /lib/modules/2.6.32-642.13.1.el6.x86_64 /lib/modules/4.9.13-moby
    

    However iscsid still fails with

    [root@7627d06541cc opt]# iscsiadm -m node -o new -T bilbo:cdisk0 -p 127.0.0.1
    Starting iscsid: FATAL: Error inserting iscsi_tcp (/lib/modules/4.9.13-moby/kernel/drivers/scsi/iscsi_tcp.ko): Invalid module format
    FATAL: Error inserting ib_iser (/lib/modules/4.9.13-moby/kernel/drivers/infiniband/ulp/iser/ib_iser.ko): Invalid module format
    FATAL: Error inserting cxgb3i (/lib/modules/4.9.13-moby/kernel/drivers/scsi/cxgbi/cxgb3i/cxgb3i.ko): Invalid module format
    FATAL: Error inserting cxgb4i (/lib/modules/4.9.13-moby/kernel/drivers/scsi/cxgbi/cxgb4i/cxgb4i.ko): Invalid module format
    FATAL: Error inserting bnx2i (/lib/modules/4.9.13-moby/kernel/drivers/scsi/bnx2i/bnx2i.ko): Invalid module format
    FATAL: Error inserting be2iscsi (/lib/modules/4.9.13-moby/kernel/drivers/scsi/be2iscsi/be2iscsi.ko): Invalid module format
    

  • Kitematic: connecting to a docker machine with different name
  • How can kubernetes dynamically expose my docker port?
  • Deployment of new version to containers
  • Kubernetes: how to set VolumeMount user group and file permissions
  • Error while executing mysql commands inside docker-compose
  • Unable to see the contents in the docker container
  • One Solution collect form web for “Iscsid not starting on a centos6 docker on MacOS host”

    –privileged should fix this issue. But, you should use –privileged only using docker run and not during docker build.

    docker run –privileged -d –name stack stack:latest

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.