{"id":32326,"date":"2023-06-14T15:17:31","date_gmt":"2023-06-14T15:17:31","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=32326"},"modified":"2023-06-14T15:23:15","modified_gmt":"2023-06-14T15:23:15","slug":"automatically-install-windows-subsystem-for-linux-from-visual-studio-using-new-seamless-integration","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/automatically-install-windows-subsystem-for-linux-from-visual-studio-using-new-seamless-integration\/","title":{"rendered":"Automatically Install Windows Subsystem for Linux from Visual Studio using New Seamless Integration"},"content":{"rendered":"<p><span class=\"TextRun SCXW6937026 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW6937026 BCX8\">Have you ever wanted to try using Windows Subsystem for Linux (WSL) to target Linux from your C++ project, but <\/span><span class=\"NormalTextRun SCXW6937026 BCX8\">haven\u2019t<\/span><span class=\"NormalTextRun SCXW6937026 BCX8\"> gone through the documentation or <\/span><span class=\"NormalTextRun SCXW6937026 BCX8\">CLI <\/span><span class=\"NormalTextRun SCXW6937026 BCX8\">installation process? Now, from Visual Studio with the Linux and Embedded Workload, Visual Studio makes it easier than ever to get to that one-click <\/span><span class=\"NormalTextRun SCXW6937026 BCX8\">install<\/span><span class=\"NormalTextRun SCXW6937026 BCX8\"> of WSL. <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\">Download the latest preview version of Visual Studio<\/a> and select the Linux and Embedded workload to give it a try!<\/span><\/span><\/p>\n<h3>How do I start?<\/h3>\n<p><span class=\"TextRun SCXW6937026 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun CommentStart CommentHighlightPipeRest CommentHighlightRest SCXW6937026 BCX8\">When you open a <\/span><span class=\"NormalTextRun SpellingErrorV2Themed CommentHighlightRest SCXW6937026 BCX8\">CMake<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW6937026 BCX8\"> project that can target Linux<\/span><span class=\"NormalTextRun CommentHighlightPipeRest SCXW6937026 BCX8\">, a<\/span><span class=\"NormalTextRun SCXW6937026 BCX8\">n <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW6937026 BCX8\">info <\/span><span class=\"NormalTextRun CommentStart SpellingErrorV2Themed SCXW6937026 BCX8\">bar<\/span><span class=\"NormalTextRun SCXW6937026 BCX8\"> will open for users to click and open a WSL installation process. By default, <\/span><span class=\"NormalTextRun CommentStart CommentHighlightPipeRest CommentHighlightRest SCXW6937026 BCX8\">it will install a<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW6937026 BCX8\"> WSL2 Linux VM with the<\/span><span class=\"NormalTextRun CommentHighlightRest SCXW6937026 BCX8\"> Ubuntu <\/span><span class=\"NormalTextRun CommentHighlightRest SCXW6937026 BCX8\">distribution<\/span><span class=\"NormalTextRun CommentHighlightPipeRest SCXW6937026 BCX8\">.<\/span><\/span><span class=\"EOP SCXW6937026 BCX8\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:278}\">\u00a0<\/span><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/WSL-gold-bar.png\"><img decoding=\"async\" class=\"size-full wp-image-32327 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/WSL-gold-bar.png\" alt=\"Info Bar of prompt for WSL to download in a CMake project\" width=\"750\" height=\"280\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/WSL-gold-bar.png 750w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/WSL-gold-bar-300x112.png 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/p>\n<p>Additionally, you can open the dialog by navigation at any time to Project &gt; Install WSL for me.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/installwsl.png\"><img decoding=\"async\" class=\"size-full wp-image-32328 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/installwsl.png\" alt=\"Install WSL for me dialog from the Project dropdown.\" width=\"750\" height=\"211\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/installwsl.png 750w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/installwsl-300x84.png 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/p>\n<p>If you don&#8217;t have a WSL machine already installed on your machine, an additional option will be available in your Target Machine dropdown to &#8220;Create Linux Environment.&#8221;<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/MicrosoftTeams-image-18.png\"><img decoding=\"async\" class=\"size-full wp-image-32329 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/MicrosoftTeams-image-18.png\" alt=\"Create Linux Environment entry point from the target machine dropdown.\" width=\"301\" height=\"185\" \/><\/a><\/p>\n<h3>What happens next?<\/h3>\n<p>Once you click one of these options, an installation dialog will pop up. In the installation dialog, it will automatically check the status of pre-requisites on your machine for the installation and populate additional information if anything needs pre-configuring. You can hover over the question mark icon to learn more information about each pre-requisite check. If any pre-requisite fails, you can follow the error information to fix the errors, and then select &#8220;Refresh System Check Values&#8221; to re-run the pre-requisite checks.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/InstallationGuide.png\"><img decoding=\"async\" class=\"size-full wp-image-32330 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/InstallationGuide.png\" alt=\"WSL automatic acquisition installation guide\" width=\"750\" height=\"550\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/InstallationGuide.png 750w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/InstallationGuide-300x220.png 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/p>\n<p>After the pre-requisites are run and all pass, the installation process will kick off.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/InstallationGuidev2.png\"><img decoding=\"async\" class=\"size-full wp-image-32331 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/InstallationGuidev2.png\" alt=\"Completed WSL Installation Guide\" width=\"750\" height=\"550\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/InstallationGuidev2.png 750w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2023\/06\/InstallationGuidev2-300x220.png 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/p>\n<p>At the end, you can select &#8220;Finish&#8221; and the new WSL machine with build tools downloaded will be selected as the target machine for your existing CMake project.<\/p>\n<h3>Coming Soon<\/h3>\n<p>We will be planning on adding additional tutorial content to open the installer, additional information messaging and customization, and the installer will automatically re-open after reboot of machine. Let us know if there\u2019s anything else you\u2019d like to see!<\/p>\n<h3>What do you think?<\/h3>\n<p>We hope this new WSL acquisition experience will help you install and re-target your applications to WSL. <a href=\"https:\/\/visualstudio.microsoft.com\/vs\/preview\/\">Download the latest preview version of Visual Studio<\/a> and give it a try.<\/p>\n<p>Please let us know your thoughts and if you hit any issues! We are actively developing this feature set and would love to hear what would improve your workflow even more. This feature is still fairly new, so please let us know in the comments below or on <a href=\"https:\/\/developercommunity.visualstudio.com\/report?space=8&amp;entry=problem\">Visual Studio Feedback<\/a> if you hit any issues as well. You can also find us on Twitter (<a href=\"https:\/\/twitter.com\/visualc\">@VisualC<\/a>) or via email at <a href=\"mailto:visualcpp@microsoft.com\">visualcpp@microsoft.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever wanted to try using Windows Subsystem for Linux (WSL) to target Linux from your C++ project, but haven\u2019t gone through the documentation or CLI installation process? Now, from Visual Studio with the Linux and Embedded Workload, Visual Studio makes it easier than ever to get to that one-click install of WSL. Download [&hellip;]<\/p>\n","protected":false},"author":85413,"featured_media":32331,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,266,279,230,280],"tags":[],"class_list":["post-32326","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","category-cmake","category-linux","category-new-feature","category-new-user"],"acf":[],"blog_post_summary":"<p>Have you ever wanted to try using Windows Subsystem for Linux (WSL) to target Linux from your C++ project, but haven\u2019t gone through the documentation or CLI installation process? Now, from Visual Studio with the Linux and Embedded Workload, Visual Studio makes it easier than ever to get to that one-click install of WSL. Download [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/32326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/85413"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=32326"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/32326\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/32331"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=32326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=32326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=32326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}