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.

NotTheDr01ds
  • 17,888
P.Bak
  • 43
  • 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 '22 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 '22 at 14:18
  • 1
    systemd works fine under WSL now... Microsoft released few days ago "SystemD for WSL" https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/ – Mlocik97 Sep 29 '22 at 15:01
  • @Mlocik97 Well, "fine" might be a bit of a stretch. But yes, Microsoft put out a pre-release version last week, then a new one yesterday, with early support for Systemd. "Pre-release" is meant that it's not quite as stable as a "Preview". And don't forget to use @name when replying to someone (like Esther) so that they get notified. Thanks! – NotTheDr01ds Sep 29 '22 at 19:26
  • @Esther Tagging you for the information in the reply above ... – NotTheDr01ds Sep 29 '22 at 19:27
  • @NotTheDr01ds I knew about that, but was not sure how well it actually worked. Also it only works on Windows 11 (not sure which Windows version OP is using) and possibly still only for Windows Insiders? – Esther Sep 29 '22 at 19:28
  • 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. – NotTheDr01ds Sep 29 '22 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! – NotTheDr01ds Dec 23 '22 at 21:13
  • Also note that I never saw your "follow-up" questions that were posted as answers, since they were (correctly) deleted since they weren't "answers". At the time, I didn't have enough reputation to see deleted answers, but now I do. If you'd like, you can always repost those as separate questions. – NotTheDr01ds Dec 23 '22 at 21:16

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