If you still haven't installed any linux distro, check out this other guide. You will need that password anytime you need to sudo. Once WSL is launched, you will be prompted for a username and password. You will need to restart your machine to finish installation, after which installation will resume. If you have no prior WSL installation, run wsl -install. Then, open up a CommandPrompt (or PowerShell) and run the following commands. Unsurprisingly, following the Microsoft Documentation on Running GUI apps in the Windows Subsystem for Linux did the trick.įirst step is to install a GUI driver according to your GPU: I struggled with this same issue and couldn't get it working with any of the fixes here. GNU Image Manipulation Program version 2.10.30 $ thunderbird -versionĮven something heavy like GIMP runs fine. It started even back when the variable was set to the wrong IP.īut, now, with no DISPLAY variable manually set, firefox works great! $ firefox-esrīasically, thunderbird never cared what DISPLAY was set to. When testing both thunderbird and mousepad start fine.īut if I tried to start firefox/firefox-esr I got failed access to DISPLAY. Then I had set the DISPLAY variable in ~/.bashrc like this. # This is to always have a named host address for servers on WSL, like sshdĪnd the same in Windows c:\Windows\System32\drivers\etc\hosts Instead I have a static value for IPv6 localhost in /etc/hosts. I, and many with me, use non-default name servers, so I can't use that trick to refer to my local system. Prior to reading the official documentation, linked in MOMO's answer, I had tried all the fancy ways of getting the DISPLAY value automatically set posted by others, and nothing worked. You do no longer need to export the DISPLAY variable! With recent WSL (Windows 10 Build 19044 or Win 11), the system takes care of that. Remove all export DISPLAY settings in your startup files! Note that only xfce is really necessary, although the answer includes more detail on running something more complex like Gnome Desktop. See my steps for doing so in this Ask Ubuntu answer. You can install xrdp and just access a Linux desktop using Windows Remote Desktop connection. This uses mDNS as I go into detail on in this answer.įinally, if you want to run a Linux desktop under WSL, you might want to consider RDP. I won't repeat the information on how to do so since it's already covered in that answer, although I will say that export DISPLAY=$(hostname).local:0 will typically work, and is more concise. wsl -installĪ legacy alternative is the one that harrymc offers of installing a third-party X server. Once on an up-to-date Windows 10 or Windows 11 system, you can either install WSL from its Microsoft Store page or. If the final four digits of your build number are lower than 2311, make sure your Windows is up-to-date, then find KB5020030 in the Optional Updates. 2311 or higher, which currently means installing KB5020030. Windows 10 users will need to be on a build ending in. Prior to 1.0.0, this feature was limited to Windows 11 users. With the release of WSL 1.0.0 (WSL via Microsoft Store application), both Windows 10 and Windows 11 users have full access to WSLg, which allows Linux GUI applications (X or Wayland) to run directly on WSL2 with no additional configuration. Adding an answer with more recent information than was available at the time the question was originally asked, primarily because I'm linking to this question/answer for other duplicates (here and on Stack Overflow, where it's general an off-topic question).
0 Comments
Leave a Reply. |