Files
blog-ahmza-com/public/posts/setup-wsl/index.html
T

29 lines
16 KiB
HTML
Raw Normal View History

2023-11-10 23:24:28 +00:00
<!doctype html><html lang=en dir=auto><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><title>Setup WSL 🪟 ❤️ 🐧 | ahmza's ramblings</title>
<meta name=keywords content="windows,linux,wsl"><meta name=description content="Introduction WSL stands for Windows Subsystem for Linux which means we have the Linux kernel inside of windows. This is huge news for developers or people who just want to try Linux.
Prerequisites Enable virtualisation in BIOS Setup Open Powershell in Administrator mode
wsl --install You may be required to restart the device, I Highly recommend you do
Go to the Microsoft store and search for a Linux distribution. I prefer to use the &ldquo;Ubuntu&rdquo; distro."><meta name=author content="ahmza"><link rel=canonical href=https://blog.ahmza.com/Page%28/posts/setup-wsl.md%29><link crossorigin=anonymous href=/assets/css/stylesheet.49e35863ac4b53ab71c7e3249dd5e722c701ee07f8d0cb006a4f4e954364b6fe.css integrity="sha256-SeNYY6xLU6txx+MkndXnIscB7gf40MsAak9OlUNktv4=" rel="preload stylesheet" as=style><script defer crossorigin=anonymous src=/assets/js/highlight.f413e19d0714851f6474e7ee9632408e58ac146fbdbe62747134bea2fa3415e0.js integrity="sha256-9BPhnQcUhR9kdOfuljJAjlisFG+9vmJ0cTS+ovo0FeA=" onload=hljs.initHighlightingOnLoad()></script><link rel=icon href=https://blog.ahmza.com/img/favicon.png><link rel=icon type=image/png sizes=16x16 href=https://blog.ahmza.com/img/favicon.png><link rel=icon type=image/png sizes=32x32 href=https://blog.ahmza.com/img/favicon.png><link rel=apple-touch-icon href=https://blog.ahmza.com/img/favicon.png><link rel=mask-icon href=https://blog.ahmza.com/img/favicon.png><meta name=theme-color content="#2e2e33"><meta name=msapplication-TileColor content="#2e2e33"><noscript><style>#theme-toggle,.top-link{display:none}</style></noscript><script async src="https://www.googletagmanager.com/gtag/js?id=G-HSJHLHP8FZ"></script><script>var doNotTrack=!1;if(!doNotTrack){window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-HSJHLHP8FZ",{anonymize_ip:!1})}</script><meta property="og:title" content="Setup WSL 🪟 ❤️ 🐧"><meta property="og:description" content="Introduction WSL stands for Windows Subsystem for Linux which means we have the Linux kernel inside of windows. This is huge news for developers or people who just want to try Linux.
Prerequisites Enable virtualisation in BIOS Setup Open Powershell in Administrator mode
wsl --install You may be required to restart the device, I Highly recommend you do
Go to the Microsoft store and search for a Linux distribution. I prefer to use the &ldquo;Ubuntu&rdquo; distro."><meta property="og:type" content="article"><meta property="og:url" content="https://blog.ahmza.com/posts/setup-wsl/"><meta property="og:image" content="https://blog.ahmza.com/webp/posts/wsl/feature-anim.webp"><meta property="article:section" content="posts"><meta property="article:published_time" content="2022-02-23T11:57:08+00:00"><meta property="article:modified_time" content="2022-02-23T11:57:08+00:00"><meta property="og:site_name" content="ahmza's ramblings"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://blog.ahmza.com/webp/posts/wsl/feature-anim.webp"><meta name=twitter:title content="Setup WSL 🪟 ❤️ 🐧"><meta name=twitter:description content="Introduction WSL stands for Windows Subsystem for Linux which means we have the Linux kernel inside of windows. This is huge news for developers or people who just want to try Linux.
Prerequisites Enable virtualisation in BIOS Setup Open Powershell in Administrator mode
wsl --install You may be required to restart the device, I Highly recommend you do
Go to the Microsoft store and search for a Linux distribution. I prefer to use the &ldquo;Ubuntu&rdquo; distro."><script type=application/ld+json>{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":2,"name":"Posts","item":"https://blog.ahmza.com/posts/"},{"@type":"ListItem","position":3,"name":"Setup WSL 🪟 ❤️ 🐧","item":"https://blog.ahmza.com/posts/setup-wsl/"}]}</script><script type=application/ld+json>{"@context":"https://schema.org","@type":"BlogPosting","headline":"Setup WSL 🪟 ❤️ 🐧","name":"Setup WSL 🪟 ❤️ 🐧","description":"Introduction WSL stands for Windows Subsystem for Linux which means we have the Linux kernel inside of windows. This is huge news for developers or people who just want to try Linux.\nPrerequisites Enable virtualisation in BIOS Setup Open Powershell in Administrator mode\nwsl --install You may be required to restart the device, I Highly recommend you do\nGo to the Microsoft store and search for a Linux distribution. I prefer to use the \u0026ldquo;Ubuntu\u0026rdquo; distro.","keywords":["windows","linux","wsl"],"articleBody":"Introduction WSL stands for Windows Subsystem for Linux which means we have the Linux kernel inside of windows. This is huge news for developers or people who just want to try Linux.\nPrerequisites Enable virtualisation in BIOS Setup Open Powershell in Administrator mode\nwsl --install You may be required to restart the device, I Highly recommend you do\nGo to the Microsoft store and search for a Linux distribution. I prefer to use the “Ubuntu” distro.\nOnce that is installed, go ahead and run the distribution, after it finishes setting itself up it will ask you for a username and password. These credentials are separate from the host system so you can make them whatever you want.\nAnd that’s it you have WSL and a Linux distribution setup, now go and do something awesome.\nOptional I use the windows terminal app to run the Ubuntu distribution, it makes customising the environment a lot easier. To download it head over to the Microsoft store and search for Windows Terminal and download it.\nWhen you login to WSL it will not default to your home directory which gets very annoying. So to fix that go to Windows Terminal Settings (Be sure to look around there are some cool features) look for Ubuntu or your distributions name and change the Starting directory to\n\\\\wsl$\\Ubuntu\\home\\ahmza Be sure to change “Ubuntu” to your distributions name\nBe sure to change “ahmza” to your username\nConclusion Well done you have managed to setup WSL and use Linux inside of windows. No go and enjoy the freedom of Linux !!\n","wordCount":"262","inLanguage":"en","image":"https://blog.ahmza.com/webp/posts/wsl/feature-anim.webp","datePublished":"2022-02-23T11:57:08Z","dateModified":"2022-02-23T11:57:08Z","author":{"@type":"Person","name":"ahmza"},"mainEntityOfPage":{"@type":"WebPage","@id":"https://blog.ahmza.com/posts/setup-wsl/"},"publisher":{"@type":"Organization","name":"ahmza's ramblings","logo":{"@type":"ImageObject","url":"https://blog.ahmza.com/img/favicon.png"}}}</script></head><body class=dark id=top><script>localStorage.getItem("pref-theme")==="light"&&document.body.classList.remove("dark")</script><header class=header><nav class=nav><div class=logo><a href=https://blog.ahmza.com accesskey=h title="ahmza's ramblings (Alt + H)">ahmza's ramblings</a><div class=logo-switches><button id=theme-toggle accesskey=t title="(Alt + T)"><svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg><svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22
Linux kernel inside of windows. This is huge news for developers or people
who just want to try Linux.</p><h2 id=prerequisites><strong>Prerequisites</strong><a hidden class=anchor aria-hidden=true href=#prerequisites>#</a></h2><ul><li>Enable virtualisation in BIOS</li></ul><h2 id=setup><strong>Setup</strong><a hidden class=anchor aria-hidden=true href=#setup>#</a></h2><p>Open Powershell in Administrator mode</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-powershell data-lang=powershell><span class=line><span class=cl><span class=n>wsl</span> <span class=p>-</span><span class=n>-install</span>
</span></span></code></pre></div><blockquote><p>You may be required to restart the device, I Highly recommend you do</p></blockquote><p>Go to the Microsoft store and search for a Linux distribution. I prefer
to use the &ldquo;Ubuntu&rdquo; distro.</p><p><img loading=lazy src=/img/WSL/ubuntu.webp alt="Microsoft Store"></p><p>Once that is installed, go ahead and run the distribution, after it
finishes setting itself up it will ask you for a username and password.
These credentials are separate from the host system so you can make them
whatever you want.</p><p>And that&rsquo;s it you have WSL and a Linux distribution setup, now go and do
something awesome.</p><h2 id=optional><strong>Optional</strong><a hidden class=anchor aria-hidden=true href=#optional>#</a></h2><p>I use the windows terminal app to run the Ubuntu distribution, it makes
customising the environment a lot easier. To download it head over to the
Microsoft store and search for Windows Terminal and download it.</p><p><img loading=lazy src=/img/WSL/winterm.webp alt="Microsoft Store"></p><p>When you login to WSL it will not default to your home directory which gets
very annoying. So to fix that go to Windows Terminal Settings (Be sure to
look around there are some cool features) look for Ubuntu or your
distributions name and change the Starting directory to</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-powershell data-lang=powershell><span class=line><span class=cl><span class=p>\\</span><span class=n>wsl</span><span class=p>$\</span><span class=n>Ubuntu</span><span class=p>\</span><span class=n>home</span><span class=p>\</span><span class=n>ahmza</span>
</span></span></code></pre></div><blockquote><p>Be sure to change &ldquo;Ubuntu&rdquo; to your distributions name</p></blockquote><blockquote><p>Be sure to change &ldquo;ahmza&rdquo; to your username</p></blockquote><p><img loading=lazy src=/img/WSL/winterm-settings.webp alt=winterm-settings></p><h2 id=conclusion><strong>Conclusion</strong><a hidden class=anchor aria-hidden=true href=#conclusion>#</a></h2><p>Well done you have managed to setup WSL and use Linux inside of windows.
No go and enjoy the freedom of Linux !!</p></div><footer class=post-footer><ul class=post-tags><li><a href=https://blog.ahmza.com/tags/windows/>windows</a></li><li><a href=https://blog.ahmza.com/tags/linux/>linux</a></li><li><a href=https://blog.ahmza.com/tags/wsl/>wsl</a></li></ul></footer></article></main><footer class=footer><span>&copy; 2023 <a href=https://blog.ahmza.com>ahmza's ramblings</a></span>
<span>Powered by
<a href=https://gohugo.io/ rel="noopener noreferrer" target=_blank>Hugo</a> &
<a href=https://github.com/adityatelange/hugo-PaperMod/ rel=noopener target=_blank>PaperMod</a></span></footer><a href=#top aria-label="go to top" title="Go to Top (Alt + G)" class=top-link id=top-link accesskey=g><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentcolor"><path d="M12 6H0l6-6z"/></svg></a><script src=https://storage.ko-fi.com/cdn/scripts/overlay-widget.js></script><script>kofiWidgetOverlay.draw("ahmza",{type:"floating-chat","floating-chat.donateButton.text":"Tip","floating-chat.donateButton.background-color":"rgb(145, 70, 255)","floating-chat.donateButton.text-color":"#fff"})</script><script>let menu=document.getElementById("menu");menu&&(menu.scrollLeft=localStorage.getItem("menu-scroll-position"),menu.onscroll=function(){localStorage.setItem("menu-scroll-position",menu.scrollLeft)}),document.querySelectorAll('a[href^="#"]').forEach(e=>{e.addEventListener("click",function(e){e.preventDefault();var t=this.getAttribute("href").substr(1);window.matchMedia("(prefers-reduced-motion: reduce)").matches?document.querySelector(`[id='${decodeURIComponent(t)}']`).scrollIntoView():document.querySelector(`[id='${decodeURIComponent(t)}']`).scrollIntoView({behavior:"smooth"}),t==="top"?history.replaceState(null,null," "):history.pushState(null,null,`#${t}`)})})</script><script>var mybutton=document.getElementById("top-link");window.onscroll=function(){document.body.scrollTop>800||document.documentElement.scrollTop>800?(mybutton.style.visibility="visible",mybutton.style.opacity="1"):(mybutton.style.visibility="hidden",mybutton.style.opacity="0")}</script><script>document.getElementById("theme-toggle").addEventListener("click",()=>{document.body.className.includes("dark")?(document.body.classList.remove("dark"),localStorage.setItem("pref-theme","light")):(document.body.classList.add("dark"),localStorage.setItem("pref-theme","dark"))})</script><script>document.querySelectorAll("pre > code").forEach(e=>{const n=e.parentNode.parentNode,t=document.createElement("button");t.classList.add("copy-code"),t.innerHTML="copy";function s(){t.innerHTML="copied!",setTimeout(()=>{t.innerHTML="copy"},2e3)}t.addEventListener("click",t=>{if("clipboard"in navigator){navigator.clipboard.writeText(e.textContent),s();return}const n=document.createRange();n.selectNodeContents(e);const o=window.getSelection();o.removeAllRanges(),o.addRange(n);try{document.execCommand("copy"),s()}catch{}o.removeRange(n)}),n.classList.contains("highlight")?n.appendChild(t):n.parentNode.firstChild==n||(e.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName=="TABLE"?e.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(t):e.parentNode.appendChild(t))})</script></body></html>