-3

I just started experimenting with Linux, and wsl2 seems like a great option to do so, and still keep Windows 10.

I know for sure I can install programs (since I decided to test it with the Minecraft Linux launcher, and got no errors) But how can I display the window inside Windows?

So far I have received this error:

Gtk-WARNING **: 15:16:44.531: cannot open display:

I suppose that means that Windows currently "owns" the displays, and Linux would have to make some remote connection, in order to make it work.

I've found some instructions online (even on superuser), but I'm currently too big of a Linux noob to make it function.

Dave M
  • 13,138
  • 25
  • 36
  • 47
Lynet _101
  • 37
  • 7
  • 1
    Just a friendly, neighborhood reminder to please search for existing related questions before posting a new one. This has been asked *many* times, in many different ways. A simple search for WSL GUI would have turned up a number of questions, including [this](https://superuser.com/questions/1075659/open-ubuntu-bashs-gui-applications-on-windows-10) and [this](https://superuser.com/questions/1554733/run-gui-based-apps-with-windows-subsystem-for-linux-wsl-2). And that's just on Super User. – NotTheDr01ds Mar 29 '21 at 15:16
  • If you plan to run Linux GUI programs on Windows 10 then WSL2 isn't a good option, instead use Cygwin, it compiles Windows executables from Linux source codes, thus gives you complete Linux-like environment with GUI capabilities, but it is still only an emulation layer though and not real Linux, if you want to run real Linux on Windows 10 you should use virtual machines, VirtualBox and VMWare Workstation Player are two of the best programs. – Ξένη Γήινος Mar 30 '21 at 04:03
  • You should be able to [install](https://c-nergy.be/blog/?p=14888) `xrdp` and use RDP on Windows to connect to it – JW0914 Apr 07 '21 at 13:23

1 Answers1

1

WSL2 comes with no gui installed, so it doesn't know how to create an output or display anything but the shell. What you need to do is install a desktop environment for Ubuntu and then connect to it via VcXsrv. Follow this tutorial.

https://medium.com/@japheth.yates/the-complete-wsl2-gui-setup-2582828f4577

Wouldn't advise trying to play games on wsl2 (you wont have a gpu)

MrCake
  • 21
  • 3