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,

  • Docker Rails app fails to be served - curl: (56) Recv failure: Connection reset by peer
  • Docker: ping: unknown host yahoo.com
  • Ansible docker_container gives “Error getting network id”
  • Docker Run Time Statistics ( Benchmarks)
  • How to connect to service in the host machine from inside a docker container?
  • Docker error cannot delete docker container, conflict: unable to remove repository reference
  • 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
    

  • NPM install error running Docker on CentOS
  • Cloudbees Docker Plugin - “?” Folder
  • Running migrations with Rails in a Docker container with multiple container instances
  • I need to run twice docker-compose to not have errors
  • Attach and run a command in a docker container
  • Strange behavior when using Marathon Health Check with the command protocol and a 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.