VsCode Run DevContainer on WSL does not increase its perfomance

99 views Asked by At

I am trying to run a 2gb file into a VsCode Dev container in Windows and it takes more than 3 minutes just to open it and read it (I am using python language).

I read docker in windows is very slow so if I want to improve its performance I have to run it through WSL. This is the guide I followed:

  1. check WSL installation: on command prompt run wsl - - status
  2. installing WSL : How to Install WSL2 on Windows 11 (Windows Subsystem for Linux)
  3. Oracle Linux Installation: wsl.exe - - install -d OracleLinux_8_7
  4. Set OracleLinux as default distribution: wsl -s OracleLinux_8_7
  5. From DockerDesktop: Settings(next to sign in) => Resources => WSL Integration => Enable integration with additional distros => OracleLinux_8_7
  6. From a new command prompt: wsl
  7. Installing git: sudo dnf install git
  8. clone the repository
  9. Activating VsCode: enter in the git report (cd/repo_name) and type code .
  10. click on Reopen in Container

As I was expecting, the script opened the file in few seconds (3 or 4); on the left side of VsCode I could see: "mnt/c/Users/path_to_my_folder [WSL:OracleLinux_8_7].

I rebooted my computer and typed wsl on command prompt; then I went to my folder directory and then I type code . and I clicked on ReopenDevContainer. On the left side I did not see my linux directory anymore (PROJECTNAME: DockerExistingFile) and when I launched my script it took more than 4 minutes to be executed. It seems my container is no longer running on linux; how can I fix that?

Solution

The solution was very easy, typing wsl from command line it brings me into my windows user directory so I just had to do: cd /home/my_user_linux

0

There are 0 answers