Hi guys
I did a search of the forums for a problem I am having, and I came across this thread.
I am seeking to be able to use my Windows 10 laptop with WSL Debian installed, for homeassistant development, using native VS Code on Windows, running dev containers in the remote linux WSL Debian.
I cannot get a working setup following the guide linked above (https://developers.home-assistant.io/docs/en/development_environment.html)
What I did:-
-
I already had Windows 10 HOME installed.
-
I joined the MS Insider programme and got updates to Win10.
It is now Version 10.0.19041.208]
-
installed Debian buster (10) from MS Store.
-
I applied the kernel update package (wsl_update_x64.msi)
-
I enabled WSL 2 and then I installed Docker Desktop Edge
$ docker --version
Docker version 19.03.8, build afacb8b
$ wsl -l -v
NAME STATE VERSION
* Debian Running 2
docker-desktop Running 2
docker-desktop-data Running 2
- I installed Visual Studio Code
C:\users\daz> code --version
1.44.2
ff915844119ce9485abfe8aa9076ec76b5300ddd
x64
-
then I installed the remote-development-extension-pack
-
then in git I forked home assistant
-
then in SWL Debian, I cloned the home assistant repository
$ git clone https://github.com/myaccount/home-assistant.git
So, this is where I am confused.
Am I supposed to be able to open the home assistant repo on my WSL Debian, using VS Code starting it from within the WSL, such as:
$ code .
…because when code fires up, it does not build the devcontainer. The option Remote-Containers: Reopen file in Container is NOT available. I do have the remote connection enabled icon (bottom left of code window)
As I say, pressing F1 and typing
Remote-Containers: does not bring up the
Reopen folder in container
Should it?
- So then I tried opening VS Code from Windows, and now pressing F1 does bring up the Reopen Folder in Container so I select it and then Windows File Explorer opens. Of course the cloned repo is in my WSL Debian and not on the native Windows 10.
- So if I type \wsl$ in the folder bar, now I can navigate to the cloned repo.
- Then VS Code does indeed build the container but now it doesnt run , here is the output from the Terminal within VS code:
[1 ms] Start: Resolving remote
[8 ms] Setting up container for folder or workspace: \\wsl$\Debian\home\daz\home-assistant
[263 ms] Start: Check Docker is running
[265 ms] Start: Run: docker info
[2982 ms] Start: Run: docker ps -q -a --filter
label=vsch.local.folder=\\wsl$\Debian\home\daz\home-assistant --filter label=vsch.quality=stable
[4404 ms] Start: Run: docker build -f /home/daz/home-assistant/Dockerfile.dev -t vsc-home-assistant-86765831bccf30b8a2d46179719fb5c0 /home/daz/home-assistant
Sending build context to Docker daemon 27.43MB
Step 1/8 : FROM python:3.8
3.8: Pulling from library/python
90fe46dd8199: Extracting 41.42MB/50.38MB
35a4f1977689: Download complete
bbc37f14aded: Download complete
74e27dc593d4: Download complete
4352dcff7819: Downloading 121.5MB/192.2MB
deb569b08de6: Download complete
98fd06fa8c53: Download complete
7b9cc4fdefe6: Download complete
512732f32795: Download complete
context canceled
[475856 ms] Command failed: docker build -f /home/daz/home-assistant/Dockerfile.dev -t vsc-home-assistant-86765831bccf30b8a2d46179719fb5c0 /home/daz/home-assistant
Where am I going wrong?
EDIT:
If , in my WSL , I move the repo folder /home/daz/homeassistant to /mnt/c/Users/daz/homeassistant then, now if I open VS Code from windows, and use F1 Remote-Containers: Open folder in Container, explorer appears and I can of course open the repo AND it builds the dev-container.
BUT
I read on the Dev guide that putting files in /mnt/c/ is slow and not good practice, but for me its the only way it all works.