Experience with Visual Studio using Windows Subsystem for Linux (WSL)?

rglissmann
Posts: 10
Joined: Wed Feb 19, 2020 1:08 am

Experience with Visual Studio using Windows Subsystem for Linux (WSL)?

Postby rglissmann » Fri Feb 28, 2020 1:51 am

Has anyone tried Visual Studio with WSL? I'm having so many problems with getting ESP-IDF examples to compile using Visual Studio after installing a MSYS2 environment. Microsoft is promoting the ESP32 with Azure so has created a setup script https://github.com/Azure-Samples/ESP-Sa ... all-script to encourage more developers. I'm wondering if WSL will be easier to get working.

ESP_bignacio
Posts: 221
Joined: Wed May 02, 2018 12:12 pm

Re: Experience with Visual Studio using Windows Subsystem for Linux (WSL)?

Postby ESP_bignacio » Fri Feb 28, 2020 3:11 am

Hi there, we have tested the experience with Visual Studio Code since they provide an extension called WSL Remote which they use for visual studio code remote, for WSL and containers running locally.

Relevant links

Visual Studio Code and WSL
WSL Remote extension

We have tested using our ESP-IDF extension for Visual Studio Code using Ubuntu 18.04 for WSL 1 and WSL 2. Idea is basically they have a server installed in WSL distro which communicates with Windows host Visual Studio Code program. WSL 2 still is not good for development since there is not serial communication support in WSL 2 at the moment.

Notes about WSL install:
  • Ubuntu WSL system comes with python3 (without python link) and no pip. Make sure you use sudo apt get update&& sudo apt get upgrade and sudo apt-get install python3-pip before installing ESP-IDF and tools.
  • WSL 1 has been reported quite slow by many users compared to WSL 2 (ie. filesystem IO tasks) but WSL 2 still has no serial port mapping (yet) and limited network capabilities. WSL 1 maps COM# ports to /dev/ttyS# as explained in Serial support in WSL 1
We have tested the extension and for WSL 1 in which we found that many commands seems to work fine such as build and GUI Menuconfig but let us know your experience by giving ESP-IDF extension for Visual Studio Code a try.

bbulkow
Posts: 20
Joined: Wed Jan 01, 2020 1:40 am

Re: Experience with Visual Studio using Windows Subsystem for Linux (WSL)?

Postby bbulkow » Mon Aug 10, 2020 4:39 am

Hi, I have been using WSL 1 as my primary compile environment for ESP-IDF for many months now and it works great.

I belive you should publish a guide for using it with the plugin, in remote mode just like you said.

For many of us, installing any software in the "command prompt" ( aka DOS ) is just very painful. Slashes. the ls command. And I don't want to go back to 1990 and install cygwin when MS made this amazing WSL and I never have to touch "DOS" again.

You say WSL 2 is fast and WSL 1 is slow is outdated and just not true. I saw the blog posts also. The blog posts refer to the speed of accessing disk _when going across formats_, that is, WSL 1 is slower when accessing the Linux partition, but should be faster for NTFS. I believe that the best use of WSL is as a command prompt to the shared file system, so use it that way. And, there were bugs a year ago.

I have just measured the speed of a full ESP-IDF project build of my small project. As expected, most of the time is spent in the ESP infrastructure, which, due to your recent fixes, only happens on clean rebuilds. (I just checked, a single-file rebuild is 20 seconds). This is on an up-to-date WIndows 10 as of early Aug 2020, and a very recent laptop 8 core, 32G memory, NVMe drive.

WSL1 - 2minutes 19 seconds
WSL2 - 7minutes 30sec

Project is on the NTFS partition, not in the Linux partition --- which is the right way, because NTFS is the actual format of the storage, and all your back tools, search tools, editors work perfectly.

I think the time difference is even bigger, eyeballing it. WSL1 run might have been fighting with something in the background.

VSStudio plus Remote WSL 1 should be _great_ and easy to configure, but I don't have it working. I am still stuck on the configuration pages, even though I have esp-idf, and idf.py building perfectly in the same shell. For idf.py, 'python' must be python2, and your instructions talk about python3, which is not used.

Please publish using WSL 1, VSStudio, and your plugin! Please!

Who is online

Users browsing this forum: No registered users and 13 guests