Search Tools Links Login

Mounting a Windows Share on Ubuntu

Hey there tech enthusiast!

You're probably here because you're venturing into the wondrous world of Ubuntu and want to connect it to your Windows shared drive. Now, that might seem a bit daunting at first, but worry not! I'm here to guide you step by step in a conversational manner, because let's face it, nobody likes jargon-packed, sleep-inducing tutorials.

Let's jump right into it!

Installing the Required Software

The magic behind sharing files between your Windows machine and Ubuntu is a protocol called SMB (Server Message Block). SMB allows for sharing of files and devices over a network. In Ubuntu, we use a software package named "cifs-utils" to interact with SMB.

To install cifs-utils, open up your Terminal. If you've never encountered this term before, it's just an interface where you can interact with your computer's operating system via commands. You can open it by searching for "Terminal" in your system's main menu.

Once you've got the terminal opened up, type in the following command and hit enter:

sudo apt-get install cifs-utils

You'll be asked for your password. Don't fret if you don't see any characters appearing as you type it in - that's a security feature. Hit enter once you're done typing it in.

Creating a Mount Point

Think of a mount point as a 'gateway' to access your shared Windows files from Ubuntu. We create a mount point as a directory (or a folder, in Windows language). Let's create one in your home directory, which we'll call 'winshare'. Again in the Terminal, type:

mkdir ~/winshare

Voila! You've just created a directory called 'winshare' in your home directory.

Mounting the Windows Share

To mount the Windows share to the directory you just created, we'll use the mount command, which will look something like this:

sudo mount -t cifs //WindowsPC/SharedFolder ~/winshare -o username=YourWindowsUsername,password=YourWindowsPassword

In this command, 'WindowsPC' is the hostname or IP address of your Windows machine and 'SharedFolder' is the name of the shared folder you're trying to access. 'YourWindowsUsername' and 'YourWindowsPassword' should be replaced with your actual Windows username and password.

If everything goes well, you'll have your Windows share successfully mounted on Ubuntu! To access it, navigate to the 'winshare' directory, and you should see your shared files.

Automatically Mounting at Boot (Optional)

If you don't want to repeat the mounting process every time you reboot your Ubuntu machine, you can add an entry to your '/etc/fstab' file to mount the share automatically.

Open the file with a text editor. Here we'll use nano:

sudo nano /etc/fstab

And add a line to the end of the file:

//WindowsPC/SharedFolder /home/yourusername/winshare cifs username=YourWindowsUsername,password=YourWindowsPassword 0 0

After you've added the line, save and close the file (in nano, you press Ctrl+X, then Y to confirm saving, and finally press Enter).

That's it! You've now equipped yourself with the knowledge to mount a Windows share on Ubuntu. It may seem a bit tricky at first, but with a little practice, it becomes a breeze. Now, go forth and explore the convenience of sharing files between Windows and Ubuntu.

As always, if you encounter any issues, feel free to leave your questions below. Until next time, happy Ubuntu-ing!

Note: This guide assumes you already have a shared folder on your Windows machine. If you need help setting up a shared folder on Windows, let me know, and I can walk you through that as well.

About this post

Posted: 2023-08-07
By: dwirch
Viewed: 237 times







No attachments for this post

Loading Comments ...


No comments have been added for this post.

You must be logged in to make a comment.