
Connect to a Windows drive from Linux
I run Linux all the time, including at home and in my “day job.” This isn’t really the challenge it used to be, from days long ago. In a previous era, many organizations relied on Microsoft’s Active Directory to manage users and Windows fileshares to provide storage. In this modern era, most organizations have moved to the Cloud, including file storage. And when the browser is the interface, what runs on your desktop doesn’t matter.
But at my “day job,” the organization still uses Active Directory to manage the Windows desktop users, and uses legacy Windows fileshares for some users. Recently, a colleague asked me for help in connecting their Linux system to the Windows fileshare. Here’s how we did it:
Before you start
To connect to a Windows fileshare from “userspace,” your Linux system needs to have the gvfs-smb
package. This provides Windows fileshare support when using gvfs
. You can check if you have this package installed by typing this at the command line:
$ dnf list --installed | grep gvfs
The dnf command is the package manager on Fedora Linux, and the list
subcommand asks dnf to provide a list of packages; the --installed
option says to list only the packages that are already installed on the system.
You should see a list of all gvfs
packages installed on your Linux computer. You should see gvfs-smb
in that list; if it’s not shown, you’ll need to install it. For example, you can install the gvfs-smb
package by typing this on the command line:
$ sudo dnf install gvfs-smb
Gather the information
To make a connection to a Windows fileshare, you’ll need to have your Windows connection information at hand. This includes:
- Your username, which we needed to enter as an email address like
username@example.com
- Your password
- The domain for the AD organization, probably the same domain as the username, like
example.com
- The server to connect to
- The path to the fileshare
Ask your Windows administrator for the exact path you should use. Note that Linux uses the “forward slash” for paths, but Windows uses the “backward slash” instead. If your Windows fileshare is something like \org\dept\home\username
then you’d write that on Linux like /org/dept/home/username
with the “forward slashes.”
Make the connection
While you can connect to a Windows fileshare from the command line and “mount” the Windows drive to a Linux path, it’s easiest to make the connection from “userspace” using the file manager. My Linux laptop runs Xfce, and the file manager is Thunar, but the process is the same if you’re using GNOME or KDE; just open your regular file manager and start there.
To make a new network connection in Thunar, use Go > Open Location in the menu:

In Thunar, this menu action actually puts your “cursor” into the “address” part of the file manager window so you can type a path. On GNOME or KDE, this action will probably bring up a dialog window.
Type the server name and the path you want to connect to. This also needs a “protocol” at the beginning of the path, to tell the file manager how to connect to the network resource. For example, you could also make a similar connection over SSH or some other protocol. To connect to a Windows fileshare, you use the smb
protocol, like this:
smb://files.example.com/org/dept/home/username
This sample assumes the file server is files.example.com
and the path you want to access is stored at /org/dept/home/username
, such as for a user’s home directory.
You should be prompted to enter your username, password, and domain. After entering this into the dialog box, you should see the Windows fileshare: (I’ve blurred the details for my organization)

To make it permanent
If you want to access this network resource at a later time, such as after you reboot your computer, you will need to make a “bookmark” to it. To create a bookmark using Xfce’s Thunar, use the Bookmarks > Add Bookmark menu action:

To disconnect
When you’re done with the fileshare, you can “unmount” the remote storage using the “eject” icon on the “folder” icon in the file manager. On Xfce’s Thunar, that’s listed on the left, under “Network”:
