Skip to content

Commit

Permalink
Issue resolutions (#1779)
Browse files Browse the repository at this point in the history
* Add drvfs mount method

As suggested in #1760

* Add note about WSL 2 version requirement

Resolves #1757

* Add explainer for kernel install step

Resolves #1758

* add update command to kernel explainer

* Fix Git Credential Manager version commands

* Add issue link

Based on request in #1729

* Add note about second distro requirement

Resolves #1775 and #1769

* Typo

* FabricBot: Onboarding to GitOps.ResourceManagement because of FabricBot decommissioning (#1783)

* Add prIssueManagement.yml to onboard repo to GitOps.ResourceManagement as FabricBot replacement

Owners of the FabricBot configuration should have received email notification. The same information contained in the email is published internally at: https://aka.ms/gim/fabricbot. Details on the replacement service and the syntax of the new yaml configuration file is available publicly at: https://microsoft.github.io/GitOps/policies/resource-management.html

Please review and merge this PR to complete the process of onboarding to the new service.

* Deleting fabricbot.json

---------

Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>

* about.md: fix little typos. (#1786)

* More issue updates

---------

Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>
Co-authored-by: Ferhat Geçdoğan <54369961+ferhatgec@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 18, 2023
1 parent 9b9318e commit 1bad550
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 19 deletions.
6 changes: 3 additions & 3 deletions WSL/basic-commands.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Basic commands for WSL
description: Reference for the basic commands included with Windows Subsystem for Linux (WSL).
ms.date: 11/16/2022
ms.date: 06/21/2023
ms.topic: article
---

Expand Down Expand Up @@ -54,15 +54,15 @@ See a list of the Linux distributions installed on your Windows machine, includi
wsl --set-version <distribution name> <versionNumber>
```

To designate the version of WSL (1 or 2) that a Linux distribution is running on, replace `<distribution name>` with the name of the distribution and replace `<versionNumber>` with 1 or 2. [Comparing WSL 1 and WSL 2](./compare-versions.md).
To designate the version of WSL (1 or 2) that a Linux distribution is running on, replace `<distribution name>` with the name of the distribution and replace `<versionNumber>` with 1 or 2. [Comparing WSL 1 and WSL 2](./compare-versions.md). WSL 2 is only available in Windows 11 or Windows 10, Version 1903, Build 18362 or later.

## Set default WSL version

```powershell
wsl --set-default-version <Version>
```

To set a default version of WSL 1 or WSL 2, replacing `<Version>` with either the number 1 or 2 to represent which version of WSL you would like the installation to default on for new Linux distribution installations. For example, `wsl --set-default-version 2`. [Comparing WSL 1 and WSL 2](./compare-versions.md).
To set a default version of WSL 1 or WSL 2, replacing `<Version>` with either the number 1 or 2 to represent which version of WSL you would like the installation to default on for new Linux distribution installations. For example, `wsl --set-default-version 2`. [Comparing WSL 1 and WSL 2](./compare-versions.md). WSL 2 is only available in Windows 11 or Windows 10, Version 1903, Build 18362 or later.

## Set default Linux distribution

Expand Down
3 changes: 3 additions & 0 deletions WSL/disk-space.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ To repair a disk mount error in WSL, and restore it back to a usable / writeable
wsl.exe sudo e2fsck -f /dev/<device>
```
> [!NOTE]
> If you only have a single Linux distribution installed, you may encounter a "ext file in use" error and will need to [install](./basic-commands.md#install) an additional distribution in order to run `wsl.exe lsblk`. You can [uninstall](./basic-commands.md#unregister-or-uninstall-a-linux-distribution) the distribution once the repair is complete.
4. Once the repair is complete, unmount the disk in PowerShell by entering:
```powershell
Expand Down
2 changes: 2 additions & 0 deletions WSL/install-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /nores

## Step 4 - Download the Linux kernel update package

The Linux kernel update package installs the most recent version of the [WSL 2 Linux kernel](https://github.com/microsoft/WSL2-Linux-Kernel) for running WSL inside the Windows operating system image. (To run [WSL from the Microsoft Store](/windows/wsl/compare-versions#wsl-in-the-microsoft-store), with more frequently pushed updates, use `wsl.exe --install` or `wsl.exe --update`.).

1. Download the latest package:
- [WSL2 Linux kernel update package for x64 machines](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi)

Expand Down
12 changes: 11 additions & 1 deletion WSL/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,22 @@ When using a WSL 1 distribution, if your computer was set up to be accessed by y

This isn't the default case in WSL 2. WSL 2 has a virtualized ethernet adapter with its own unique IP address. Currently, to enable this workflow you will need to go through the same steps as you would for a regular virtual machine. (We are looking into ways to improve this experience.)

Here's an example Windows command to add a port proxy that listens on port 4000 on the host and connects it to port 4000 to the WSL 2 VM with IP address 192.168.101.100.
Here's an example of using the [Netsh interface portproxy](/windows-server/networking/technologies/netsh/netsh-interface-portproxy) Windows command to:

- Add a port proxy that listens on port 4000 on the host.
- Connect that port proxy to the WSL 2 VM with IP address 192.168.101.100.

```powershell
netsh interface portproxy add v4tov4 listenport=4000 listenaddress=0.0.0.0 connectport=4000 connectaddress=192.168.101.100
```

To obtain the IP address, use:

- `wsl hostname -i` for the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address)
- `cat /etc/resolv.conf` for the IP address of the Windows machine as seen from WSL 2 (the WSL 2 VM)

Using `listenaddress=0.0.0.0` will listen on all [IPv4 ports](https://stackoverflow.com/questions/9987409/want-to-know-what-is-ipv4-and-ipv6#:~:text=The%20basic%20difference%20is%20the,whereas%20IPv6%20has%20128%20bits.).

## IPv6 access

WSL 2 distributions currently cannot reach IPv6-only addresses. We are working on adding this feature.
4 changes: 3 additions & 1 deletion WSL/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Troubleshooting Windows Subsystem for Linux
description: Provides detailed information about common errors and issues people run into while running Linux on the Windows Subsystem for Linux.
ms.date: 09/27/2021
ms.date: 07/17/2023
ms.topic: article
---

Expand Down Expand Up @@ -192,6 +192,8 @@ Please enable the Virtual Machine Platform Windows feature and ensure virtualiza
6. Additionally, if you have 3rd party hypervisors installed (Such as VMware or VirtualBox) then please ensure you have these on the latest versions which can support HyperV ([VMware 15.5.5+](https://blogs.vmware.com/workstation/2020/05/vmware-workstation-now-supports-hyper-v-mode.html) and [VirtualBox 6+](https://www.virtualbox.org/wiki/Changelog-6.0)) or are turned off.
7. If you are receiving this error on an Azure Virtual Machine, check to ensure that [Trusted Launch](/azure/virtual-machines/trusted-launch) is disabled. [Nested Virtualization is not supported on Azure virtual machines](/azure/virtual-machines/trusted-launch#unsupported-features).
Learn more about how to [Configure Nested Virtualization](/virtualization/hyper-v-on-windows/user-guide/nested-virtualization#configure-nested-virtualization) when running Hyper-V in a Virtual Machine.
### WSL has no network connection on my work machine or in an Enterprise environment
Expand Down
5 changes: 4 additions & 1 deletion WSL/tutorials/gui-apps.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Run Linux GUI apps with WSL
description: Learn how WSL support running Linux GUI apps.
ms.date: 11/28/2022
ms.date: 07/17/2023
ms.topic: article
---

Expand Down Expand Up @@ -92,6 +92,9 @@ sudo apt install gnome-text-editor -y

To launch your bashrc file in the editor, enter: `gnome-text-editor ~/.bashrc`

> [!NOTE]
> [GNOME Text Editor](https://en.wikipedia.org/wiki/GNOME_Text_Editor) replaces gedit as GNOME/Ubuntu's default text editor in Ubuntu 22.10. If you're running an older version of Ubuntu and want to use [gedit](https://en.wikipedia.org/wiki/Gedit), the previous default text editor, use `sudo apt install gedit -y`.
### Install GIMP

GIMP is a free and open-source raster graphics editor used for image manipulation and image editing, free-form drawing, transcoding between different image file formats, and more specialized tasks.
Expand Down
15 changes: 9 additions & 6 deletions WSL/tutorials/wsl-git.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Get started using Git on WSL
description: Learn how to set up Git for version control on the Windows Subsystem for Linux, along with Git Credential Manager.
ms.date: 03/03/2022
ms.date: 06/21/2023
ms.topic: article
---

Expand Down Expand Up @@ -78,18 +78,21 @@ If you have a reason not to install Git for Windows, you can install GCM as a Li
To set up GCM for use with a WSL distribution, open your distribution and enter this command:

If GIT installed is >= v2.39.0
```Bash

```bash
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe"
```

else if GIT installed is >= v2.36.1
```Bash
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager-core.exe"

```bash
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-manager.exe"
```

else if version is < v2.36.1 enter this command:
```Bash
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-manager.exe"

```bash
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager-core.exe"
```

> [!NOTE]
Expand Down
4 changes: 2 additions & 2 deletions WSL/wsl-config.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Advanced settings configuration in WSL
description: A guide to the wsl.conf and .wslconfig files used for configuring settings when running multiple Linux distributions on Windows Subsystem for Linux.
ms.date: 12/02/2021
ms.date: 07/17/2023
ms.topic: article
ms.custom: seo-windows-dev
adobe-target: true
Expand Down Expand Up @@ -47,7 +47,7 @@ WSL will detect the existence of these files, read the contents, and automatical

You must wait until the subsystem running your Linux distribution completely stops running and restarts for configuration setting updates to appear. This typically takes about 8 seconds after closing ALL instances of the distribution shell.

If you launch a distribution (ie. Ubuntu), modify the configuration file, close the distribution, and then re-launch it. You might assume that your configuration changes have immediately gone into effect. This is not currently the case as the subsystem could still be running. You must wait for the subsystem to stop before relaunching in order to give enough time for your changes to be picked up. You can check to see whether your Linux distribution (shell) is still running after closing it by using PowerShell with the command: `wsl --list --running`. If no distributions are running, you will receive the response: "There are no running distributions." You can now restart the distribution to see your configuration updates applied.
If you launch a distribution (e.g. Ubuntu), modify the configuration file, close the distribution, and then re-launch it, you might assume that your configuration changes have immediately gone into effect. This is not currently the case as the subsystem could still be running. You must wait for the subsystem to stop before relaunching in order to give enough time for your changes to be picked up. You can check to see whether your Linux distribution (shell) is still running after closing it by using PowerShell with the command: `wsl --list --running`. If no distributions are running, you will receive the response: "There are no running distributions." You can now restart the distribution to see your configuration updates applied.

The command `wsl --shutdown` is a fast path to restarting WSL 2 distributions, but it will shut down all running distributions, so use wisely.

Expand Down
24 changes: 19 additions & 5 deletions WSL/wsl2-mount-disk.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
---
title: Get started mounting a Linux disk in WSL 2
description: Learn how to set up a disk mount in WSL 2 and how to access it.
ms.date: 03/04/2022
ms.date: 07/17/2023
ms.topic: article
---

# Mount a Linux disk in WSL 2

If you want to access a Linux disk format that isn't supported by Windows, you can use WSL 2 to mount your disk and access its content. This tutorial will cover the steps to identify the disk and partition to attach to WSL2, how to mount them, and how to access them.

If you are looking for guidance on how to connect a USB device (flash drive, SD card reader, etc), see [Connect USB devices](./connect-usb.md).
If you are connecting an external drive and do not have success with these mounting instructions, you may want to try the instructions to [Connect USB devices](./connect-usb.md). The `wsl --mount` command does not currently support USB/flash drives/SD card readers, ([learn more about this issue](https://github.com/microsoft/WSL/issues/6011)).

> [!NOTE]
> Administrator access is required to attach a disk to WSL 2.
> The WSL 2 `mount` command does not support mounting a disk (or partitions that belong to the disk) that is currently in use. `wsl --mount` always attaches the entire disk even if only a partition is requested. You can't mount the Windows installation disk.
## Prerequisites

You will need to be on Windows 11 Build 22000 or later, or be running the Microsoft Store version of WSL. You can join the [Windows Insiders Program](https://insider.windows.com/) to get the latest preview builds.
You will need to be on Windows 11 Build 22000 or later, or be running the Microsoft Store version of WSL. To check your WSL and Windows version, use the command: `wsl.exe --version`

## Differences between mounting an external drive with Windows formatting versus Linux formatting

External drives formatted for Windows typically use the NTFS file system formatting. External drives formatted for Linux typically use the Ext4 file system formatting.

If you have mounted a NTFS-formatted drive on your Windows file system, you can access that drive from your Linux distribution using WSL by creating a mounted directory (`sudo mkdir /mnt/d`, replacing 'd' with whatever drive letter you'd like to use) and then using the `drfs` file system interop plugin, with the command:

```bash
sudo mount -t drvfs D: /mnt/d
```

[Learn more about mounting scenarios](https://superuser.com/questions/1734353/is-there-a-way-to-mount-an-external-drive-when-it-becomes-available-in-wsl).

If you have a Ext4-formatted drive, you cannot mount it on your Windows file system. In order to mount an Ext4-formatted drive on your Linux distribution with WSL, you can use the `wsl --mount` command following the instructions below.

## Mounting an unpartitioned disk

In this simplest case, if you have a disk that doesn't have any partitions, you can mount it directly using the `wsl --mount` command. First you need to identify the disk.
If you have a disk that doesn't have any partitions, you can mount it directly using the `wsl --mount` command. First you need to identify the disk.

1. **Identify the disk** - To list the available disks in Windows, run:

Expand Down Expand Up @@ -223,4 +237,4 @@ If `Diskpath` is omitted, all attached disks are unmounted and detached.

- Only filesystems that are natively supported in the kernel can be mounted by `wsl --mount`. This means that it's not possible to use installed filesystem drivers (such as ntfs-3g for example) by calling `wsl --mount`.

- Filesystems not directly supported by the kernel can be mounted via a `--bare` attach and then invoking the relevant FUSE driver.
- Filesystems not directly supported by the kernel can be mounted via a `--bare` attach and then invoking the relevant FUSE driver.

0 comments on commit 1bad550

Please sign in to comment.