Skip to content

Fix command for obtaining VM IP address as seen from Windows host #2174

@davpaez

Description

@davpaez

Type of issue

Code doesn't work

Feedback

The following article has an error when trying to identify the IP address of the VM as seen from Windows host:
https://learn.microsoft.com/en-us/windows/wsl/networking?source=recommendations#identify-ip-address

The appropriate command to show the VM's IP address as seen by the Windows host should be:
wsl -d <DistributionName> hostname -I.

Notice that the correct option is hostname -I instead of hostname -i

Also, the paragraphs below that command also incorrectly reference the use hostname -i and hostname --ip-addresses instead of the correct hostname -I and equivalent hostname --all-ip-addresses

Fortunately, the documentation does NOT repeat the error in the next section called Accessing a WSL 2 distribution from your local area network (LAN). Instead, there is helpful note clarifying exactly the distinction I'm refering to.

Page URL

https://learn.microsoft.com/en-us/windows/wsl/networking?source=recommendations#default-networking-mode-nat

Content source URL

https://github.com/MicrosoftDocs/wsl/blob/main/WSL/networking.md

Author

@mattwojo

Document Id

f9e21bfa-6316-7d45-3b34-834a78bcaf0f

Platform Id

f3658d3a-3068-2c5d-3513-2318700a303d

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions