You are on page 1of 2

How to mount a windows/samba windows share under Linux?

Alex

Under Linux (Ubuntu 12.04) I want to mount a windows share / windows partition named //winshared on the network. I do not know the IP or anything else.

On one Ubuntu system, I am able to mount a directory with


mount //winshared/mypath /mnt/win

while on one other Ubuntu system the exact same command just gives
mount error: could not resolve address for winshared: Unknown error

Network settings seem to be same on both systems, and I installed smbfs and samba (the latter with errors). Do I need to instal something else? Do I need to configure something? How to find
out the crucial differences between both systems to get the same mount work on both systems?

Additional information:

1. When I use smbclient to connect to the windows partition/share/whatever, it works on the first system but not on the other system. The error is:
Connection to winshared failed (Error NT_STATUS_BAD_NETWORK_NAME)

2. Following this tutorial I installed smbfs and cifs-utils, but the mount command from above still gives the same error, which is NOT described in the tutorial.

3. I also have an entry in /etc/fstab reading


//winshared/mypath /mnt/win cifs uid=alexander,credentials=/etc/samba/wincred 0 0

with the file /etc/samba/wincred identical to a same file on the system the mount works. The md5sum of both files are identical. Therefore, an error regarding credentials can be
excluded.

asked Nov 6 '13 at 12:36

AlexAlex

1,9841616 gold badges4646 silver badges7777 bronze badges

Either you have name resolver issue (which you can check by e.g. pinging the host winshared from your Ubuntu host) or smbfs module is not loaded.

You might have to install smbfs first with apt-get -y install smbfs and then insert the module with modprobe smbfs, but after that you should be good to go with mount -t smbs.

What you're looking for is mount -t smbfs -o username=<your_username>,password=<your_password> //server/share /mountpoint.

answered Nov 6 '13 at 12:52

Sami LaineSami Laine


98555 silver badges1111 bronze badges

I'm using a BeagleBone Black running Debian 4.9 and, due to it's limited storage capacity, I needed to mount a remote folder hosted on a Windows 10 desktop. (I know this is probably not the
best from a system design standpoint, but business needs often leave little room for that.) So, having to improvise, a mounted remote folder is what I came up with.

After running into many, many problems attempting to mount a Windows 10 shared folder, here's my solution, so that others can hopefully benefit from my experience.

Windows 10 "Remote" Host

1. Enable SMB1.0/CIFS File Sharing Support in Windows Features (details).


2. Start the Windows NetLogon service.
3. Enable Sharing on the folder you want to share.

Debian Linux Client

1. Install support packages: smbclient and cif-utils:


sudo apt-get install smbclient
sudo apt-get install cifs-utils

2. Create target directory to mount remote share:


sudo mkdir -p /mnt/my_mount_dir

3. Mount remote folder:


sudo mount -t cifs -o "domain=MYDOMAIN,username=MyUserName,password=myPas$werd,sec=ntlm" //(your windows host ip)/(your remote share name) /mnt/my_mount_dir

UPDATE: After updating my local install of Debian to version 6.3, my mount command broke requiring me to add the vers option to specify SMB1:
sudo mount -t cifs -o "domain=MYDOMAIN,username=MyUserName,password=myPas$werd,sec=ntlm,vers=1.0" //(your windows host ip)/(your remote share name) /mnt/my_mount_dir

answered Feb 12 at 20:19

Check that winbind is installed; then, in your /etc/nsswitch.conf file, there must be wins listed in the hosts line.

Something like:
hosts: files wins dns

There may be other modules listed, depending on what packages are installed on your system.

answered Mar 10 '14 at 5:06

JulianoJuliano

2,0331515 silver badges2020 bronze badges

Not the answer you're looking for? Browse other questions tagged linux mount windows samba or ask your
own question.

You might also like