{"id":5287,"date":"2026-08-30T13:40:33","date_gmt":"2026-08-30T04:40:33","guid":{"rendered":"https:\/\/donguri3.net\/server-tech\/wsl-windows-directory-bind-mount-2\/"},"modified":"2026-08-30T13:40:34","modified_gmt":"2026-08-30T04:40:34","slug":"wsl-windows-directory-bind-mount","status":"publish","type":"post","link":"https:\/\/donguri3.net\/en\/server-tech\/virtualization-container-wsl\/wsl-windows-directory-bind-mount\/","title":{"rendered":"Handling Directories on Windows Safely and Quickly in WSL Using &#8220;mount &#8211;bind&#8221;"},"content":{"rendered":"<p>When developing with WSL, you often find yourself needing to manipulate files on the Windows side.<br \/>\nIn WSL, the Windows filesystem is automatically mounted in the form of \/mnt\/c\/&#8230;, and you can access files by following that path.<\/p>\n<p>However, in actual development work, typing out long paths like \/mnt\/c\/&#8230; every time is tedious, and<br \/>\nit is a natural request to want to treat a project directory as if it were located directly under the WSL home directory.<\/p>\n<p>Consequently, many people first choose to use symbolic links.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">ln -s \/mnt\/c\/Users\/xxx\/project ~\/project<\/pre>\n<p>This allows you to treat the project directory as if it existed within WSL visually, so it seems convenient at first glance.<\/p>\n<h2>Limitations of Symbolic Links Due to Being Treated as a &#8220;Separate Device&#8221;<\/h2>\n<p>\/mnt\/c on WSL is an area where Windows NTFS is mounted using a special method. Therefore, it is treated as a separate device from the WSL-side filesystems like ext4.<\/p>\n<p>As a result, using symbolic links creates the following limitations:<\/p>\n<ul>\n<li>Behaviors may differ from native Linux file operations<\/li>\n<li>Some tools are not designed for operations across separate devices, leading to unstable behavior<\/li>\n<li>Performance tends to degrade<\/li>\n<li>Permission judgments differ between operating systems, which can cause unexpected errors<\/li>\n<\/ul>\n<p>In practice, while symbolic links are usable,<br \/>\nthey are not necessarily optimal for use cases that cross the boundary between WSL and Windows.<\/p>\n<h2>Treat It Like a &#8220;Real Directory&#8221; Using mount &#8211;bind<\/h2>\n<p>Therefore, the method we recommend is mounting using mount &#8211;bind.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo mkdir -p \/winproj\nsudo mount --bind \/mnt\/c\/Users\/xxx\/project \/winproj<\/pre>\n<p>Executing this command allows you to treat the directory on Windows as if it exists directly under \/winproj.<\/p>\n<p>Benefits of Bind Mount<\/p>\n<ul>\n<li>Eliminates the separate device treatment, resulting in behavior closer to native Linux<\/li>\n<li>Performance is more stable and faster than symlinks<\/li>\n<li>High file operation compatibility, allowing tools to work smoothly<\/li>\n<li>Unlike symbolic links, &#8220;broken links&#8221; do not occur<\/li>\n<li>Can be handled with short paths without needing to be conscious of Windows paths<\/li>\n<\/ul>\n<p>Once you actually use it, the integration between WSL and Windows becomes extremely comfortable.<\/p>\n<h2>How to Release (Unmount) mount &#8211;bind<\/h2>\n<p>To release a bind mount, use umount just like with a normal filesystem.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo umount \/winproj<\/pre>\n<p>If you get a &#8220;device is busy&#8221; error and cannot umount, it means there are terminals or processes opening the target directory. Close them and try running it again.<\/p>\n<p>If necessary, there are also ways to force an unmount.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo umount -l \/winproj # lazy unmount\nsudo umount -f \/winproj # forced unmount<\/pre>\n<p>Normally, umount \/winproj alone will release it without any issues.<\/p>\n<h2>The WSL \u00d7 Windows Development Environment Becomes Comfortable with Bind Mount<\/h2>\n<p>When developing while moving back and forth between WSL and Windows, you increasingly care about path handling and tool behavior.<br \/>\nIn such environments, using mount &#8211;bind instead of symbolic links greatly improves path consistency and usability.<\/p>\n<p>When I myself operated using symbolic links, there were minor inconveniences, but after switching to bind mount, stress decreased, and file operations on WSL began to feel much more natural.<\/p>\n<h2>Conclusion<\/h2>\n<p>When handling directories on Windows from WSL,<br \/>\nsymbolic links are easy, but limitations and performance degradation due to being treated as a separate device can be a concern.<\/p>\n<p>On the other hand, using mount &#8211;bind provides many advantages such as:<\/p>\n<ul>\n<li>Stable behavior<\/li>\n<li>High compatibility<\/li>\n<li>Smooth file operations<\/li>\n<li>Simple path specification<\/li>\n<\/ul>\n<p>In development environments that combine WSL and Windows,<br \/>\nbuilding your setup with bind mount as a prerequisite allows you to work much more comfortably.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When developing with WSL, you often find yourself needing to manipulate files on the Windows side. In WSL, the [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":2489,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/donguri3.net\/?p=2487","footnotes":""},"categories":[1171],"tags":[105,1005,1000,540,190,104],"class_list":["post-5287","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-virtualization-container-wsl","tag-linux","tag-windows","tag-wsl","tag-540","tag-190","tag-104","en-US"],"_links":{"self":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/comments?post=5287"}],"version-history":[{"count":1,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5287\/revisions"}],"predecessor-version":[{"id":5290,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5287\/revisions\/5290"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media\/2489"}],"wp:attachment":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media?parent=5287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/categories?post=5287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/tags?post=5287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}