5

After what feels like years and years of futile attempts and google searches, I have finally decided to come here. As a beginner to linux, I really don't know stuff. After going through countless tutorials, I have been able to get through every problem except one. (though afterwards there will probably be plenty more to come)

I am getting this error running startx:

X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
Build Operating System: linux Ubuntu
Current Operating System: Linux DESKTOP-2DV5IQB 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64
Kernel command line: initrd=\initrd.img panic=-1 pty.legacy_count=0 nr_cpus=8
Build Date: 14 December 2021  02:14:13PM
xorg-server 2:1.20.13-1ubuntu1~20.04.2 (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: Thu Apr 28 21:10:03 2022
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
xf86EnableIOPorts: failed to set IOPL for I/O (Function not implemented)
xf86EnableIOPorts: failed to set IOPL for I/O (Function not implemented)
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
Couldn't get a file descriptor referring to the console

When I tried to run xinit:

X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
Build Operating System: linux Ubuntu
Current Operating System: Linux DESKTOP-2DV5IQB 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64
Kernel command line: initrd=\initrd.img panic=-1 pty.legacy_count=0 nr_cpus=8
Build Date: 14 December 2021  02:14:13PM
xorg-server 2:1.20.13-1ubuntu1~20.04.2 (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: Thu Apr 28 21:11:39 2022
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
xf86EnableIOPorts: failed to set IOPL for I/O (Function not implemented)
xf86EnableIOPorts: failed to set IOPL for I/O (Function not implemented)
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

I really don't know what to do at this point. All I wanted to do was follow the "simple" instructions on the ubuntu website to install GNOME!

My question basically is, am I doing this right? If so, why am I getting these errors, and what can I do to fix them? If not, how should I do it?

I am using WSL, which my many queries have brought me to suspecting that might be half of the problem. I am also probably very wrong about this as well.

Any help would be appreciated!

Nmath
  • 12,664
Paradox
  • 53

1 Answers1

1

You can install VcXsrv in order to run a X server in Windows. I leave you this guide.

In WSL update the system, install the desktop environment:

sudo apt update
sudo apt upgrade
sudo apt install lxde

GNOME in your case. Then set the environment variable DISPLAY you need to provide the Windows WSL IP address like following:

export DISPLAY=<address>:0

Replace with the corresponding value. You can get the address going to the PowerShell and executing ipconfig. You'll see it under the WSL section (IPv4).

Here an explanation on why you may need to set LIBGL_ALWAYS_INDIRECT.

export LIBGL_ALWAYS_INDIRECT=1

When you run XLaunch on Windows (provided by VcXsrv):

  1. Display settings: Choose "One large window"
  2. Display number: 0 (the number next to the IP address when you set DISPLAY)
  3. Select how to start clients: Choose "Start no client"
  4. Extra settings: The default and "Disable access control too" (I don't know if this cause any security issue)

Then on WSL you can use startx and launch the desktop environment.

When I did this I also install x11-apps and run xeyes to test if it works.

EDIT: You may want to try setting DISPLAY as follows to automatically get the IP address:

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0