3

I am not an advanced user when it comes to Linux; I am a beginner so please be understanding. Namely, I installed the latest version of Ubuntu 22.04 under WSL2, but now I would like to be able to install the full Gnome environment.

Just like running it from an image. I do not mean to run individual Ubuntu applications on a computer with windows, but to run a full graphical environment -- a full Ubuntu system based on Gnome.

I was looking for tutorials on how to do it, but I can't find anything, unfortunately.

I want something like this Xfce4 installation, but based on Gnome.

NotTheDr01ds
  • 22,082
P.Bak
  • 53

1 Answers1

3

There is GWSL from microsoftstore. It can be installed for your linux distribution (e.g Ubuntu Preview's suited for Gnome)

It took ~10mins for WSL2 and once installed, Ubuntu Preview enables systemd and the D-BUS service

cat <<EOF >> ~/.bashrc

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

Finally open a shell and use sudo apt install ubuntu-desktop gnome Download gist script:

wget https://gist.githubusercontent.com/b23prodtm/b058b8b0efbd7e9c632dbcc7affe1754/raw/f92026edf531680743ed5fef08d585c44aec6944/wsl2-setup-desktop-gnome.sh
chmod +x wsl2-setup-desktop-gnome.sh
./wsl2-setup-desktop-gnome.sh

Now you can restart Ubuntu terminal again and start an X session from DBUS:

sudo systemctl start dbus
gnome-session

More complete setup script from Gist

AniketGM
  • 103