Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI Apps That Are Defaults With Linux Distro's Don't Work. #8669

Closed
1 of 2 tasks
NickDeBeenSAE opened this issue Jul 31, 2022 · 17 comments
Closed
1 of 2 tasks

GUI Apps That Are Defaults With Linux Distro's Don't Work. #8669

NickDeBeenSAE opened this issue Jul 31, 2022 · 17 comments

Comments

@NickDeBeenSAE
Copy link

NickDeBeenSAE commented Jul 31, 2022

Version

OS Build 19044.1865

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.102.1

Distro Version

Ubuntu 22.04LTS

Other Software

No response

Repro Steps

https://docs.microsoft.com/en-us/windows/wsl/tutorials/gui-apps

Follow all instructions posted on the above link.

2022 07 31-08 46

The image above has ABSOLUTELY NO Windows 10 based Linux GUI images (Microsoft only shows a picture of their useless Windows 11 Operating System having Linux GUI apps installed and running fine).

It shows only Windows 11's GUI feature working.

When I took that screenshot, it didn't get the Start Menu.

The thing is, GUI is actively being refused.

I have absolutely no Linux applications in my Start Menu (please see screenshot below), although all distro's come with Gimp and Gedit by default, this is a fact (except for Arch or Debian, but correct me if I'm wrong).

2022 07 31-09 54

Expected Behavior

  1. GUI applications to actively accept remote connection to the Linux distro. 2. Expect WSL 2 GUI's feature to actually work. 3. Linux GUI apps to actually show in the Start Menu.

Actual Behavior

When I attempt to run either Gimp or Gedit:

Cannot open display: (When I ran gimp)

And;

gedit

(gedit:43): Gtk-WARNING **: 09:57:37.387: cannot open display: "Insert.IP.Address.Here" (replace "Insert.IP.Address.Here" with your systems IP Address).

Diagnostic Logs

Not applicable as I have no idea where they are stored.

@NotTheDr01ds
Copy link

NotTheDr01ds commented Jul 31, 2022

As noted in the Prerequisites section of the tutorial you linked:

You will need to be on Windows 11 Build 22000 or later to access this feature.

Support for Linux GUI applications is not directly available in Windows 10.

There are "unofficial" solutions for running Linux GUI applications on WSL on Windows 10:

  • I believe the quickest and easiest solution is to utilize xrdp in Linux, install Xfce4, and connect to your distribution using Windows Remote Desktop Connection. See here for the steps to do this on Ubuntu 20.04. I believe it's the same for 22.04, but I haven't set it up there just yet myself.

  • Third-party X servers for Windows as noted here. Note that in addition to the steps in that answer, you'll probably need to open a firewall port to allow network communication between Windows and WSL2.

If you have any problems getting these running, you might want to ask in either:

@NotTheDr01ds
Copy link

NotTheDr01ds commented Jul 31, 2022

Also to cover:

all distro's come with Gimp and Gedit by default

Distributions for WSL are typically more barebones in nature because they are designed primarily as developer environments, not full desktop environments. The Ubuntu distribution for WSL, for instance, is based on Ubuntu Server, not Desktop, and does not include Gimp nor Gedit by default, although it's certainly possible to install them (and it sounds like you have).

@NickDeBeenSAE
Copy link
Author

NickDeBeenSAE commented Jul 31, 2022

Gimp and Gedit did come with my Ubuntu install by default.

I didn't have to install them.

All the Distro needed was an update after a full upgrade, and that updated everything in it.

I installed XRDP, after installing the Ubuntu Gnome Desktop environment.

When I started the xrdp service with sudo service xrdp start the startup was fine.

I used the Remote Desktop Connection app, entered all details correctly, the Distro's IP Address in this case, it connected for a very brief amount of time.

After attempting to log in to the Xorg session (another session I installed), the connection dropped because it was actively refused.

@NickDeBeenSAE
Copy link
Author

It went into an irrecoverable state after I hit Enter to log in.

@NickDeBeenSAE
Copy link
Author

2022 07 31-18 32_01

My remote connection always fails.

@NickDeBeenSAE
Copy link
Author

For f*** sakes:
2022 07 31-18 56

