Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save xerootg/23387b8fb03278dde83e1a46f26f27e8 to your computer and use it in GitHub Desktop.

Select an option

Save xerootg/23387b8fb03278dde83e1a46f26f27e8 to your computer and use it in GitHub Desktop.

Revisions

  1. xerootg revised this gist Dec 5, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,7 @@ echo export DISPLAY=127.0.0.1:0.0 >> ~.bashrc
    echo sudo /etc/init.d/dbus start \&\> /dev/null >> ~.bashrc
    ```

    Now reload the file by executing `source ~/.bashrc` (or `source ~/.zshrc` if using ZSH).
    Now reload your profile by executing `source ~/.bashrc` (or `source ~/.zshrc` if using ZSH).

    ## Grant no-password access for dbus
    We now need to add a *sudoers* file to grant our user password-less root access to the dbus service.
  2. xerootg revised this gist Dec 5, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ This process was tested on WSL Ubuntu 18.04.
    2. Install the software on Windows

    ## Run all the things
    On your linux terminal, put this in some file:
    On your linux terminal, put this in some file and run it:
    ```sudo apt-get install libgtk2.0-0 -y
    sudo apt-get install libxss1 -y
    sudo apt-get install libasound2 -y
  3. xerootg revised this gist Dec 5, 2018. 1 changed file with 12 additions and 28 deletions.
    40 changes: 12 additions & 28 deletions Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -7,40 +7,24 @@ This process was tested on WSL Ubuntu 18.04.
    1. Dowload the VcXsrv installer from https://sourceforge.net/projects/vcxsrv/
    2. Install the software on Windows

    ## Add VS Code repositories
    On your linux terminal, execute the following commands to install some required dependences:
    ```bash
    sudo apt-get install libgtk2.0-0
    sudo apt-get install libxss1
    sudo apt-get install libasound2
    ```

    Then run the following commands to add the VS Code repos for apt:
    ```bash
    ## Run all the things
    On your linux terminal, put this in some file:
    ```sudo apt-get install libgtk2.0-0 -y
    sudo apt-get install libxss1 -y
    sudo apt-get install libasound2 -y
    cd ~
    curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
    sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
    sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
    sudo apt-get update -y
    sudo apt install code -y
    sudo apt install code-insiders -y
    echo \# X Server >> ~.bashrc
    echo export LIBGL_ALWAYS_INDIRECT=1 >> ~.bashrc
    echo export DISPLAY=127.0.0.1:0.0 >> ~.bashrc
    echo sudo /etc/init.d/dbus start \&\> /dev/null >> ~.bashrc
    ```

    ## Install VS Code on Linux
    Run the following to install VS Code on Linux:
    ```bash
    sudo apt update
    sudo apt install code
    sudo apt install code-insiders
    ```

    ## Bash config
    Add the following at the end of your `.bashrc` (or `.zshrc` if using ZSH):
    ```bash
    # X Server
    export LIBGL_ALWAYS_INDIRECT=1
    export DISPLAY=0:0
    sudo /etc/init.d/dbus start &> /dev/null
    ```
    Note: to edit your *bashrc* file you can run `nano ~/.bashrc` (or `nano ~/.zshrc` if using ZSH).

    Now reload the file by executing `source ~/.bashrc` (or `source ~/.zshrc` if using ZSH).

    ## Grant no-password access for dbus
  4. @fedme fedme revised this gist Sep 14, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -77,4 +77,5 @@ On Linux, add the following at the end of your `.bashrc` (or `.zshrc` if using Z
    ```bash
    export GDK_SCALE=2
    ```
    Note: to edit your *bashrc* file you can run `nano ~/.bashrc` (or `nano ~/.zshrc` if using ZSH).
    Note: to edit your *bashrc* file you can run `nano ~/.bashrc` (or `nano ~/.zshrc` if using ZSH).
    Then reload the file by executing `source ~/.bashrc` (or `source ~/.zshrc` if using ZSH).
  5. @fedme fedme revised this gist Sep 14, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -58,7 +58,7 @@ your_username ALL = (root) NOPASSWD: /etc/init.d/dbus

    ## Launch VS Code
    1. On Windows launch the recently installed *XLaunch* app.
    2. In the dialog, always choose *Next* and then *Finish*
    2. In the dialog, always choose *Next* and then *Finish*. NOTE: uncheck the *Primary selection* checkbox in the 3rd step otherwise everything you select in VS Code will also be copied in the clipboard.
    3. Finally, on your linux terminal, navigate to your desired folder and run `code .` (or `code-insiders .`)
    4. VS Code for Linux should launch

  6. @fedme fedme revised this gist Sep 14, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -41,6 +41,8 @@ sudo /etc/init.d/dbus start &> /dev/null
    ```
    Note: to edit your *bashrc* file you can run `nano ~/.bashrc` (or `nano ~/.zshrc` if using ZSH).

    Now reload the file by executing `source ~/.bashrc` (or `source ~/.zshrc` if using ZSH).

    ## Grant no-password access for dbus
    We now need to add a *sudoers* file to grant our user password-less root access to the dbus service.
    1. Run the following command:
  7. @fedme fedme revised this gist Aug 28, 2018. 1 changed file with 18 additions and 2 deletions.
    20 changes: 18 additions & 2 deletions Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -39,7 +39,6 @@ export LIBGL_ALWAYS_INDIRECT=1
    export DISPLAY=0:0
    sudo /etc/init.d/dbus start &> /dev/null
    ```

    Note: to edit your *bashrc* file you can run `nano ~/.bashrc` (or `nano ~/.zshrc` if using ZSH).

    ## Grant no-password access for dbus
    @@ -59,4 +58,21 @@ your_username ALL = (root) NOPASSWD: /etc/init.d/dbus
    1. On Windows launch the recently installed *XLaunch* app.
    2. In the dialog, always choose *Next* and then *Finish*
    3. Finally, on your linux terminal, navigate to your desired folder and run `code .` (or `code-insiders .`)
    4. VS Code for Linux should launch
    4. VS Code for Linux should launch

    ## VS Code is blurry on High DPI monitors
    If you use a 4K monitor, chances are your VS Code appears blurry. There is a workaround for this but, at least on my machine, it makes VS Code laggy and a bit unresponsive. Anyways, here it is:

    On windows:
    1. Open the `C:\Program Files\VcXsrv` folder.
    2. Right click on the `vcxserver.exe` file and choose `Properties`.
    3. From the `Compatibility` tab, click the `Change hi DPI settings` button.
    4. Turn on the `Override high DPI scaling behaviour` checkbox and choose `Application` in the dropdown menu just below.
    5. Press `OK` and save.
    6. Close VcXserver and re-launch it.

    On Linux, add the following at the end of your `.bashrc` (or `.zshrc` if using ZSH):
    ```bash
    export GDK_SCALE=2
    ```
    Note: to edit your *bashrc* file you can run `nano ~/.bashrc` (or `nano ~/.zshrc` if using ZSH).
  8. @fedme fedme revised this gist Aug 28, 2018. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -48,11 +48,12 @@ We now need to add a *sudoers* file to grant our user password-less root access
    ```bash
    sudo visudo -f /etc/sudoers.d/dbus
    ```
    2. Then paste the following text inside the editor that will launch (**Replace `your_username` with your linux username**):
    2. Then paste the following text inside the Nano editor that will launch (**Replace `your_username` with your linux username**):
    ```bash
    your_username ALL = (root) NOPASSWD: /etc/init.d/dbus
    ```
    3. Now close you Linux terminal and open a new one.
    3. Press `CTRL+O` to save the file, then press `Enter` to confirm. Finally, press `CTRL+X` to close the Nano editor.
    4. Now close you Linux terminal and open a new one.

    ## Launch VS Code
    1. On Windows launch the recently installed *XLaunch* app.
  9. @fedme fedme revised this gist Aug 28, 2018. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,17 @@ sudo /etc/init.d/dbus start &> /dev/null

    Note: to edit your *bashrc* file you can run `nano ~/.bashrc` (or `nano ~/.zshrc` if using ZSH).

    Now close you Linux terminal and open a new one.
    ## Grant no-password access for dbus
    We now need to add a *sudoers* file to grant our user password-less root access to the dbus service.
    1. Run the following command:
    ```bash
    sudo visudo -f /etc/sudoers.d/dbus
    ```
    2. Then paste the following text inside the editor that will launch (**Replace `your_username` with your linux username**):
    ```bash
    your_username ALL = (root) NOPASSWD: /etc/init.d/dbus
    ```
    3. Now close you Linux terminal and open a new one.

    ## Launch VS Code
    1. On Windows launch the recently installed *XLaunch* app.
  10. @fedme fedme revised this gist Aug 28, 2018. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,9 @@ export DISPLAY=0:0
    sudo /etc/init.d/dbus start &> /dev/null
    ```

    Then close you Linux terminal and open a new one.
    Note: to edit your *bashrc* file you can run `nano ~/.bashrc` (or `nano ~/.zshrc` if using ZSH).

    Now close you Linux terminal and open a new one.

    ## Launch VS Code
    1. On Windows launch the recently installed *XLaunch* app.
  11. @fedme fedme revised this gist Aug 28, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    # Run Visual Studio Code for Linux from WSL
    Thanks a lot to [mredbishop](https://github.com/mredbishop) and others for their insturctions posted [here](https://github.com/Microsoft/WSL/issues/2760). This is just a recap of what they figured out.

    This process was tested on WSL Ubuntu 18.04.

    ## Install VcXsrv on Windows
    1. Dowload the VcXsrv installer from https://sourceforge.net/projects/vcxsrv/
    2. Install the software on Windows
  12. @fedme fedme revised this gist Aug 28, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Run Visual Studio Code for Linux from WSL
    Thanks lot to [mredbishop](https://github.com/mredbishop)
    Thanks a lot to [mredbishop](https://github.com/mredbishop) and others for their insturctions posted [here](https://github.com/Microsoft/WSL/issues/2760). This is just a recap of what they figured out.

    ## Install VcXsrv on Windows
    1. Dowload the VcXsrv installer from https://sourceforge.net/projects/vcxsrv/
  13. @fedme fedme revised this gist Aug 28, 2018. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -21,6 +21,14 @@ sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
    sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
    ```

    ## Install VS Code on Linux
    Run the following to install VS Code on Linux:
    ```bash
    sudo apt update
    sudo apt install code
    sudo apt install code-insiders
    ```

    ## Bash config
    Add the following at the end of your `.bashrc` (or `.zshrc` if using ZSH):
    ```bash
  14. @fedme fedme revised this gist Aug 28, 2018. 1 changed file with 18 additions and 1 deletion.
    19 changes: 18 additions & 1 deletion Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -19,4 +19,21 @@ cd ~
    curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
    sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
    sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
    ```
    ```

    ## Bash config
    Add the following at the end of your `.bashrc` (or `.zshrc` if using ZSH):
    ```bash
    # X Server
    export LIBGL_ALWAYS_INDIRECT=1
    export DISPLAY=0:0
    sudo /etc/init.d/dbus start &> /dev/null
    ```

    Then close you Linux terminal and open a new one.

    ## Launch VS Code
    1. On Windows launch the recently installed *XLaunch* app.
    2. In the dialog, always choose *Next* and then *Finish*
    3. Finally, on your linux terminal, navigate to your desired folder and run `code .` (or `code-insiders .`)
    4. VS Code for Linux should launch
  15. @fedme fedme revised this gist Aug 28, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,7 @@ sudo apt-get install libasound2

    Then run the following commands to add the VS Code repos for apt:
    ```bash
    cd ~
    curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
    sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
    sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
  16. @fedme fedme revised this gist Aug 28, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Run Visual Studio Code for Linux from WSL
    Thanks lot to (https://github.com/mredbishop)[mredbishop]
    Thanks lot to [mredbishop](https://github.com/mredbishop)

    ## Install VcXsrv on Windows
    1. Dowload the VcXsrv installer from https://sourceforge.net/projects/vcxsrv/
  17. @fedme fedme created this gist Aug 28, 2018.
    21 changes: 21 additions & 0 deletions Run Visual Studio Code for Linux from WSL.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    # Run Visual Studio Code for Linux from WSL
    Thanks lot to (https://github.com/mredbishop)[mredbishop]

    ## Install VcXsrv on Windows
    1. Dowload the VcXsrv installer from https://sourceforge.net/projects/vcxsrv/
    2. Install the software on Windows

    ## Add VS Code repositories
    On your linux terminal, execute the following commands to install some required dependences:
    ```bash
    sudo apt-get install libgtk2.0-0
    sudo apt-get install libxss1
    sudo apt-get install libasound2
    ```

    Then run the following commands to add the VS Code repos for apt:
    ```bash
    curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
    sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
    sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
    ```