How to CIFS Mount?


has somebody managed to mount CIFS volumes in RancherOS? NFS works nicely in my configuration (see below) but CIFS does not work at all…

sudo vi /var/lib/rancher/conf/cloud-config.yml

mount -t nfs /mnt/abc
mount -t cifs -o credentials=/root/.smbcredentials // /mnt/bcd

Do you have any suggestions?

Best regards


I don’t believe you can using the default console as no rpcbind package is present for mounting any type of remote file system.

Switching to the ubuntu-console should make this possible (as at worst you can just install the package).


I had a similar question and was struggling to get it working on our internal/private cloud. Here’s a stripped down version that will get you up and running.

hostname: namehere
   console: ubuntu
        dhcp: true
    vm.max_map_count: 262999
      image: rancher/agent:v1.2.2
      privileged: true
        - /var/run/docker.sock:/var/run/docker.sock
        CATTLE_HOST_LABELS: env=test&os=rancheros
  - chown -R :rancher /mnt
  - chmod -R g+rw /mnt
  - apt update
  - apt install cifs-utils -y
  - sudo mount //windowsFileServer/sharename -t cifs -o username=theUserName,password=thePassWordHere /mnt
  - ssh-rsa AAA...

This line is for running Elasticsearch on the host (off topic but may be helpful to others):

vm.max_map_count: 262999

To add more mounts you can create a yml file on rancheros like the following:


  • sudo mount //windowsFileServer/sharename2 -t cifs -o username=theUserName,password=thePassWordHere /mnt2

Then ‘sudo ros config merge -i moreMounts.yml’ and reboot. You can find the entry in /var/lib/rancher/conf/cloud-config.yml. This was brought to you in part by maik “No risk, no fun.” :slight_smile: and documentation.

version 1.0.4, successed

- - //
  - /mnt/smb
  - cifs
  - username=guest,iocharset=utf8,_netdev

Hello! Did you happen to make this work on RancherOS on v1.5.8? Here’s what I’ve set up:

-  - "//my_nas_address/share_name"
   - "/mnt/mountpoint"
   - "cifs"
   - "credentials=/root/.cifs,iocharset=utf8,_netdev"

And it doesn’t work. The sudo mount -t cifs "//my_nas_address/share_name" "/mnt/mountpoint" -o credentials=/root/.cifs,iocharset=utf8,_netdev works (but only after I switched to ubuntu console and I installed cifs-utils package.

The tail of dmesg says:

[   15.420866] FS-Cache: Netfs 'cifs' registered for caching
[   15.421124] Key type cifs.spnego registered
[   15.421142] Key type cifs.idmap registered
[   15.422067] Unable to determine destination address.

Any ideas on where to look for the issue?

Edit: I changed the “my_nas_address” (which was a DNS-resolved name) with an IP address and now, the error in dmesg is:

CIFS VFS: No username specified

After changing the credentials=/root/.cifs to username=XXX,password=YYY it stared to work. But I don’t like that workaround.

To solve first issue (Unable to determine destination address) I tried adding name resolve order = host lmhosts wins bcast to /etc/samba/smb.conf, but it sill didn’t accept the host DNS name.

I can live with hardcoded IP address, but I cannot stand the secrets being hardcoded in the config file.

Anyone got an idea on how to make this work with credfile and DNS name?

edit: The issues above, when unrelated to RancherOS, according to the internet, should be solved by installing cifs-utils. So my guess is that the udev container of RancherOS does not have it, so it’s impossible to do? Can someone confirm?