From 29f44b96d8aa1a18df8409314fd934edcda8137e Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Wed, 29 May 2024 14:49:25 -0700 Subject: [PATCH] Update WSL home dir snippet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous recommendation was to expose the Windows home directory under the WSL directory. I thought this would be a practical approach to the difference in home directories, but I'm not a WSL user so I can't verify that idea. Installing `wslu` is also a bit more complicated nowadays.¹ Instead of a hard recommendation, simply describe the difference in home directories and let the user decide what to do. ¹ --- src/snippets/wsl-home-dir.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/snippets/wsl-home-dir.rst b/src/snippets/wsl-home-dir.rst index 8150e4af..971145b4 100644 --- a/src/snippets/wsl-home-dir.rst +++ b/src/snippets/wsl-home-dir.rst @@ -1,12 +1,14 @@ .. admonition:: For Windows (WSL) installs :class: hint - By default, your Windows home directory will not be directly accessible under your WSL home directory. When run in a WSL prompt, the following command fixes that by creating a symlink to it in your WSL home directory. This allows you to use Windows-based text editors and Linux commands all on the same files. + You will have two home directories: one for Windows and one for WSL. You can run commands and edit files in either directory, but note the difference in paths when working on Windows vs. WSL. - .. code-block:: bash + 1. Windows home directory - ln -ws "$(wslpath "$(wslvar USERPROFILE)")" ~/windows_home + - Windows path: ``C:\Users\\`` + - WSL path: ``/mnt/c/Users//`` - Optionally, you can customize the ``windows_home`` folder name or only link to a specific directory under your windows user (e.g. ``ln -ws "$(wslpath "$(wslvar USERPROFILE)")/Documents" ~/windows_documents``). + 2. WSL home directory - If the command does not work, you may have to first run ``sudo apt install wslu``. + - Windows path: ``\\wsl$\Ubuntu\home\\`` + - WSL path: ``/home//`` or ``~``