<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re:SGX in WSL2 in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-in-WSL2/m-p/1233982#M4155</link>
    <description>&lt;P&gt;&lt;B&gt;This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.&lt;/B&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 03 Dec 2020 19:09:40 GMT</pubDate>
    <dc:creator>JesusG_Intel</dc:creator>
    <dc:date>2020-12-03T19:09:40Z</dc:date>
    <item>
      <title>SGX in WSL2</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-in-WSL2/m-p/1232231#M4138</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I guess that many of you know WSL (Windows Subsystem for Linux). Since a few month, WSL2 can be used on many Windows versions and according to Microsoft, "&lt;SPAN&gt;WSL 2 uses the latest and greatest in virtualization technology to run a Linux kernel inside of a lightweight utility virtual machine".&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For me, it would severely facilitate SGX development if I can use WSL2 for this task. There might be some unsolvable problems that I'm not aware of, but I tried to do it anyhow. In the following, I'll describe the steps I took and the problem I'm currently facing. I hope that somebody can help me with the problem or can tell me why this is not possible at all.&lt;BR /&gt;&lt;BR /&gt;First, I tried to just install the driver:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sudo ./sgx_linux_x64_driver_2.11.0_4505f07.bin&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, /lib/modules is empty leading to the following error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Unpacking Intel SGX Driver ... done.
