Fixes misspell in command to identify IP address in WSL#2483
Fixes misspell in command to identify IP address in WSL#2483evgenyvalavin wants to merge 1 commit intoMicrosoftDocs:mainfrom
Conversation
|
Learn Build status updates of commit 55edd19: ✅ Validation status: passed
For more details, please refer to the build report. |
There was a problem hiding this comment.
Pull request overview
Updates the WSL “basic commands” documentation to correct the command shown for identifying the WSL2 distribution IP address.
Changes:
- Replaced the “identify distro IP” command in the Identify IP address section.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## Identify IP address | ||
|
|
||
| - `wsl hostname -I`: Returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address) | ||
| - `hostname -i`: Returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address) |
There was a problem hiding this comment.
hostname -i without a wsl/wsl.exe prefix changes the execution context compared to the rest of this doc (which shows PowerShell wsl commands). Also, hostname -i inside Linux commonly resolves the hostname and can return a loopback/placeholder address (e.g., 127.0.1.1) rather than the WSL2 VM interface IP. The linked networking.md#identify-ip-address section uses wsl.exe ... hostname -i for querying from Windows; if the intent is to run from Windows, update this bullet to include the wsl/wsl.exe prefix (and optionally clarify when to use -i vs -I).
| - `hostname -i`: Returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address) | |
| - `wsl hostname -I`: From PowerShell or Windows Command Prompt, returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address). When run inside your Linux distribution, use `hostname -I`. |
There was a problem hiding this comment.
@copilot check the following line which doesn't have wsl too and it is confusing. what do you suggest?
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - `hostname -i`: Returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address) | ||
| - `ip route show | grep -i default | awk '{ print $3}'`: Returns the IP address of the Windows machine as seen from WSL 2 (the WSL 2 VM) |
There was a problem hiding this comment.
This bullet switches from a Windows wsl ... command to a Linux hostname -i command, which conflicts with the doc’s intro stating that commands are written for PowerShell/CMD (wsl ...). Also, hostname -i commonly resolves the hostname via /etc/hosts and can return a loopback/placeholder (e.g., 127.0.1.1) rather than the WSL2 VM interface address. Consider keeping this in the same execution context as the rest of the page by using wsl/wsl.exe (and clarifying when to use -i vs -I, consistent with WSL/networking.md#identify-ip-address).
| - `hostname -i`: Returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address) | |
| - `ip route show | grep -i default | awk '{ print $3}'`: Returns the IP address of the Windows machine as seen from WSL 2 (the WSL 2 VM) | |
| - `wsl hostname -I`: Returns the IP address of your Linux distribution installed via WSL 2 (the WSL 2 VM address) | |
| - `wsl sh -c "ip route show | grep -i default | awk '{ print \$3}'"`: Returns the IP address of the Windows machine as seen from WSL 2 (the WSL 2 VM) |
-Iparameter which does not exist and should be-i.wslto get rid of confusion. Because the following command in the section doesn't havewsl.