Kubuntu: How to Map Windows Network Share

My workplace is largely a Windows based institution.  Due to a collaborative project, I was recently asked to access some documents on a Windows Network Drive.  I was sent directions for how to add that drive in Windows.  Those directions were not that helpful as I, of course, run Linux.  As perhaps the only Linux user on my campus, this meant that I had to figure out how to map the Windows Network share to my computer on my own.  No problem.  I got this.

After a little googling, I figured out I needed to do the following:

(1) Install the packages “samba” and “cifs-util.”  You can do this using synaptic or from the command line (sudo apt-get install samba cifs-util).

(Installing the software from synaptic.)
(Installing the software from synaptic.)

(2) Once those packages are installed, it’s a good idea to restart your computer.

(3) Now, create a directory where you want to mount the mapped network drive.  I put the network drive on my desktop just to test this.  I may change that later.

(4) Open a command prompt (e.g., Konsole) and now it’s time to mount the drive to the newly created folder.  Here’s the command:

sudo mount -t cifs -o username=[your.username] //[name.of.network.drive]/[name.of.specific.folder] /home/[your.username]/Desktop/[folder.where.you.want.the.drive.mounted]

networkdrive2

(5) After you hit enter, you’ll be asked for your password for the network drive.  Assuming you didn’t have any typos, you should now have the Windows Network Drive mounted to the folder you created and should have access to all the files inside.

networkdrive3

(6) NOTE: This is a temporary mapping of the Windows Network Share.  Since I only need to access this Windows Network Share Drive occasionally, I don’t want to set up my computer to map it every time I boot it up.  There is a different process for mapping the drive permanently.

(I found the most helpful directions for this here.)

(NOTE: On LinuxMint 18.0, I was unable to get this to work.  Every time I tried to map the drive using the command above I would get the error: “mount error: could not resolve address for [network.drive.name]: Unknown error”.  It turns out, for some reason Linux doesn’t play well with Windows share names.  However, when I swapped out the name of the drive for the IP address, everything worked great.  Try using the IP address instead of the name of the Windows share if you get this error.)

(SECOND NOTE: A way around the above error (kind of) is to associate the Windows share name with the IP address in your /etc/hosts file.  Using a console, type: sudo nano /etc/hosts.  When the file comes up, add the IP address followed by the share name (e.g., 192.168.1.1   [share_name]).  That will associate the IP address with the share name and you’ll then be able to mount the Windows share with the name and not the IP address.)

Leave a Reply

Your email address will not be published.