Skip to content

Instantly share code, notes, and snippets.

@gary-jipp
Last active January 22, 2024 20:00
Show Gist options
  • Save gary-jipp/fb4a6435e1d6935180f89427cad8909d to your computer and use it in GitHub Desktop.
Save gary-jipp/fb4a6435e1d6935180f89427cad8909d to your computer and use it in GitHub Desktop.

Lighthouse Windows 10/11 WSL2 Setup

Important Note: once you have the LHL image running and see the "lighthouse" logo when you connect to it, you are good to go. Do NOT follow the Vagrant instructions in Compass after setting up WSL. WSL replaces Vagrant completely. You should skip over the VM setup section of Compass and move on to the next section.

After you are finished, install Windows Terminal

Note: the default user is: labber password: labber


Do NOT follow any instructions you have have found online for installing a WSL linux. We will be installing a custom WSL Linux image. If you installed an Ubuntu or other WSL VM you just wasted a lot of time and are going to have to remove it.

1. Check your WSL.

Ensure that your WSL2 is installed working correctly. You may need to upgrade your WSL if you are not running WSL2. Open a powershell window "as Administrator" and enter the following:

wsl --status

If you have WSL2 installed, you should see Kernel version: 5.15.133.1 (or something similar). If you get a long list of command options, you have WSL1 and you need to upgrade before importing the LHL image. If you see the correct version skip to step 3

2. Upgrading your WSL to WSL2.

  • Go to the Windows Search Bar

  • type "feature"

  • select "Turn Windows Features On and Off"

  • enable these:

    • Windows Subsystem for Linux
    • Virtual Machine Platform
    • press OK
  • You will need to reboot

  • Open Windows Command Prompt or PowerShell as Admin

  • enter wsl --update

  • Let it update WSL

  • check the WSL version as in Part 1 above

  • that's it!

3. Download and extract the LHL Linux image.

Note you do NOT run PowerShell as Administrator anymore

Download the following image: https://bit.ly/3o9gHuZ (Its big!)

Unzip the downloaded file to someplace you can find it later, and delete the original zip (they are both huge)

4. Import the tar file you extracted into your WSL.

https://www.windowscentral.com/how-import-windows-subsystem-linux-wsl-distribution-tar-file

You can give the new VM any name you want, but its a good idea to name it something meaningful, like Lighthouse. Don't use spaces in names; that's just bad practice in Linux anyway and will really screw you up later.

Its safe to delete the tar file once you have imported it. But you may want to keep it in case you need to rebuild your VM

Hopefully you read the part that said "not as Administrator". If not, you'll probably need to import again.

5. Install Windows Terminal

Windows Terminal is actually a really great terminal program.

You can figure out how to install this one. You want to be a software developer, right? Time to start thinking for yourself :)

Windows Terminal should notice Your new Lighthouse image. You can even set that as the default when it starts.

Create a shortcut on your desktop to wt.exe.

How to use your Lighthouse WSL

Start your WSL

  • open the Lighthouse terminal in Windows Terminal
  • don't have Windows Terminal yet? You need to istall it now. Its really great, surprising coming from Microsoft! :)

Username / password

  • The username for anything that asks is: labber password: labber
  • It should not ask however, unless you've changed something. Don't do that!

Edit any project / folder (same thing really):

  • cd <folder name>
  • code . (that's a period)
  • Fun fact: when you see something in pointy braces, like <folder name>, that means its a placeholder only. You should replace it with the actual folder name you want to open. If you actually type <folder name> you're going to get some interestin, and likely unwanted, results.

Browse WSL folders in Windows

  • e . (that's also a period :) )

  • note: never open VSCode from Windows and then try to open a file on the WSL file system. This is incredibly slow and inefficent so just don't do that!. VSCode should always be started from within WSL.

  • There is a way to create a WSL VSCode shortcut on your windows terminal but that's not recommened since then you'll be tempted to just open that one folder in VSCode and try to put ALL of your project folders underneath there; an unbelievably bad idea and one you will regret pretty fast! 1 folder = 1 VSCode window. 2nd folder = 2nd VSCode Window! Don't say I didn't try to warn you :)

Some time-saving shortcuts

  • You can change the settings of Windows Terminal to make your new Lighthouse WSL the startup (default) shell. It tends to save time
  • You can make a desktop shortcut to your Windows Terminal. Make a shortcut to wt.exe on the desktop. This is really handy.
  • In the settings, increase the font size a bit to make it easier to see. This will also assist mentors when they ask to see your terminal when they help you. You may have that cool 52" monitor but to the mentor your windows will look like postage stamps and screen fonts will look microscopic!

VSCode tips

  • you can configure the fonts and colors in your VSCode to anything you want but we recommend you leave the color scheme as the default dark (or light if you prefer). When you are in Mentor Sessions it can often be difficult for Mentors to see your screen if you have some exotic color scheme.
  • In case you missed it above, do NOT use VSCode to open just your root directory and have all your files and folders in a single instance of VSCode. VSCode is not your file browser. Its supposed to open single projects only. If you want to work on multiple projects, you should have multiple VSCode windows open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment