{"id":6619,"date":"2021-04-21T10:07:23","date_gmt":"2021-04-21T17:07:23","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/commandline\/?p=6619"},"modified":"2021-04-21T10:12:27","modified_gmt":"2021-04-21T17:12:27","slug":"the-initial-preview-of-gui-app-support-is-now-available-for-the-windows-subsystem-for-linux-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/commandline\/the-initial-preview-of-gui-app-support-is-now-available-for-the-windows-subsystem-for-linux-2\/","title":{"rendered":"The Initial Preview of GUI app support is now available for the Windows Subsystem for Linux"},"content":{"rendered":"<p>A year ago at <a href=\"https:\/\/devblogs.microsoft.com\/commandline\/the-windows-subsystem-for-linux-build-2020-summary\/\">BUILD 2020 we introduced our goal<\/a> to bring Linux GUI applications to the Windows Subsystem for Linux (WSL) to run Linux GUI applications. We are proud to announce the first preview of this <a href=\"https:\/\/github.com\/microsoft\/WSL\/issues\/938\">highly anticipated<\/a> and <a href=\"https:\/\/github.com\/microsoft\/wslg\">open source feature<\/a>! We\u2019ve given this feature the nickname: \u201cWSLg\u201d. Please check out the video below or keep reading to see what you can use this feature for, how it works, and how to install it.<\/p>\n<div style=\"text-align:center;\">\n  <iframe width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/f8_nvJzuaSU\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div>\n<h2>What can I use GUI application support for?<\/h2>\n<p>WSL lets you run a Linux environment, and up until this point has focused on enabling command line tools utilities and applications. GUI app support now lets you use your favorite Linux GUI applications as well. WSL is used in a wide variety of applications, workloads, and use cases, so ultimately, it\u2019s up to you on what you\u2019d like to use GUI app support for. Below, we\u2019ve highlighted some key scenarios to help you fall in love with running applications in a Linux environment.<\/p>\n<h3>Use your IDE of choice to develop Linux projects<\/h3>\n<p>Visual Studio Code has an amazing experience using <a href=\"https:\/\/code.visualstudio.com\/docs\/remote\/remote-overview\">VS Code Remote<\/a> to create a way for you to have a full-fledged Linux IDE directly on your Windows machine, keep extensions and settings across both Windows and different WSL distros (you can view our <a href=\"https:\/\/docs.microsoft.com\/windows\/wsl\/tutorials\/wsl-vscode\">getting started with VS Code tutorial here<\/a>. WSLg will let you run other IDEs such as gedit, JetBrains based editors, gvim, etc., to test, build, and debug your Linux applications in a performant manner.<\/p>\n<p>Here\u2019s an example of running gedit and gvim to edit Linux files directly in WSL.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/GUIAppsBlogPostDemo-GIF1-Editor.gif\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/GUIAppsBlogPostDemo-GIF1-Editor.gif\" alt=\"GUI Apps Editor GIf\" width=\"1244\" height=\"700\" class=\"aligncenter size-full wp-image-6620\" \/><\/a><\/p>\n<h3>Run Linux only applications, or Linux specific use cases like testing<\/h3>\n<p>You can use this feature to run any GUI application that might only exist in Linux, or to run your own applications or testing in a Linux environment. This could be incredibly useful for developers who want to test their cross-platform app, as they can now run it directly on Windows 10, and then easily inside of Linux without ever needing to change machines or manage a virtual machine.<\/p>\n<p>Let\u2019s look at an example of running TestCafe Studio in WSL to do some web testing from a Microsoft Edge browser running in Linux.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/GUIAppsBlogPostDemo-GIF2-Testing.gif\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/GUIAppsBlogPostDemo-GIF2-Testing.gif\" alt=\"Linux GUI apps testing\" width=\"1244\" height=\"700\" class=\"aligncenter size-full wp-image-6621\" \/><\/a><\/p>\n<h3>Build, test and use Linux applications that use audio or the microphone with built in audio support<\/h3>\n<p>Linux GUI applications on WSL will also include out of the box audio and microphone support. This exciting aspect will let your apps play audio cues and utilize the microphone, perfect for building, testing, or using movie players, telecommunication apps, and more.<\/p>\n<p>Here\u2019s an example of using Audacity running on Linux to record some audio and play it back.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/GUIAppsBlogPostDemo-GIF3-Audio.gif\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/GUIAppsBlogPostDemo-GIF3-Audio.gif\" alt=\"Audio Linux GUI apps\" width=\"1066\" height=\"600\" class=\"aligncenter size-full wp-image-6622\" \/><\/a><\/p>\n<h3>Bonus: Leverage WSL\u2019s GPU access to run Linux applications with 3D acceleration<\/h3>\n<p>As part of this feature, we have also enabled support for GPU accelerated 3D graphics! Thanks to work that was completed in Mesa 21.0, any applications that are doing complex 3D rendering can leverage OpenGL to accelerate these using the GPU on your Windows 10 machine. This will make some of your more complex applications run smoothly, such as running Gazebo, a robotics simulation tool. This experience will soon be included by default with different WSL distributions, however you can gain access to it right away by following <a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wslg-architecture\/#hardware-accelerated-opengl\">the instructions in this blog post to get the right graphics driver and to ensure your distro has a compatible Mesa version.<\/a>.<\/p>\n<p>Below you can see the Gazebo application simulating a robot exploring a virtual cave, as well as the Rviz application visualizing the camera feed of the robot and its laser field sensor\u2019s output. Thanks to GPU accelerated 3D graphics we can run this demo at 60 FPS!<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/GUIAppsBlogPostDemo-GIF4-ROS.gif\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/GUIAppsBlogPostDemo-GIF4-ROS.gif\" alt=\"Image GUIAppsBlogPostDemo GIF4 ROS\" width=\"1066\" height=\"600\" class=\"aligncenter size-full wp-image-6623\" \/><\/a><\/p>\n<h2>How does this feature work?<\/h2>\n<p>From the demos above, you might have noticed we didn\u2019t need to start an X server manually. That\u2019s because with this feature we are automatically starting a companion system distro, containing a Wayland, X server, pulse audio server, and everything else needed to make Linux GUI apps communicate with Windows. After you\u2019re finished using GUI applications and terminate your WSL distribution the system distro will automatically end its session as well.<\/p>\n<p>Like with the rest of WSL plumbing, our intention is for this component to be fully managed and seamless for users. Our intentions are for this system distro to be as invisible to the user as possible, and this is why you won\u2019t see this system distro when you run <code>wsl -l -v<\/code>. Lastly, we\u2019re excited to present that we are using Microsoft\u2019s <a href=\"https:\/\/github.com\/microsoft\/CBL-Mariner\">CBL-Mariner distribution<\/a> for this system distro! CBL-Mariner is an internal Linux distribution used traditionally for Microsoft\u2019s cloud infrastructure and edge products and services, and we are now extending its use to support GUI apps inside of WSL. You can view the diagram below to see an overall summary of the architecture of this feature.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/WSLg_ArchitectureOverview.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/WSLg_ArchitectureOverview.png\" alt=\"Image WSLg ArchitectureOverview\" width=\"2105\" height=\"1187\" class=\"aligncenter size-full wp-image-6628\" srcset=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/WSLg_ArchitectureOverview.png 2105w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/WSLg_ArchitectureOverview-300x169.png 300w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/WSLg_ArchitectureOverview-1024x577.png 1024w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/WSLg_ArchitectureOverview-768x433.png 768w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/WSLg_ArchitectureOverview-1536x866.png 1536w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2021\/04\/WSLg_ArchitectureOverview-2048x1155.png 2048w\" sizes=\"(max-width: 2105px) 100vw, 2105px\" \/><\/a><\/p>\n<p>For a full in depth view of what we did to make this feature possible and the deep technical details, please view <a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wslg-architecture\/\">this blog post<\/a> written by the developers who made this feature possible.<\/p>\n<h2>Getting started with this feature<\/h2>\n<p>We are starting the rollout of this feature as an initial preview before we fully roll it into the WSL experience. To get started using Linux GUI app support, you\u2019ll need to make sure you\u2019re on Windows 10 Insiders preview build 21364 or higher. If you already have WSL installed, all you need to do is run <code>wsl --update<\/code> and you\u2019ll be set to use GUI apps. If you don\u2019t have WSL enabled, running <code>wsl --install<\/code> will install WSLg automatically as part of the initial WSL setup.<\/p>\n<p>You can find the full install instructions at the GitHub repositories\u2019 README: <a href=\"https:\/\/github.com\/microsoft\/wslg\">https:\/\/github.com\/microsoft\/wslg<\/a> . We also highly recommend that you have GPU compute support enabled in WSL for the best performance, please see <a href=\"https:\/\/github.com\/microsoft\/wslg#pre-requisites\">this section of the install instructions<\/a> to see how you can ensure that feature is enabled.<\/p>\n<h2>Feedback<\/h2>\n<p>Please file any technical issues, or feature requests for GUI application support on the <a href=\"https:\/\/github.com\/microsoft\/wslg\">WSLg Github repository<\/a>. For general WSL issues, please file them at the <a href=\"https:\/\/github.com\/microsoft\/wsl\">WSL repository<\/a>. You can also follow up with me on Twitter <a href=\"https:\/\/twitter.com\/craigaloewen\">@craigaloewen<\/a> and all WSL team members that are on Twitter using <a href=\"https:\/\/twitter.com\/i\/lists\/1131397802204864512\/members\">this list<\/a>. Please stay tuned to this blog for more exciting WSL announcements, and we can\u2019t wait to hear what you think about this new feature.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A year ago at BUILD 2020 we introduced our goal to bring Linux GUI applications to the Windows Subsystem for Linux (WSL) to run Linux GUI applications. We are proud to announce the first preview of this highly anticipated and open source feature! We\u2019ve given this feature the nickname: \u201cWSLg\u201d. Please check out the video [&hellip;]<\/p>\n","protected":false},"author":2191,"featured_media":6634,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6619","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-commandline"],"acf":[],"blog_post_summary":"<p>A year ago at BUILD 2020 we introduced our goal to bring Linux GUI applications to the Windows Subsystem for Linux (WSL) to run Linux GUI applications. We are proud to announce the first preview of this highly anticipated and open source feature! We\u2019ve given this feature the nickname: \u201cWSLg\u201d. Please check out the video [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts\/6619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/users\/2191"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/comments?post=6619"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts\/6619\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/media\/6634"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/media?parent=6619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/categories?post=6619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/tags?post=6619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}