microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.24k stars 811 forks source link

TPM support in WSL distros #5178

Open Firehawke opened 4 years ago

Firehawke commented 4 years ago

Is your feature request related to a problem? Please describe. I'd like to be able to allow Linux to use the TPM module so that I can use it for SSH, GPG, etc from the Linux side of things.

Describe the solution you'd like I'd like for either Linux to be able to directly talk to the TPM or for some intermediary method (similar to how you can already pass SSH key requests from Linux over to the Windows side using wsl-ssh-agent-gui)

How access is obtained doesn't particularly matter so long as it's possible to access and use from either side (Windows and Linux both)

therealkenc commented 3 years ago

image

lzlrd commented 3 years ago

@therealkenc, to support the feature mentioned we'd need some form of a vTPM provided to the guest by the hypervisor (on top of the said config being enabled) but it seems Hyper-V already has such a feature according to https://docs.microsoft.com/en-us/powershell/module/hyper-v/enable-vmtpm.

Jayonics commented 2 years ago

@therealkenc, to support the feature mentioned we'd need some form of a vTPM provided to the guest by the hypervisor (on top of the said config being enabled) but it seems Hyper-V already has such a feature according to https://docs.microsoft.com/en-us/powershell/module/hyper-v/enable-vmtpm.

I tried going along with this method. I'm not sure if this post refers to WSL2 or WSL v1 - but WSL2 distros do not appear as HyperV Virtual Machines so it's not possible to Enable-VMTPM on any of the running WSL2 distros as they don't appear in either Get-VM or in Hyper-V Manager.

lzlrd commented 2 years ago

@therealkenc, to support the feature mentioned we'd need some form of a vTPM provided to the guest by the hypervisor (on top of the said config being enabled) but it seems Hyper-V already has such a feature according to https://docs.microsoft.com/en-us/powershell/module/hyper-v/enable-vmtpm.

I tried going along with this method. I'm not sure if this post refers to WSL2 or WSL v1 - but WSL2 distros do not appear as HyperV Virtual Machines so it's not possible to Enable-VMTPM on any of the running WSL2 distros as they don't appear in either Get-VM or in Hyper-V Manager.

WSL2 isn't run on Hyper-V (as in, the userland Hyper-V API), so cannot be "controlled" with the PowerShell features as such. I merely mentioned it in that it exists in one of the Hyper-V APIs so it shouldn't be impossible to add such a feature to another.

Luk164 commented 1 year ago

Has there been any progress on this issue?

masalinas commented 1 year ago

my WSL2 Ubuntu distrinution not detect my TPM module activated and not create any /dev/tpm0 device file to be used. How can I resolve that?

purplelemons-dev commented 1 year ago

I'd like to use this feature with WSL2 Debian--it's not necessary or anything, I'm just wondering if it's possible.

Aetherinox commented 9 months ago

Highly interested (and in need) of this. Some type of update / priority on this would be absolutely amazing.