The WSL RootFs filesystem (that under AppData/Local/lxss that appears as / in WSL) uses extended attributes which Windows doesn't understand to store Linux filesystem data, and so can't process. So if you edit or create files there (say in your 'shared' folder), those files will be invisible to WSL.
You need to create your 'shared' folder somewhere under /mnt/c, which uses the WSL DriveFs filesystem and doesn't suffer from this limitation.
I personally do the latter: use VcXsrv as my X server in multiple windows mode, then launch the xfce4-terminal (because gnome-terminal had visual issues that I didn't care to try to learn how to fix), and suddenly I have a competent terminal with font and color support.
I found I needed to add these to my bashrc...
export DISPLAY="localhost:0"
export TERM=xterm-256color
Do the fix from this reddit for dbus:
sudo sed -i 's$<listen>.*</listen>$<listen>tcp:host=localhost,port=0</listen>$' /etc/dbus-1/session.conf
I also installed compiz and I use the cbwin project to run windows programs from my xfce4-terminal shell.
I am very happy with this setup and use NeoVim + lots of native linux plugins even though my "for-work" machine must be Windows. :)
It is also possible to start an SSH server in Bash-on-Linux-on-Windows and then connect to it, say from MinTTY like from Cygwin.
PS: to make launching xfce4-terminal painless and without the extra bash cmd window, I wrote a program that does nothing but start the bash process with arguments to start xfce4-terminal without a console window. I did this in C# - basically use arguments "UseShellExecute" false and "CreateNoWindow" true. I then pinned that to my taskbar and it's almost seemless.
EDIT: The answer with VBScript is brilliant. Here's that same script, but a JScript version...
WScript.CreateObject("WScript.Shell").run('bash.exe -l -c "DISPLAY=:0.0 xfce4-terminal"', 0, false);
Best Answer
Windows 10 itself does not support GUI. In order to run GUI in wsl you need to install a X server and get it to configure correctly.
I would suggest you to install VcXsrv to display GUI.
I am not able to run GUI successfully by
sudo apt-get install ubuntu-desktop
. However, I successfully installed mate-desktop GUI in Debian and ubuntu.Here are the steps for me to display GUI by wsl. You can check my videos on detailed steps Install GUI (mate desktop) to Microsoft Windows Subsystem Linux
step 1: install Debian or Ubuntu Linux subsystem: - PowerShell as administrator:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Microsoft Store: install "Debian" or "ubuntu"step 2: install mate tesktop for Debian: - open Debian in windows 10. Type the following commend -
sudo apt-get update
-sudo apt install task-mate-desktop
OR install mate-desktop for Ubuntu - open Ubuntu console in windows 10 -
sudo apt install tasksel
-sudo apt update
-sudo tasksel install ubuntu-mate-desktop
step 3: install VcXsrv in windows 10: - download from: https://sourceforge.net/projects/vcxsrv/ - open XLauch, and use the following options for setup
- select: "One large window" - Display number: 0 - next - Start no client - next - finish
step 4: setup display in linux console: -
export DISPLAY=:0
-export LIBGL_ALWAYS_INDIRECT=1
step 5: start Mate-desktop environment: - run
mate-session
Step 3 and step 4 are extremely important to display GUI in windows 10 wsl.