How to Find Your WSL 2 Profile ID (GUID)
I ended up having a few WSL instances with the same name listed in my Microsoft Terminal config and wanted to find the real one.
While switching over to Arch Linux within WSL 2 I ended up creating and deleting a few WSL instances but they all had the same name.
I ended up with a bunch of duplicate entries in my Microsoft Terminal config
that looked like this, except the guid
was different for each one:
"profiles": {
"list": [
{
"guid": "{a9741877-f895-512d-a385-bb120648fbbe}",
"hidden": false,
"name": "Arch Linux",
"source": "Microsoft.WSL"
}
]
}
What I wanted to do was set the last one I created as my default
profile.
That’s easy enough by setting "defaultProfile": "{a9741877-f895-512d-a385-bb120648fbbe}"
.
But, I wasn’t sure which GUID to use. I am pretty sure the last item in the list aligns with the latest instance you created but if you wanted to know for sure or maybe you’re not sure of the order and you want to pick one from the middle you can find that out.
In your WSL instance you can run:
$ echo $WT_PROFILE_ID
{a9741877-f895-512d-a385-bb120648fbbe}
I ended up finding this by running env
and looking through the list of
environment variables that were defined. It’s a quick way to get your profile
ID.
# Demo Video
Timestamps
- 0:18 – I wanted to find it to configure the Microsoft Terminal
Did you end up using this method to find your profile ID? Let me know below.