{"id":326,"date":"2025-01-07T16:47:10","date_gmt":"2025-01-07T08:47:10","guid":{"rendered":"https:\/\/thihaoo.com\/?p=326"},"modified":"2025-01-07T16:47:41","modified_gmt":"2025-01-07T08:47:41","slug":"install-wsl-windows-subsystem-for-linux","status":"publish","type":"post","link":"https:\/\/thihaoo.com\/?p=326","title":{"rendered":"Install WSL (Windows Subsystem for Linux)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>This is the information about how to set up SSH on Windows Subsystem for Linux (WSL)<\/strong>&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install WSL (Windows Subsystem for Linux) on your Windows OS.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"577\" src=\"https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-9.png?resize=774%2C577&#038;ssl=1\" alt=\"\" class=\"wp-image-332\" style=\"width:544px;height:auto\" srcset=\"https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-9.png?w=774&amp;ssl=1 774w, https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-9.png?resize=300%2C224&amp;ssl=1 300w, https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-9.png?resize=768%2C573&amp;ssl=1 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Install WSL (Windows Subsystem for Linux) on your Windows OS.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can run this command from Windows&nbsp;Powershell&nbsp;to install WSL.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">wsl&nbsp;&#8211;install&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After that, update WSL with this command from Windows admin command prompt.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">wsl&nbsp;&#8211;update&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check WSL version.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">wsl&nbsp;&#8211;version&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"196\" src=\"https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-10.png?resize=602%2C196&#038;ssl=1\" alt=\"\" class=\"wp-image-333\" srcset=\"https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-10.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-10.png?resize=300%2C98&amp;ssl=1 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Install Ubuntu from Windows store.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"784\" src=\"https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-11.png?resize=1024%2C784&#038;ssl=1\" alt=\"\" class=\"wp-image-334\" style=\"width:535px;height:auto\" srcset=\"https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-11.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-11.png?resize=300%2C230&amp;ssl=1 300w, https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-11.png?resize=768%2C588&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Start your Ubuntu from Windows start menu.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The latest version of WSL supports \u201csystemd\u201d and we should utilize it fully.&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start your Ubuntu on Windows.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From the WSL&nbsp; terminal (e.g., Ubuntu 22.04), we need to edit the \/etc\/wsl.conf&nbsp;file.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo&nbsp;nano \/etc\/wsl.conf&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add the following into that file.&nbsp;&nbsp;<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">[boot]&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">systemd=true&nbsp;<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Shutdown the WSL (and also Ubuntu) and restart your Ubuntu\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">wsl \u2013shutdown<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From the Ubuntu terminal, install OpenSSH server<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo apt update<br>sudo apt install openssh-server<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the status\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo service ssh status<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should see something like this :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"786\" height=\"255\" src=\"https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-12.png?resize=786%2C255&#038;ssl=1\" alt=\"\" class=\"wp-image-335\" style=\"width:639px;height:auto\" srcset=\"https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-12.png?w=786&amp;ssl=1 786w, https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-12.png?resize=300%2C97&amp;ssl=1 300w, https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-12.png?resize=768%2C249&amp;ssl=1 768w\" sizes=\"auto, (max-width: 786px) 100vw, 786px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If ssh service is not running, run this command<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo systemctl start sshd.service<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From this point, you should be able to test to ssh from Windows command prompt to your Ubuntu account.<br>eg., ssh thiha@localhost<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">If you get \u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SSH Permission denied (publickey)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">error while trying ssh into WSL from Windows, do this :<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the file \u201c\/etc\/ssh\/sshd_config\u201d with any text editor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Set the PasswordAuthentication to yes .<br>Set the PubkeyAuthentication to yes .<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Restart the ssh with this command :<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo systemctl restart ssh<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After that, permission denied error should be solved.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"919\" height=\"916\" src=\"https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-13.png?resize=919%2C916&#038;ssl=1\" alt=\"\" class=\"wp-image-336\" style=\"width:585px;height:auto\" srcset=\"https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-13.png?w=919&amp;ssl=1 919w, https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-13.png?resize=300%2C300&amp;ssl=1 300w, https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-13.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/thihaoo.com\/wp-content\/uploads\/2025\/01\/image-13.png?resize=768%2C765&amp;ssl=1 768w\" sizes=\"auto, (max-width: 919px) 100vw, 919px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This is the information about how to set up SSH on Windows Subsystem for Linux (WSL)&nbsp; Install WSL (Windows Subsystem for Linux) on your Windows OS.&nbsp; Install WSL (Windows Subsystem&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","WB4WB4WP_MODE":"","WB4WP_PAGE_SCRIPTS":"","WB4WP_PAGE_STYLES":"","WB4WP_PAGE_FONTS":"","WB4WP_PAGE_HEADER":"","WB4WP_PAGE_FOOTER":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-326","post","type-post","status-publish","format-standard","hentry","category-blog-english"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/thihaoo.com\/index.php?rest_route=\/wp\/v2\/posts\/326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thihaoo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thihaoo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thihaoo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thihaoo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=326"}],"version-history":[{"count":2,"href":"https:\/\/thihaoo.com\/index.php?rest_route=\/wp\/v2\/posts\/326\/revisions"}],"predecessor-version":[{"id":338,"href":"https:\/\/thihaoo.com\/index.php?rest_route=\/wp\/v2\/posts\/326\/revisions\/338"}],"wp:attachment":[{"href":"https:\/\/thihaoo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thihaoo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thihaoo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}