Trying to start development of plugins/addons for HA, using WSL2 [Debian] and VS Code on Windows. Followed this guide:
All extensions in VS Code installed, setup seems to work fine and all checks reporting correct results.
So, I opened my WSL terminal, moved into the HA cloned repo, and entered the command code . Sure enough VS Code started and presented the folder in WSL mode. I tried F1 Remote-Container: Open folder in Container but the option was missing. There are very fre Remote-Container: options. So I opened the repo locally (Windows) and now the option Remote-Container: Open folder in Container was available , so I selected it. Took a while but threw this error:
SECURITY WARNING: You are building a Docker image from Windows against a non-Win
dows Docker host. All files and directories added to build context will have '-r
wxr-xr-x' permissions. It is recommended to double check and reset permissions f
or sensitive files and directories.
[187347 ms] Start: Run: git rev-parse --show-toplevel
[187701 ms] Start: Run: docker events --format {{json .}} --filter status=started
[187748 ms] Start: Starting container
[187748 ms] Start: Run: docker run -a STDOUT -a STDERR --mount type=bind,source=//wsl$/Debian/home/daz/homeassistant/vscode-remote-try-node,target=/workspaces/vscode-remote-try-node,consistency=cached -l vsch.quality=stable -l vsch.remote.devPort=0 -l vsch.local.folder=\\wsl$\Debian\home\daz\homeassistant\vscode-remote-try-node --entrypoint /bin/sh vsc-vscode-remote-try-node-13bd8b4f47fbd65d0f4eb11d7f94b8df -c echo Container started ; while sleep 1; do :; done
C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from dae
mon: invalid mount config for type "bind": bind source path does not exist: /wsl
$/Debian/home/daz/homeassistant/vscode-remote-try-node.
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'.
[188447 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=\\wsl$\Debian\home\daz\homeassistant\vscode-remote-try-node --filter label=vsch.quality=stable
[188873 ms] Command failed: docker run -a STDOUT -a STDERR --mount type=bind,source=//wsl$/Debian/home/daz/homeassistant/vscode-remote-try-node,target=/workspaces/vscode-remote-try-node,consistency=cached -l vsch.quality=stable -l vsch.remote.devPort=0 -l vsch.local.folder=\\wsl$\Debian\home\daz\homeassistant\vscode-remote-try-node --entrypoint /bin/sh vsc-vscode-remote-try-node-13bd8b4f47fbd65d0f4eb11d7f94b8df -c echo Container started ; while sleep 1; do :; done
Something is wrong but I have no idea.
Also, why couldnt I open the HA repo , clonded to WSL, in a container from VS code?
Setup is:
Windows 10 Home build 19041 64bit , reports:
Virtualisation-based security Running
Virtualisation-based security required security properties
Virtualisation-based security available security properties Base Virtualisation Support
Virtualisation-based security services configured
Virtualisation-based security services running
Device Encryption Support Reasons for failed automatic device encryption: TPM is not usable, PCR7 binding is not supported, Hardware Security Test Interface failed and the device is not Modern Standby, Un-allowed DMA-capable bus/device(s) detected, TPM is not usable
A hypervisor has been detected. Features required for Hyper-V will not be displayed.
VS Code version 1.44.2
WSL is enabled in Windows and Kernel Update package applied
C:\Users\daz>wsl -l -v
NAME STATE VERSION
* Debian Running 2
docker-desktop Running 2
docker-desktop-data Running 2
C:\Users\daz>
Docker Desktop Edge installed on Windows
Docker version 19.03.8, build afacb8b
Docker in WSL installed:
Docker version 19.03.8, build afacb8b7f0
And I can run docker run hello-world both in WSL and Windows. Works fine.
So what’s the issue with opening the HA repo, cloned into WSL, as a Container using VS Code installed into Windows ?