2

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.

9
  • 1
    Not going to happen using WSL What you want is VMWare Player or VirtualBox and Ubuntu installed there. That will make it a complete working Ubuntu with gnome2 or gnome shell depending on the Ubuntu flavour.
    – Rinzwind
    Sep 29, 2022 at 13:53
  • afaik gnome relies heavily on systemd, which isn't really possible to install on wsl without a lot of hacks (and possibly won't work anyways). If you want a full normal VM, use a full normal VM.
    – Esther
    Sep 29, 2022 at 14:18
  • 1
    systemd works fine under WSL now... Microsoft released few days ago "SystemD for WSL" devblogs.microsoft.com/commandline/…
    – Mlocik97
    Sep 29, 2022 at 15:01
  • 1
    @Esther Right - It is only Windows 11 (the OP doesn't specify their Windows release), but it does not require Insider. Only installing from the Microsoft Store requires Insider, but the pre-release package can still be downloaded from the WSL Github Releases page and installed using Add-AppxPackage in an Administrative PowerShell. Sep 29, 2022 at 19:30
  • 1
    I have updated my answer to the question Opening Ubuntu 20.04 Desktop on WSL2. It should have the latest information on how to do this on 22.04 with RDP (which is what the YouTube video you linked uses). Let me know if you have any questions on that method. Thanks! Dec 23, 2022 at 21:13

1 Answer 1

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

Not the answer you're looking for? Browse other questions tagged .