DEV Community

Sunny Shankar
Sunny Shankar

Posted on

Code in Windows, run in Linux!

Currently I'm using Ubuntu on Windows with Oh My ZSH Shell.

Alt Text

Alt Text

Here is are the steps on how I got it running like seen above.

Install Windows Subsystem Linux — https://docs.microsoft.com/en-us/windows/wsl/install-win10

Install Ubuntu on Windows from Microsoft Store — https://www.microsoft.com/en-us/p/ubuntu/9nblggh4msv6

Install ZSH on Ubuntu Bash

  • Run this Command on Ubuntu Bash
    sudo apt-get install zsh

  • Open Bash Profile by Command
    vim ~/.bashrc

  • Add this at the top of File to set ZSH as defualt:
    bash -c zsh

Install Oh My ZSH

  • Run this command sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Change the ZSH Theme to agnoster

  • Open Bash Profile
    vim ~/.bashrc

  • Change ZSH_THEME to agnoster from robbyrussell
    # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
    ZSH_THEME="agnoster"

Use Ubuntu Bash in VS Code

Open a Remote Folder or Workspace

  1. Open a WSL terminal window (using the start menu item or by typing wsl from a command prompt / PowerShell).
  2. Navigate to a folder you'd like to open in VS Code (including, but not limited to, Windows filesystem mounts like /mnt/c
  3. Type code . in Bash. This should take a while, and is only needed once.
  4. Once finished, you now see a WSL indicator in the bottom left corner, and you'll be able to use VS Code as you would normally! Alt Text That's it! Any VS Code operations you perform in this window will be executed in the WSL environment.

Hope You enjoy this tips.

Top comments (6)

Collapse
 
delta456 profile image
Swastik Baranwal

Most people like WIndows GUI

Collapse
 
devencourt profile image
Brian Bethencourt

i use windows mixed reality for VR, which I don't think linux supports yet;;

Collapse
 
nguyenhai97ict profile image
Nguyễn Đăng Hải

Commercial software of course

Collapse
 
dgonzalezr profile image
Dabiel González Ramos • Edited

Maybe IE is it still needed 😉, testing purpose or some other reason 👌

Collapse
 
devhammed profile image
Hammed Oyedele

Yeah, I have been using Linux for over 2 years now and I have not seen a single reason to use Windows at all.

 
dgonzalezr profile image
Dabiel González Ramos • Edited

Not only 🙂, as a software engineer, perhaps you can find yourself in the situation where you work on some project (legacy or not) still bein forced to support IE.