Skip to content

static/usr/lib/wsl: create empty wsl dir in base#430

Merged
alfonsosanchezbeato merged 2 commits intocanonical:mainfrom
jpm-canonical:IENG-2243-wsl-dir
Apr 22, 2026
Merged

static/usr/lib/wsl: create empty wsl dir in base#430
alfonsosanchezbeato merged 2 commits intocanonical:mainfrom
jpm-canonical:IENG-2243-wsl-dir

Conversation

@jpm-canonical
Copy link
Copy Markdown
Contributor

@jpm-canonical jpm-canonical commented Apr 15, 2026

See comment 1: canonical/snapd#16726 (comment)
See comment 2: canonical/snapd#16726 (comment)

This PR adds the /usr/lib/wsl directory to the static content of the base. The directory is empty, except for a readme explaining what it is for. The content of /usr/lib/wsl from a WSL2 host will be mounted over this directory at runtime.

Please also cherrypick this commit on to core22, core24 and core26.

@jpm-canonical jpm-canonical changed the title Create /usr/lib/wsl dir in base static/usr/lib/wsl: create empty wsl dir in base Apr 15, 2026
Copy link
Copy Markdown
Member

@alfonsosanchezbeato alfonsosanchezbeato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the directory from 020-extra-files.chroot instead

Copy link
Copy Markdown
Member

@alfonsosanchezbeato alfonsosanchezbeato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@alfonsosanchezbeato
Copy link
Copy Markdown
Member

@jpm-canonical thinking about this now, where does the content that you need to put it /usr/lib/wsl come from? Because if it comes from the distro, we could always include in directly in the base snap.

@jpm-canonical
Copy link
Copy Markdown
Contributor Author

Hi @alfonsosanchezbeato, the content comes from the WSL2 container, which on its turn gets it from the Windows on the host. So basically what we have is:

[Windows GPU drivers] -> [WSL2 container] -> [snap]

This needs to be done at runtime, as the libraries and drivers that are mounted in, depends very much on the Windows on the host system. For example, the libraries in /usr/lib/wsl are totally different between a host with NVIDIA GPU versus a host with Intel GPU. These libraries are also very dependent on which version of the GPU drivers are installed on the Windows host.

@alfonsosanchezbeato alfonsosanchezbeato merged commit 2026442 into canonical:main Apr 22, 2026
3 of 4 checks passed
@jpm-canonical jpm-canonical deleted the IENG-2243-wsl-dir branch April 22, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants