windows 11 wsl not opening gui in my ubuntu shell

I am running windows 11 and have updated my ubuntu instalation to wsl2. whenever I try to run something like xclock the it looks like it is running in the command line but no gui opens up. I've tried this with a number of applications and none seem to work.

I've used everything in these guides:

3

1 Answer

I have a hunch on why it's not working, but we'll need some additional troubleshooting to see for sure.

I don't normally recommend "reinstall", but I'm going to offer a slight variation on that here to see if it helps.

Try the following:

  • Exit WSL/Ubuntu
  • From PowerShell or CMD, issue wsl --shutdown
  • From the Microsoft Store, install "Ubuntu 20.04". This will install a second WSL instance (named "Ubuntu20.04") without modifying your existing installation. instance.
  • Start Ubuntu 20.04
  • sudo apt update && sudo apt upgrade
  • Just install a simple app like xterm and see if it launches

If it does, we can try to figure out why your default Ubuntu installation isn't worked and how to prevent it from happening again.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like