Debian – Automount a samba share using fstab cifs in a debian virtualbox

automountcifsdebianfstabmount

When i run:

mount -a

as root user in my virtualbox machine i will get the samba share mounted, so my settings in my /etc/fstab are working:

//192.168.0.99/download /vagrant/Downloads cifs credentials=/root/.smbcredentials,auto 0 0

But why is this share not automounted when my virtualbox machine is booting?
I run virtualbox in headless mode using vagrant. At the moment i need to run this sequence:

vagrant up
vagrant ssh
sudo su
mount -a

While this should be enough:

vagrant up

I am new to debian administration. Is there a log file for fstab / mount issues, that can be viewed after booting? Could it be a timeout or dependency issue on booting? How to debug it best?

Best Answer

The network might not yet be initialized at this point. You can add _netdev to the mount options. This will delay the mount until the network is connected.

//192.168.0.99/download /vagrant/Downloads cifs credentials=/root/.smbcredentials,_netdev,auto 0 0
Related Topic