2

I had WSl installed and updated it according to this MS guide:

wsl --update
wsl --shutdown

and tried to run gedit:

sudo apt install gedit -y
gedit ~/.bashrc

but got

(gedit:1854): Gtk-WARNING **: 19:49:45.422: cannot open display:

and the same with gimp and other graphical apps.

Should I do some further manipulations like installing ubuntu desktop like

apt install gnome

or using VcXsrc or opening a port in Windows Firewall?

WSL version:

WSL version: 1.2.0.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.2604

The command

wsl --list --online

outputs the following:

The following is a list of valid distributions that can be installed.
Install using 'wsl.exe --install <Distro>'.

NAME FRIENDLY NAME Ubuntu Ubuntu Debian Debian GNU/Linux kali-linux Kali Linux Rolling Ubuntu-18.04 Ubuntu 18.04 LTS Ubuntu-20.04 Ubuntu 20.04 LTS Ubuntu-22.04 Ubuntu 22.04 LTS OracleLinux_8_5 Oracle Linux 8.5 OracleLinux_7_9 Oracle Linux 7.9 SUSE-Linux-Enterprise-Server-15-SP4 SUSE Linux Enterprise Server 15 SP4 openSUSE-Leap-15.4 openSUSE Leap 15.4 openSUSE-Tumbleweed openSUSE Tumbleweed

Dmitriano
  • 427
  • 1
  • 5
  • 18
  • @Ramhound I do not know. What is the command to start it? – Dmitriano Apr 20 '23 at 17:24
  • @Ramhound see updated post – Dmitriano Apr 20 '23 at 17:27
  • @Ramhound I am using Ubuntu-22.04. I did not do wsl --install because I thought that I already have WSL installed, and it is not clear for me what does Install using 'wsl.exe --install <Distro>' message mean. Actually Ubuntu-22.04 is installed and I am using it in terminal (as the app from MS Store) – Dmitriano Apr 20 '23 at 17:44
  • @Ramhound restarting the machine did not help. Should I do something like "wsl --install ..."? – Dmitriano Apr 20 '23 at 17:50
  • @Ramhound It seems that you are confusing wsl --list --verbose with wsl --list --online. The purpose of wsl --list --online' is to show the distribution that can be installed. I think you mean to ask for wsl -l -v to determine the distribution that is installed. – NotTheDr01ds Apr 20 '23 at 21:58
  • @Dmitriano Can you add the output of echo $DISPLAY to your question? I'm assuming that wsl -l -v correctly shows that you are running Ubuntu-22.04, right? ;-) – NotTheDr01ds Apr 20 '23 at 22:03
  • @NotTheDr01ds $DISPLAY is empty, wsl -l -v shows Ubuntu-22.04 Running 1 where 1 is VERSION. – Dmitriano Apr 21 '23 at 04:35
  • 1
    @Dmitriano Ah, there you go - WSLg only works with WSL2. – NotTheDr01ds Apr 21 '23 at 04:40
  • 1
    Try wsl --set-version Ubuntu-22.04 2 - Does it convert or give an error? – NotTheDr01ds Apr 21 '23 at 04:42
  • @NotTheDr01ds Started wsl --set-version Ubuntu-22.04, the conversion took probably a hour or two but finally succeeded and I was able to run gedit – Dmitriano Apr 21 '23 at 09:12

0 Answers0