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.
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.
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
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
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.
Top comments (12)
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.
see: github.com/Microsoft/WSL/issues/2016
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. :)
Successully run gnome-terminal. Trying to run visual studio code :)
Annnnd, mission completed.
Nice! Are you able to run other DBus dependant applications with the same process?
Yes! Started Firefox but I do not know if it is DBus dependent.
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). 👨🏻💻💜🐧
I learned about it recently. It feels amazing running Linux GUI apps on Windows. Thanks for sharing this with everyone.
Right! Not even fathomable ten years ago.
really its helpfull for us Kali Linux on Windows in 5min WSL 2 GUI
really its helpfull for us Kali Linux on Windows in 5min WSL 2 GUI
yes you are right good content