Objective

Customize the default identity displayed by Ubuntu WSL.

By default, commands such as:

whoami

and:

hostnamectl

may display names associated with the original WSL/Windows setup.

This guide explains how to change the Linux username and hostname safely.


1. Check the Current Values

Check the current Linux username:

whoami

Example:

chukwuemeka-peter-eze

Check the current hostname:

hostname

Example:

DESKTOP-2EB2GUA

You can also inspect the hostname configuration:

hostnamectl