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