LibreELEC.wiki
  • Introduction
  • Support
    • Log Files
    • Updating
  • Installation
    • Create Media
    • Add-Ons
    • Containers
    • Security
  • Hardware
    • Allwinner
    • Amlogic
      • BananaPi M5 / M2S
      • LaFrite
      • WeTek Hub/Play2
    • NXP - iMX6/iMX8
    • Intel x86-64 (Generic)
      • Laptops
    • Qualcomm
    • Raspberry Pi
    • Rockchip
    • Samsung (Exynos)
    • Virtual Image
  • Configuration
    • 4K / HDR
    • Blu-Ray Playback
    • Config.txt
    • Cron
    • Dual Boot
    • EDID
    • Fonts
    • Hidden WiFi
    • Hypercon
    • Hyperion
    • Infra-Red Remotes
    • LCDProc
    • Network Boot
    • Pulseaudio
    • Safe Mode
    • Samba
    • SSL/TLS Certificates
    • Startup & Shutdown
    • Useful Scripts
    • WireGuard
  • How To
    • Add Firmware
    • Blacklist Kernel Module
    • Change Bootsplash
    • Force Add-on Update
    • Add content via Samba Shares
    • Mount Network Share
  • Development
    • Building (Basics)
    • Building (Docker)
    • Building (Advanced)
    • Building (Windows WSL)
    • Beginners Guide to Git
    • Build Commands
      • Build Commands (Add-ons)
      • Build Commands LE 12.0.x
      • Build Commands LE 11.0.x
      • Build Commands LE 10.0.x
      • Build Commands LE 9.2.x
      • Build Commands LE 9.0.x
      • Build Commands LE 8.2.x
      • Build Commands LE 8.0.x
      • Build Commands LE 7.0.x
    • Nightly Images
    • Release Management
    • Website
  • Project
    • Releases
    • Forks
    • Licenses
      • Source Code
      • Documentation
    • Mirrors
Powered by GitBook
On this page
  • Requirements
  • Workarounds to make it work

Was this helpful?

Edit on GitHub
Export as PDF
  1. Development

Building (Windows WSL)

Requirements

  • Windows 11 with installed WSL2 and Ubuntu WSL

Workarounds to make it work

WSL adds Windows paths to the Linux path variable

wsl@PC:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/snap/bin

This breaks the build and leads to unpredictable problems.

To disable that behaviour you need to create a file at your Ubuntu WSL /etc/wsl.conf and add these options to disable. Afterwards you need to reboot WSL or your system.

 [interop]
  enabled=false # enable launch of Windows binaries
  appendWindowsPath=false # append Windows path to $PATH variable

Building at the native NTFS formatted storage (C:/; D:/ ...) is dead slow

To interoperate with your Windows Desktop you want the git tree accessible from Windows. So you clone the Git Tree to a location at windows and try to use it at WSL.

For this example the Git Tree is cloned at D:\WSL\LE - /mnt/d/WSL/LE. If you start building the build folder would be located at D:\WSL\LE\build.YOURPROJECT .

To change the path for the build files you need to add some options to the LibreELEC options file /home/YOURUSER/.libreelec/options .

BUILD_DIR=/home/YOURUSER/LEbuild

After adding this line to the options file every build is now located at this folder.

The /home folder is located at the WSL ext4.vhdx and not at the native NTFS storage.

Optional: Move your WSL file to another location

lxrunoffline move -n Ubuntu-22.04 -d d:\wsl

AlpineWSL

Or you can use https://github.com/yuk7/AlpineWSL which creates ext4.vhdx on your wanted disk and automatically mounts it to WSL2 itself on startup. Advanced instructions: https://gist.github.com/onomatopellan/90024008a0d8c8a2ed6fa57e8b64df54

PreviousBuilding (Advanced)NextBeginners Guide to Git

Last updated 2 years ago

Was this helpful?

There are several ways in moving your WSL file, the easiest solution is the dedicated tool . The version 3.5.0 is not supporting the current Windows Version so you need to use a more recent version or a development build.

LxRunOffline