Verifying the integrity of the install package ... done.
Installing Intel SGX Driver ...
/tmp/sgx-driver-bQXOE0 ~/downloads
install -d /opt/intel/sgxdriver/package
install -d /opt/intel/sgxdriver/scripts
install package/* /opt/intel/sgxdriver/package
install scripts/* /opt/intel/sgxdriver/scripts
~/downloads
/opt/intel/sgxdriver/package ~/downloads
make -C /lib/modules/4.19.128-microsoft-standard/build M=/opt/intel/sgxdriver/package modules
make[1]: *** /lib/modules/4.19.128-microsoft-standard/build: No such file or directory.  Stop.
Makefile:16: recipe for target 'default' failed
make: *** [default] Error 2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus, I downloaded the kernel (from &lt;A href="https://github.com/microsoft/WSL2-Linux-Kernel/releases/tag/4.19.128-microsoft-standard" target="_blank"&gt;https://github.com/microsoft/WSL2-Linux-Kernel/releases/tag/4.19.128-microsoft-standard&lt;/A&gt;), extracted the kernel, configured the kernel, setup the kernel for external modules, and created a link at the expected location:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ wget https://github.com/microsoft/WSL2-Linux-Kernel/archive/4.19.128-microsoft-standard.tar.gz
$ tar xf 4.19.128-microsoft-standard.tar.gz
$ cd WSL2-Linux-Kernel-4.19.128-microsoft-standard/
$ make defconfig
$ sudo make modules_prepare
$ sudo mkdir -p /lib/modules/4.19.128-microsoft-standard
$ sudo ln -s /home/***/WSL2-Linux-Kernel-4.19.128-microsoft-standard/ /lib/modules/4.19.128-microsoft-standard/build&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At this point, the installation seems successful:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ sudo ./sgx_linux_x64_driver_2.11.0_4505f07.bin
Unpacking Intel SGX Driver ... done.
Verifying the integrity of the install package ... done.
Installing Intel SGX Driver ...
/tmp/sgx-driver-1cgy4Z ~/downloads
install -d /opt/intel/sgxdriver/package
install -d /opt/intel/sgxdriver/scripts
install package/* /opt/intel/sgxdriver/package
install scripts/* /opt/intel/sgxdriver/scripts
~/downloads
/opt/intel/sgxdriver/package ~/downloads
make -C /lib/modules/4.19.128-microsoft-standard/build M=/opt/intel/sgxdriver/package modules
make[1]: Entering directory '/home/d052845/downloads/WSL2-Linux-Kernel-4.19.128-microsoft-standard'

  WARNING: Symbol version dump ./Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /opt/intel/sgxdriver/package/sgx_main.o
  CC [M]  /opt/intel/sgxdriver/package/sgx_page_cache.o
  CC [M]  /opt/intel/sgxdriver/package/sgx_ioctl.o
  CC [M]  /opt/intel/sgxdriver/package/sgx_vma.o
  CC [M]  /opt/intel/sgxdriver/package/sgx_util.o
  CC [M]  /opt/intel/sgxdriver/package/sgx_encl.o
  CC [M]  /opt/intel/sgxdriver/package/sgx_encl2.o
  LD [M]  /opt/intel/sgxdriver/package/isgx.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /opt/intel/sgxdriver/package/isgx.mod.o
  LD [M]  /opt/intel/sgxdriver/package/isgx.ko
make[1]: Leaving directory '/home/d052845/downloads/WSL2-Linux-Kernel-4.19.128-microsoft-standard'
depmod: WARNING: could not open /lib/modules/4.19.128-microsoft-standard/modules.order: No such file or directory
depmod: WARNING: could not open /lib/modules/4.19.128-microsoft-standard/modules.builtin: No such file or directory

You may need to run "/sbin/modprobe isgx (--allow-unsupported)" or reboot system manually!

uninstall.sh script generated in "/opt/intel/sgxdriver".&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, adding the module to the kernel does not work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sudo /sbin/modprobe isgx
modprobe: ERROR: could not insert 'isgx': Exec format error&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;At this point, I also tried to follow the build and install instructions from the SGX driver repository (&lt;A href="https://github.com/intel/linux-sgx-driver" target="_blank"&gt;https://github.com/intel/linux-sgx-driver&lt;/A&gt;), but the result is exactly the same.&lt;BR /&gt;&lt;BR /&gt;As mentioned before: has anybody an idea what I do wrong, can tell me what else I could try, or can explain why it cannot work?&lt;BR /&gt;&lt;BR /&gt;Thank you for your help,&lt;BR /&gt;Benny&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 15:23:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-in-WSL2/m-p/1232231#M4138</guid>
      <dc:creator>Benny_F_</dc:creator>
      <dc:date>2020-11-27T15:23:59Z</dc:date>
    </item>
    <item>
      <title>Re:SGX in WSL2</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-in-WSL2/m-p/1233601#M4150</link>
      <description>&lt;P&gt;Hello Benny,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am able to reproduce your issue and managed to get a little further by following these instructions: &lt;A href="https://github.com/microsoft/WSL2-Linux-Kernel/issues/78#issuecomment-715854823" target="_blank"&gt;https://github.com/microsoft/WSL2-Linux-Kernel/issues/78#issuecomment-715854823&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I still can't get the Linux SGX driver to install due to compilation errors in sgx_main.c.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'm working on it but I just wanted to give you my latest in case it helps you.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Jesus G.&lt;/P&gt;&lt;P&gt;Intel Customer Support&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Dec 2020 17:47:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-in-WSL2/m-p/1233601#M4150</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2020-12-02T17:47:35Z</dc:date>
    </item>
    <item>
      <title>Re:SGX in WSL2</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-in-WSL2/m-p/1233615#M4151</link>
      <description>&lt;P&gt;Hello Benny,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I consulted with someone smarter than me and found out that SGX is not enabled in WSL at all. So, even if you were able to compile the driver you would not be able to load it.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Like a hypervisor or VMM, SGX would have to be passed through as a feature to WSL.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Confirm &lt;/B&gt;that SGX is not enabled by running:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier;"&gt;sudo cpuid | grep -i sgx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You should see everything come back as &lt;SPAN style="font-family: courier;"&gt;false&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Jesus G.&lt;/P&gt;&lt;P&gt;Intel Customer Support&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Dec 2020 18:58:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-in-WSL2/m-p/1233615#M4151</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2020-12-02T18:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Re:SGX in WSL2</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-in-WSL2/m-p/1233962#M4154</link>
      <description>&lt;P&gt;Hello Jesus,&lt;/P&gt;
&lt;P&gt;first, thank you very much for reproducing and confirming my problem.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you even more for finding out that SGX in not enabled in WSL at all. As you already expected, cpuid will return false on the proposed command. That's very unfortunate, but I now know at least that I do not have to spend more time trying. I hoped that the feature is passed to WSL as it seems to be possible with virtual machines.&lt;/P&gt;
&lt;P&gt;Hopefully, Intel and Microsoft will find a solution one day, because I consider&amp;nbsp;&lt;SPAN&gt;SGX development with WSL a big advantage.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Benny&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 17:47:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-in-WSL2/m-p/1233962#M4154</guid>
      <dc:creator>Benny_F_</dc:creator>
      <dc:date>2020-12-03T17:47:24Z</dc:date>
    </item>
    <item>
      <title>Re:SGX in WSL2</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-in-WSL2/m-p/1233982#M4155</link>
      <description>&lt;P&gt;&lt;B&gt;This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.&lt;/B&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Dec 2020 19:09:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/SGX-in-WSL2/m-p/1233982#M4155</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2020-12-03T19:09:40Z</dc:date>
    </item>
  </channel>
</rss>

