siderolabs / talos

Talos Linux is a modern Linux distribution built for Kubernetes.
https://www.talos.dev
Mozilla Public License 2.0
6.83k stars 546 forks source link

Wsl2 Image #8673

Open jkfnc opened 6 months ago

jkfnc commented 6 months ago

Feature Request

Wsl2 image to make use of Host GPU

Description

Would be good to have WSL2 talos image tar file for running on windows machines , as GPU is owned by the host windows , only wsl2 allows for sharing to its guest. Hyper-V does not allow this.

jkfnc commented 6 months ago

Here is what happens currently, the image does not start

https://learn.microsoft.com/en-us/windows/wsl/use-custom-distro

Inside WSL Ubuntu with docker installed: docker run --rm -it \ --name tutorial \ --hostname talos-cp \ --read-only \ --privileged \ --security-opt seccomp=unconfined \ --mount type=tmpfs,destination=/run \ --mount type=tmpfs,destination=/system \ --mount type=tmpfs,destination=/tmp \ --mount type=volume,destination=/system/state \ --mount type=volume,destination=/var \ --mount type=volume,destination=/etc/cni \ --mount type=volume,destination=/etc/kubernetes \ --mount type=volume,destination=/usr/libexec/kubernetes \ --mount type=volume,destination=/opt \ -e PLATFORM=container \ ghcr.io/siderolabs/talos:v1.7.0

once container is running

dockerContainerID=$(docker container ls -a | grep -i talos | awk '{print $1}')

docker export $dockerContainerID > /mnt/c/temp/talos.tar

On Windows: PS C:\Users\>cd C:\temp PS C:\Users\>mkdir C:\wslDistroStorage\CentOS

PS C:\Users\> wsl --import Talos C:\wslDistroStorage\Talos C:\temp\talos.tar Import in progress, this may take a few minutes. The operation completed successfully. PS C:\Users\> wsl -l -v NAME STATE VERSION Talos Stopped 2

PS C:\Users\> wsl -d Talos

<3>WSL (10) ERROR: CreateProcessParseCommon:711: Failed to translate C:\Users\ <3>WSL (10) ERROR: CreateProcessParseCommon:757: getpwuid(0) failed 2 <3>WSL (10) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files\Microsoft MPI\Bin\ <3>WSL (10) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler <3>WSL (10) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows\system32 <3>WSL (10) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows <3>WSL (10) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows\System32\Wbem <3>WSL (10) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows\System32\WindowsPowerShell\v1.0\ <3>WSL (10) ERROR: UtilTranslatePathList:2866: Failed to translate C:\Windows\System32\OpenSSH\
MHHenriksen commented 1 month ago

Late reply, but maybe check https://learn.microsoft.com/en-us/windows/wsl/wsl-config#interop-settings and disable the interop features, especially adding Windows paths to the linux env.