Categories
Blog Software & Apps

How to Install WSL on Windows 11 and Set Up Ubuntu

Bookmark (0)
ClosePlease login

If you're working in numerical modeling simulation, etc, using multiple tool, you might encounter that sum tool are only available in Linux distribution. and it becomes very painful as a Windows user to dual boot, ubuntu and windows. Thus, one of the best solutions is using wsl where you can easily use Linux distributions Basically, ubuntu softwares easily within windows, and copy file like normal windows folder.

Windows Subsystem for Linux (WSL) allows you to run a Linux distribution alongside your Windows system. This guide will walk you through installing WSL on Windows 11, setting up Ubuntu, creating a Start Menu shortcut, and ensuring the terminal starts in your Linux home directory.

Step 1: Install WSL

  1. Open PowerShell as Administrator:
    • Press Win + X and select Windows Terminal (Admin).
  2. Install WSL:
    • Run the following command in the terminal: wsl --install
    • If prompted, restart your computer.
  3. Set WSL 2 as the Default Version:
    • After your system restarts, open PowerShell again as Administrator and run: wsl --set-default-version 2
  4. Install Ubuntu:
    • To install a specific Linux distribution like Ubuntu 22.04, run: wsl --install -d Ubuntu-22.04
    • Wait for the installation to complete. This may take a few minutes.
  5. Resolve Kernel Update Issues:
    • If you encounter an error like Error: 0x800701bc, you need to update the WSL kernel. Run: wsl --update
    • After the update, try installing the distribution again.
  6. Launch Ubuntu:
    • Once installed, you can launch Ubuntu by simply typing: wsl
    • This will open the terminal in your default Linux distribution.

Step 2: Create a Start Menu and Desktop Shortcut for Ubuntu

  1. Pin Ubuntu to Start Menu:
    • Open the Start Menu and search for Ubuntu.
    • Right-click on the Ubuntu app (e.g., Ubuntu 22.04 LTS) and select Pin to Start.
  2. Create a Desktop Shortcut:
    • Right-click on your Desktop and select New > Shortcut.
    • In the shortcut location field, type: wsl.exe -d Ubuntu-22.04
    • Replace Ubuntu-22.04 with the actual name of your installed distribution.
    • Click Next, name the shortcut (e.g., "Ubuntu 22.04"), and click Finish.
  3. (Optional) Change the Shortcut Icon:
    • Right-click the newly created shortcut on your Desktop and select Properties.
    • Click on Change Icon... under the Shortcut tab.
    • Browse to the Ubuntu executable or use a custom icon.

Step 3: Configure the Default Starting Directory in WSL

  1. Navigate to Your Home Directory:
    • When you start WSL, it may open in a Windows directory like C:\\\\Windows\\\\system32. To move to your Linux home directory, simply run: cd ~
  2. Set the Home Directory as Default:
    • To automatically start in your Linux home directory, edit the .bashrc file: nano ~/.bashrc
    • Add the following line at the end of the file: cd ~
    • Save and exit the editor (press CTRL + X, then Y, then Enter).
  3. Modify the Shortcut to Start in the Home Directory:
    • Right-click on the Ubuntu shortcut on your Desktop and select Properties.
    • In the Target field, add -cd ~ at the end:
    • wsl.exe -d Ubuntu-22.04 --cd ~
    • Click Apply and then OK.

Now, you've successfully installed WSL, set up Ubuntu, and configured your environment to start in the home directory. This setup allows for a seamless Linux experience on Windows 11.


For help in modelling in any FEA, FDTD, DFT Simulation / Modelling work, you can contact us (bkcademy.in@gmail.com) or in any platform.

Interested to Learn Engineering modelling? Check our Courses?

u can follow us on social media

Share the resource

-.-.-.-.-.-.-.-.-.().-.-.-.-.-.-.-.-.-

bkacademy

Leave a Reply

Your email address will not be published. Required fields are marked *