Now its telling me I have an active connection to a remote desktop when I don't.

@NickDeBeenSAE
Copy link
Author

I can PROVE this.

I looked through the entire Windows Task Manager.

@NotTheDr01ds
Copy link

@NickDeBeenAIE I don't know if you had a chance to read my answer I linked from Ask Ubuntu regarding xrdp (linked above), but running Gnome on WSL is a pretty advanced topic, and I don't recommend it for most users.

The main issue is that Gnome relies on Systemd, but Systemd and WSL aren't currently compatible. Systemd requires that it run as PID1, but WSL's /init process needs to run as PID1 given the WSL architecture.

It's possible to work around this, as I demonstrate in that answer (at a very basic level), but doing it correctly is much more complex. I also haven't tried it recently, and it's very likely that it requires additional effort in 22.04 that wasn't necessary when I did it in 20.04.

As mentioned above, if you need to use XRDP, I recommend Xfce4 as a "lightweight" desktop environment that doesn't rely on Systemd.

@NickDeBeenSAE
Copy link
Author

NickDeBeenSAE commented Jul 31, 2022

I don't know if you had a chance to read my answer I linked from Ask Ubuntu regarding xrdp (linked above), but running Gnome on WSL is a pretty advanced topic, and I don't recommend it for most users.

This is because it takes me to what looks like "the front desk" so to speak.

Only now did you actually send a link to your XRDP post, else I found it on your first reply.

I'll need the commands sent here exclusively.

@NickDeBeenSAE
Copy link
Author

That was accidental. Didn't mean to do that.

@NickDeBeenSAE
Copy link
Author

When I followed the Gnome (Ubuntu) instructions to export Ubuntu shell:

sudo export GNOME_SHELL_SESSION_MODE=ubuntu

sudo: export: command not found

So its probably going to be the exact same thing as another export command, because I only execute commands as sudo as in my experience with Linux distros.

Exporting as the normal user is never a good idea.

Following the last 2 instructions:

nsenter: cannot open /proc/21777/ns/time: No such file or directory

Failed to start xrdp.service: Transport endpoint is not connected See system logs and 'systemctl status xrdp.service' for details.

@NickDeBeenSAE
Copy link
Author

And just FYI, what you've gotten so many users like me to do, is lock ourselves out of the Ubuntu Desktop by posting that answer as it had the opposite effect on me.

@NotTheDr01ds
Copy link

NotTheDr01ds commented Jul 31, 2022

@NickDeBeenAIE As I said, I don't recommend it because it does change WSL behavior. I also mentioned that it likely wouldn't work without additional steps on Ubuntu 22.04, which you said you are using.

because I only execute commands as sudo as in my experience with Linux distros.... Exporting as the normal user is never a good idea.

Since you specifically say that you didn't follow the instructions, and you attempted to sudo export (which will simply never work in a Linux shell), then it's no surprise that you had issues.

If you've done the unshare without successfully completing the other steps, then yes, the service command will get mapped to systemctl instead, which won't work at that point. You should be able to recover by doing a wsl --shutdown. That will remove the namespace and make sure that Systemd is no longer running.

@NickDeBeenSAE
Copy link
Author

Well isn't exporting a shell of anything a sudo thing?

I am attempting to install said Linux Distro in a VM, but its not fully installing as the installer crashes.

The VM service I'm using is VMWare Workstation 16 (non-commercial).

The last time I installed this on a Windows 11 install was after an AMD driver update.

Windows 11 as a result was complete s***, and failed to boot and repair.

So, I installed VMWare on my now Windows 10 install, and it made the screen flicker slightly, so I'm afraid of rebooting, because it did exactly the same thing when I had Windows 11.

I fear that VMWare has corrupt something critical.

@NickDeBeenSAE
Copy link
Author

WSL is shut down at this time and the feature is disabled.

Linux is better in a VM.

@hedsonr
Copy link

hedsonr commented Oct 12, 2022

Found the perfect solution:

  • Install WSL 2 on Windows 10
  • Install your GUI application with apt-get (i.e. gimp)
  • Use MobaXTerm Free to connect to your WSL : https://mobaxterm.mobatek.net/
  • Call the Linux GUI application directly on the terminal
    image

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants