Score:1

Error: no DISPLAY environment variable specified on WSL

in flag
a e

Good morning

I run Ubuntu using the Windows Subsystem for Linux on a Win11 equipped laptop, I've recently tried to install firefox and open it through the CLI but, whenever i give the firefox command followed by anything, it just says

Error: no DISPLAY variable specified

I tried following this guide but it now just says:

Unable to init server: Could not connect: Connection refused
Error: cannot open display: :0.0

Any help would be appreciated.

Esther avatar
es flag
Are you using wsl1, wsl2 or wslg? If wsl1 or 2, you need to install an x server on Windows and configure it, then point your DISPLAY variable to it. Otherwise, install wslg. See https://github.com/microsoft/wslg
NotTheDr01ds avatar
vn flag
Definitely start by reverting the change you made based on the [older answer](https://askubuntu.com/questions/1231026/automatically-setting-the-display-variable). That question was specifically from someone who already had Ximg installed, which it doesn't sound like you do. And that shouldn't be needed any longer, at least not under Windows 11. Can you run the following command in PowerShell and [Edit](https://askubuntu.com/posts/1468936/edit) your question to include the results: `Get-ComputerInfo | Select-Object OsName, OsVersion, WindowsUBR` - Thanks!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.