You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git cd ubuntu-wsl2-systemd-script/ bash ubuntu-wsl2-systemd-script.sh
exit Ubuntu and in Windows command line run wsl --shutdown
Start VcXsrv and in the launcher, uncheck "Native opengl" and check "Disable access control"
Enter wsl
The problems are:
If I run gnome-session, the GNOME desktop appears but crashes after about one minute.
If I click "Log Out" button and run gnome-session again in WSL, I receive the following error:
** (process:970): WARNING **: 07:43:49.894: Could not make bus activated clients aware of XDG_CURRENT_DESKTOP=GNOME environment variable: Could not connect: No such file or directory
Terminated
If I run export XDG_CURRENT_DESKTOP=ubuntu:GNOME and run gnome-session again, I receive just "Terminated".
If I run dbus-launch --exit-with-session gnome-session, the GNOME desktop does not crash, but I get a lot of other problems.
2.1) dialog freezes easily on desktop, and I can find no way to remove them.
2.2) Because of 2.1), the frozen dialog covers the desktop, so I can't log out or power down the GNOME desktop using its GUI. If I press Ctrl-C in command line and try to run dbus-launch --exit-with-session gnome-session again, I receive an error saying
dbus[1560]: Unable to set up transient service directory: XDG_RUNTIME_DIR "/run/user/1000" not available: No such file or directory
2.3) If I run dbus-launch --exit-with-session gnome-session with sudo, I can go back into the GNOME desktop, but the desktop is still covered by frozen dialogs, and I cannot type in the search bar of Activities.
2.4) If I click "Power Off" in the GNOME desktop, the desktop does not power off, but stops response unless I press Ctrl-C in WSL command line. In that case, the desktop shows this:
and the erroneous desktop quits if I click "Log Out" button. If I quit WSL, run wsl --shutdown in Windows command line and run wsl again, dbus-launch --exit-with-session gnome-session can start the GNOME desktop but got the same problem of 2.3), and so on and on ...
Do you know how these problems are caused according to my steps, or how to fix these issues, or how to reset the GNOME desktop to remove the frozen dialogs (if I don't have to redo the whole thing due to brick)? Thanks a lot.
NOTE: If you want the ultimate Linux desktop experience, I highly recommend installing Linux as your main OS. I no longer use Windows (except in a VM) so I will not be maintaining this guide anymore.
Think Xfce looks dated? Want a conventional Ubuntu experience? This tutorial will guide you through installing Ubuntu's default desktop environment, GNOME.
GNOME is one of the more complex — and that means more difficult to run — desktop environments, so foryearspeoplecouldn'tfigureouthowtorunit on WSL 2. On WSL 1 it could only run using very complicated methods that didn't transfer to well WSL 2. Any forlorn attempts to run it on WSL 2 only resulted in a smoldering heap of error messages.
If you try to start GNOME now, you'll get a lot of errors. Something along the lines of this, but a ton more errors:
Unable to init server: Could not connect: Connection refused
(gnome-session-check-accelerated:6054): Gtk-WARNING **: 11:04:51.973: cannot open display: :0
Unable to init server: Could not connect: Connection refused
(gnome-session-check-accelerated:6055): Gtk-WARNING **: 11:04:52.234: cannot open display: :0
gnome-session-binary[6044]: WARNING: software acceleration check failed: Child process exited with code 1
gnome-session-binary[6044]: CRITICAL: We failed, but the fail whale is dead. Sorry....
The trick is to enable systemd: (note that this does break a lot of stuff such as Visual Studio Code Remote)
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash ubuntu-wsl2-systemd-script.sh
Now shut down WSL 2: (run this in Windows)
wsl --shutdown
Starting GNOME
First, fire up your X server on Windows. Make sure you let it through your firewall and disable access control.
Now, start up Ubuntu again and start GNOME:
gnome-session
If you don't get any error messages, you should be good. Wait a few seconds for GNOME to start up.
Now you have a great GUI desktop and you won't need any intensive virtual machines anymore!
Profit?
Notes
You can disable the screensaver with gsettings set org.gnome.desktop.session idle-delay 0.
You can also try KDE Plamsa using a similar method! Just sudo apt install kde-plasma-desktop instead and start it with startplasma-x11.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Environment:
I installed Ubuntu 22.04 and GNOME desktop in WSL2. Below are the steps:
git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash ubuntu-wsl2-systemd-script.sh
wsl --shutdown
The problems are:
gnome-session
, the GNOME desktop appears but crashes after about one minute.If I click "Log Out" button and run
gnome-session
again in WSL, I receive the following error:If I run
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
and rungnome-session
again, I receive just "Terminated".dbus-launch --exit-with-session gnome-session
, the GNOME desktop does not crash, but I get a lot of other problems.2.1) dialog freezes easily on desktop, and I can find no way to remove them.
2.2) Because of 2.1), the frozen dialog covers the desktop, so I can't log out or power down the GNOME desktop using its GUI. If I press Ctrl-C in command line and try to run
dbus-launch --exit-with-session gnome-session
again, I receive an error saying2.3) If I run
dbus-launch --exit-with-session gnome-session
with sudo, I can go back into the GNOME desktop, but the desktop is still covered by frozen dialogs, and I cannot type in the search bar of Activities.2.4) If I click "Power Off" in the GNOME desktop, the desktop does not power off, but stops response unless I press Ctrl-C in WSL command line. In that case, the desktop shows this:
and the erroneous desktop quits if I click "Log Out" button. If I quit WSL, run
wsl --shutdown
in Windows command line and run wsl again,dbus-launch --exit-with-session gnome-session
can start the GNOME desktop but got the same problem of 2.3), and so on and on ...Do you know how these problems are caused according to my steps, or how to fix these issues, or how to reset the GNOME desktop to remove the frozen dialogs (if I don't have to redo the whole thing due to brick)? Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions