1

I'd like to install Lubuntu GUI on my Ubuntu app, that I downloaded from the MS Windows Store app. After installing WSL (Windows Subsystem for Linux) I got a 'server version'-like version running (terminal only).

I tried to install 'lubuntu-desktop', tasksel, and everything seems to install, but it can't start the desktop (probably waiting for a reboot).

sudo service start sddm (which usually boots into GUI), gets me this:

 * Starting Init script for Simple Desktop Display Manager sddm   [ OK ]

startx gets me this:

xauth:  file /root/.Xauthority does not exist

config/udev: failed to bind the udev monitor [config] failed to pre-init udev

X.Org X Server 1.20.8 X Protocol Version 11, Revision 0 Build Operating System: Linux 4.15.0-115-generic x86_64 Ubuntu Current Operating System: Linux LAPTOP-M1HKAT00 4.4.0-19041-Microsoft #488-Microsoft Mon Sep 01 13:43:00 PST 2020 x86_64 Kernel command line: BOOT_IMAGE=/kernel init=/init Build Date: 04 September 2020 01:34:27PM xorg-server 2:1.20.8-2ubuntu2.4 (For technical support please see http://www.ubuntu.com/support) Current version of pixman: 0.38.4 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: "/var/log/Xorg.0.log", Time: Fri Oct 9 05:59:38 2020 (==) Using system config directory "/usr/share/X11/xorg.conf.d" (EE) Fatal server error: (EE) xf86OpenConsole: Switching VT failed (EE) (EE) Please consult the The X.Org Foundation support at http://wiki.x.org

lspci also doesn't work:

    pcilib: Cannot open /proc/bus/pci
    lspci: Cannot find any working access method.

4 Answers4

1

With KVM, or with VNC, or with x410 or whatever other X server you choose, a desktop will ABSOLUTELY work on WSL2. I've done that already.

Thanks for the suggestion @john doe.

This DISPLAY=:0 XDG_SESSION_TYPE=x11 was exactly the thing.

  1. Install x410 (or VcXsrv)
  2. Start up the X server (in windows)
  3. DISPLAY=:0 XDG_SESSION_TYPE=x11 startxfce4

Assuming there are no errors in starting xfce or whatever GUI you've picked, this will definitely work with WSL1 (Windows Build 19043.985)

XFCE Running on WSL1 Ubuntu 20.04 with VcXsrv

  • It appears that WSL is not a full fledged Linux OS or even kernel. It's just a kernel that's made to look like Linux. GUI or other graphics support is not supported. – ProDigit Sep 23 '21 at 21:59
0

Bumped by Community Bot today since there was no accepted answer, but it needed a bit of an updated answer anyway.

There are several things going on that I'll attempt to address:

  • First, you didn't specify the WSL version, but it appears almost certain that you were using WSL1, given the output of the lspci command. If you still have the installation around, you can check it with wsl -l -v. At the time of the question, WSL2 had been released, but you may have not updated to it yet.

    From one of your comments:

    It appears that WSL is not a full fledged Linux OS or even kernel. It's just a kernel that's made to look like Linux. GUI or other graphics support is not supported

    Well, the first part of that is somewhat true, up to the "GUI ... is not supported". WSL1, at least (which is what you were using), is not a real Linux kernel. It is a translation layer that attempts to map Linux syscalls into their closest Windows API equivalent. As such, it does a pretty amazing job, IMHO, but there are certainly things that aren't implemented, like the kernel PCI interfaces. This is why lspci doesn't work on WSL1 -- There's no approximation of that interface, and thus no /proc/bus/pci.

    WSL2, on the other hand, does use a real Linux kernel. You can find the source here and even build and use your own customized version if you so desire, but it's rarely necessary.

  • However, both WSL1 and WSL2 could support GUI apps at the time of your question. As @jritalin's answer correctly noted, one of the common ways to do this was to install an X server in Windows. It's not clear to me why you dismissed that answer with your comment. You didn't appear to even try what was a correct answer to your question. Perhaps you've just moved on from WSL since you didn't get an acceptable answer the first time around. That's too bad, if that's the case.

    There were other methods as well for accessing an Ubuntu desktop under WSL (either 1 or 2). You could also utilized xrdp as I've documented in other answers here on Ask Ubuntu (here's one).

    No, WSL didn't allow direct access to the Windows display, nor most other hardware. This is why your sudo service start sddm and startx didn't work -- Both require a display device, either physical or virtual, that Windows owns in this case.

    Even under WSL2, an lspci will technically work, but it's not going to return any of the physical devices in your system, just as it wouldn't in a VM.

  • From another comment (not yours):

    GNOME does not work in WSL 1 or 2

    Well, that's not quite accurate. It's possible to get Gnome working under WSL2. The problem is that Gnome relies heavily on Systemd, which requires that it run as PID1. This is complicated under WSL, since it needs its own init to bring up quite a few features (as noted in this answer). However, it's possible to get Systemd running in a PID namespace where it can be PID1, and then it is possible to bring up Gnome. It's not easy, and I really don't recommend it, but it is possible.

  • And from another of your comments:

    So far, nothing seems to work on WSL. I guess I can assume it's a sort of SSH-like (terminal) window, rather than a gui capable window...

    Well, the first part is a bit hyperbole, to be fair. There's a lot that works on WSL1 and WSL2; much more works than doesn't.

    Most commands and features work with no additional effort. Some, however, like your particular case of running a Linux desktop, do require a different approach.

    It's okay to think of WSL1 and WSL2 (at least as they existed at that time) as a terminal-only, but it really could do more. It's probably better to think of it as a mix of:

      * Running in a container (which it technically is, behind the scenes)
      * The tools and apps from your given distribution (Ubuntu, obviously, in this case)
      * And a bit of [Linux from Scratch](https://www.linuxfromscratch.org) to gain the understanding of how to get the corner-cases working.
    
  • Finally, there is now WSLg under Windows 11 that provides the ability to run GUI apps on WSL2 out-of-the-box. It's even possible to get a Linux desktop running in it with a little additional effort, as I've documented in another answer.

NotTheDr01ds
  • 17,888
-1

try install Windows 10 build 21364 or above, and then wsl --update

joao
  • 62
-3

there's many desktop environments available and you can choose any you want, the following commands will help you install gnome environment.

sudo apt-get update
sudo apt-get install gnome gnome-session

at the same time, on your windows install Xming X Server, after installing run XLaunch from your start menu in windows and select fullscreen mode, make sure display number is set to 0, after that, keep pressing Next button, till end.

after installing gnome in linux and run following command

DISPLAY=:0 XDG_SESSION_TYPE=x11 gnome-session

Your ubuntu with gnome window should appear.