{"id":9922,"date":"2025-03-21T03:00:00","date_gmt":"2025-03-21T07:00:00","guid":{"rendered":"https:\/\/www.both.org\/?p=9922"},"modified":"2025-03-08T13:06:23","modified_gmt":"2025-03-08T18:06:23","slug":"connect-to-a-windows-drive-from-linux","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=9922","title":{"rendered":"Connect to a Windows drive from Linux"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"9922\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><\/div>\n<p>I run Linux all the time, including at home and in my \u201cday job.\u201d This isn\u2019t really the challenge it used to be, from days long ago. In a previous era, many organizations relied on Microsoft\u2019s 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 <em>when the browser is the interface, what runs on your desktop doesn\u2019t matter<\/em>.<\/p>\n\n\n\n<p>But at my \u201cday job,\u201d 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\u2019s how we did it:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"before-you-start\">Before you start<\/h2>\n\n\n\n<p>To connect to a Windows fileshare from \u201cuserspace,\u201d your Linux system needs to have the <code>gvfs-smb<\/code> package. This provides Windows fileshare support when using <code>gvfs<\/code>. You can check if you have this package installed by typing this at the command line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ dnf list --installed | grep gvfs<\/code><\/pre>\n\n\n\n<p>The <strong>dnf<\/strong> command is the package manager on Fedora Linux, and the <code>list<\/code> subcommand asks dnf to provide a <em>list<\/em> of packages; the <code>--installed<\/code> option says to list only the packages that are <em>already installed<\/em> on the system.<\/p>\n\n\n\n<p>You should see a list of all <code>gvfs<\/code> packages installed on your Linux computer. You should see <code>gvfs-smb<\/code> in that list; if it\u2019s not shown, you\u2019ll need to install it. For example, you can install the <code>gvfs-smb<\/code> package by typing this on the command line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo dnf install gvfs-smb<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"gather-the-information\">Gather the information<\/h2>\n\n\n\n<p>To make a connection to a Windows fileshare, you\u2019ll need to have your Windows connection information at hand. This includes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Your username, which we needed to enter as an email address like <code>username@example.com<\/code><\/li>\n\n\n\n<li>Your password<\/li>\n\n\n\n<li>The domain for the AD organization, probably the same domain as the username, like <code>example.com<\/code><\/li>\n\n\n\n<li>The server to connect to<\/li>\n\n\n\n<li>The path to the fileshare<\/li>\n<\/ul>\n\n\n\n<p>Ask your Windows administrator for the exact path you should use. Note that Linux uses the \u201cforward slash\u201d for paths, but Windows uses the \u201cbackward slash\u201d instead. If your Windows fileshare is something like <code>\\org\\dept\\home\\username<\/code> then you\u2019d write that on Linux like <code>\/org\/dept\/home\/username<\/code> with the \u201cforward slashes.\u201d<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"make-the-connection\">Make the connection<\/h2>\n\n\n\n<p>While you can connect to a Windows fileshare from the command line and \u201cmount\u201d the Windows drive to a Linux path, it\u2019s easiest to make the connection from \u201cuserspace\u201d using the file manager. My Linux laptop runs Xfce, and the file manager is Thunar, but the process is the same if you\u2019re using GNOME or KDE; just open your regular file manager and start there.<\/p>\n\n\n\n<p>To make a new network connection in Thunar, use <strong>Go &gt; Open Location<\/strong> in the menu:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"377\" height=\"378\" src=\"https:\/\/www.both.org\/wp-content\/uploads\/2025\/03\/smblinux1.png\" alt=\"Using 'open location' in Thunar file manager\" class=\"wp-image-9923\" style=\"width:377px;height:auto\"\/><figcaption class=\"wp-element-caption\">Opening a location<\/figcaption><\/figure>\n\n\n\n<p>In Thunar, this menu action actually puts your \u201ccursor\u201d into the \u201caddress\u201d 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.<\/p>\n\n\n\n<p>Type the server name and the path you want to connect to. This also needs a \u201cprotocol\u201d at the beginning of the path, to tell the file manager <em>how to connect<\/em> 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 <code>smb<\/code> protocol, like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>smb:\/\/files.example.com\/org\/dept\/home\/username<\/code><\/pre>\n\n\n\n<p>This sample assumes the file server is <code>files.example.com<\/code> and the path you want to access is stored at <code>\/org\/dept\/home\/username<\/code>, such as for a user\u2019s home directory.<\/p>\n\n\n\n<p>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\u2019ve blurred the details for my organization)<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"486\" src=\"https:\/\/www.both.org\/wp-content\/uploads\/2025\/03\/smblinux2.png\" alt=\"Viewing a remote fileshare in Thunar file manager\" class=\"wp-image-9924\"\/><figcaption class=\"wp-element-caption\">Viewing the remote fileshare<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"to-make-it-permanent\">To make it permanent<\/h2>\n\n\n\n<p>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 \u201cbookmark\u201d to it. To create a bookmark using Xfce\u2019s Thunar, use the <strong>Bookmarks &gt; Add Bookmark<\/strong> menu action:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"368\" height=\"85\" src=\"https:\/\/www.both.org\/wp-content\/uploads\/2025\/03\/smblinux3.png\" alt=\"Adding a bookmark in Thunar file manager\" class=\"wp-image-9925\"\/><figcaption class=\"wp-element-caption\">Adding a bookmark<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"to-disconnect\">To disconnect<\/h2>\n\n\n\n<p>When you\u2019re done with the fileshare, you can \u201cunmount\u201d the remote storage using the \u201ceject\u201d icon on the \u201cfolder\u201d icon in the file manager. On Xfce\u2019s Thunar, that\u2019s listed on the left, under \u201cNetwork\u201d:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"179\" height=\"113\" src=\"https:\/\/www.both.org\/wp-content\/uploads\/2025\/03\/smblinux4.png\" alt=\"Thunar file manager showing an 'eject' icon on a remote fileshare\" class=\"wp-image-9926\"\/><figcaption class=\"wp-element-caption\">Click the &#8216;eject&#8217; icon<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s how I connected my Linux system to a Windows AD fileshare.<\/p>\n","protected":false},"author":33,"featured_media":2818,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[407,5],"tags":[91,665],"class_list":["post-9922","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-file-management","category-linux","tag-linux","tag-windows"],"modified_by":"Jim Hall","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/9922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9922"}],"version-history":[{"count":2,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/9922\/revisions"}],"predecessor-version":[{"id":9928,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/9922\/revisions\/9928"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/2818"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}