DEV Community

Cover image for Run Linux GUI apps on Windows 10
David J Eddy
David J Eddy

Posted on

Run Linux GUI apps on Windows 10

A Little Background

As much as I would like to ignore Windows in the tech world, it can not be marginalized. To many users with to many applications on to many systems operate on Windows. Coupled with the recent moves by Microsoft into the free or open source software (FOSS) world Windows is as well making major headway towards being taken seriously in the IT / engineering world.

The Current Situation

At home I run Ubuntu 18.04, on the go is a 15" MacBook Pro, my phone is some version of Android, and finally in the office we run on Windows 10 HP notebooks. I am as far from the unified experience as a user could possibly get. Being able to running Linux programs on Windows is a highly desirable ability given my current role. Windows Subsystem for Linux has makes this possible very easily. I can even run a container using Docker on Linux wrapped in Windows. #softwareabstractioninception. This is an amazing leap from ten years ago when when running LAMP stack properly working with IIS was a journey into madness. Interoperability has progressed so far that running a Linux GUI program on Windows is now possible. Thus this walk through.

The Solution

From the Windows Store install the Windows Subsystem for Linux (WSL). I chose the Ubuntu option.

Linux on Windows #mind-blown

Next we will want to install Xming on to Windows 10. If can be obtained from https://sourceforge.net/projects/xming/. Follow the install directions as they appear from the installer.

Check that out. An X11 server on Windows 10.

Press the START button and type 'wsl'. Start the Windows Subsystem for Linux program. When the Linux terminal is available let's install gvim.

sudo apt-get install vim-gtk

gvim Installed

The final step before being able to run the Linux application is to tell WSL what display to send the video data to. This will be the Xming server running on Windows.

export DISPLAY=:0

Now, if everything went as expected, we should be able to run gvim and see the application open.

gvim

Wow, look at that!

Conclusion

Given historic context it would be easy to dismiss Microsoft Windows as a legitimate development environment. However, with the advancement in containerization, Windows subsystems,  and Microsoft's embrace of the FOSS community; Windows might just be worth staying with as a home/office desktop.

Resources

Top comments (12)

Collapse
 
guneysus profile image
Ahmed Şeref • Edited

This a really cool post. I think that WSL has limitations and GUI apps one one these.

Some apps need dbus like (gnome-terminal).

You should install and start the service.

sudo apt-get install dbus-x11
sudo service dbus start

see: github.com/Microsoft/WSL/issues/2016

Collapse
 
david_j_eddy profile image
David J Eddy

This is very true. WSL does not (yet) have DBus support. Give ti time though, Windows will become more Linux like and Linux (maybe) will get a nice UI and New User Experience. At least, one can hope. :)

Collapse
 
guneysus profile image
Ahmed Şeref • Edited

Successully run gnome-terminal. Trying to run visual studio code :)

Annnnd, mission completed.

# download vscode deb package.

sudo dpkg -i vscode-1.28.2.deb
sudo apt install 
sudo apt install --fix-broken libgconf-2-4 gconf2-common gconf-service gconf-service-backend libxss1 libdbus-glib-1-2 libasound2

# the hack is taken from: https://github.com/Microsoft/vscode/issues/3451#issuecomment-217716116
sudo sed -i 's/BIG-REQUESTS/_IG-REQUESTS/' /usr/lib/x86_64-linux-gnu/libxcb.so.1

Thread Thread
 
david_j_eddy profile image
David J Eddy

Nice! Are you able to run other DBus dependant applications with the same process?

Thread Thread
 
guneysus profile image
Ahmed Şeref

Yes! Started Firefox but I do not know if it is DBus dependent.

Collapse
 
rupankarghosh profile image
RupankarGhosh

In my opinion Windows 10 is getting better with WSL . Now it's out of beta and many network tools in WSL is working fine now. But still I am having some socket problems while on Kali Linux. The only thing I would like to see from windows in this strategy is to create a seperate folder in C:\ drive for its Linux subsystem (which atleast make any sense). 👨🏻‍💻💜🐧

Collapse
 
anku profile image
Ankit Tiwari

I learned about it recently. It feels amazing running Linux GUI apps on Windows. Thanks for sharing this with everyone.

Collapse
 
david_j_eddy profile image
David J Eddy

Right! Not even fathomable ten years ago.

Collapse
 
techfahim00 profile image
TechFahim

really its helpfull for us Kali Linux on Windows in 5min WSL 2 GUI

Collapse
 
techfahim00 profile image
TechFahim

really its helpfull for us Kali Linux on Windows in 5min WSL 2 GUI

Collapse
 
jrfahir profile image
bhojpurisonglist

yes you are right good content