Skip to contentSkip to conversation

Buildroot on Windows Subsystem for Linux (WSL)

Buildroot Christian Stewart 2 participants 4 messages Jan 14, 2021 – Jan 19, 2021

lore
Share & tools
lore
#0 lore raw

Hi all,

Windows Subsystem for Linux 1.0 runs a userspace without a kernel, and 2.0 runs a full Linux Kernel inside a VM.

SkiffOS, using Buildroot, now supports WSL with the "virt/wsl" package. This could be extracted from Skiff and submitted to mainline Buildroot as a "board" configuration as well.

https://github.com/skiffos/SkiffOS/tree/master/configs/virt/wsl

The Buildroot system works as expected in the WSL environment. The buildroot output tar.gz can be imported directly into WSL 2.0. WSL 1.0 requires using the WSL-DistroLauncher project to load the distribution via a Windows Appx.

This is an interesting way to use Buildroot under Windows.

Best regards,
Christian Stewart

#1 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christian" == Christian Stewart <[email protected]> writes:

Hi all,

Windows Subsystem for Linux 1.0 runs a userspace without a kernel, and 2.0 runs a full Linux Kernel inside a VM.

SkiffOS, using Buildroot, now supports WSL with the "virt/wsl" package. This could be extracted from Skiff and submitted to mainline Buildroot as a "board" configuration as well.

Quoted 8 lines

https://github.com/skiffos/SkiffOS/tree/master/configs/virt/wsl

The Buildroot system works as expected in the WSL environment. The buildroot output tar.gz can be imported directly into WSL 2.0. WSL 1.0 requires using the WSL-DistroLauncher project to load the distribution via a Windows Appx.

This is an interesting way to use Buildroot under Windows.

Cute. Besides the fact that you are booting a (heavily patched) Linux kernel, is there any specific advantages to just creating a docker container or a classic VM from a Buildroot build?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

Hi Peter,

Quoted 7 lines · Peter Korsgaard
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"Christian" == Christian Stewart <[email protected]> writes:

The Buildroot system works as expected in the WSL environment. The buildroot output tar.gz can be imported directly into WSL 2.0. WSL 1.0 requires using the WSL-DistroLauncher project to load the distribution via a Windows Appx.

Quoted 5 lines
Quoted 1 line

This is an interesting way to use Buildroot under Windows.

Cute. Besides the fact that you are booting a (heavily patched) Linux kernel, is there any specific advantages to just creating a docker container or a classic VM from a Buildroot build?

By my (limited) understanding, WSL2 promises tighter integration between Linux and the Windows OS.

I haven't tested it, but docs say you can override the kernel image.

It forces a wsl-provided /init binary, which forks several times to consume PID 1, 2, 3.

https://github.com/microsoft/WSL2-Linux-Kernel/issues/30#issuecomment-698922943

According to this, Windows 10 insider builds 20201 or above, you can add a custom init process:

Adding to /etc/wsl.conf inside the VM:

[boot]
command = "/my-init"

However, the my-init binary will not run as PID 1.

I am working on a workaround similar to the "systemd-genie" project to create a PID namespace and run systemd as PID 1 inside that.

Best regards,
Christian Stewart

#3 lore raw
Quoted 13 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christian" == Christian Stewart <[email protected]> writes:

Hi Peter,

Quoted 9 lines · Peter Korsgaard
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"Christian" == Christian Stewart <[email protected]> writes:

The Buildroot system works as expected in the WSL environment. The buildroot output tar.gz can be imported directly into WSL 2.0. WSL 1.0 requires using the WSL-DistroLauncher project to load the distribution via a Windows Appx.

This is an interesting way to use Buildroot under Windows.

Quoted 8 lines
Quoted 3 lines

Cute. Besides the fact that you are booting a (heavily patched) Linux kernel, is there any specific advantages to just creating a docker container or a classic VM from a Buildroot build?

By my (limited) understanding, WSL2 promises tighter integration between Linux and the Windows OS.

I haven't tested it, but docs say you can override the kernel image.

You haven't tested it? Didn't the defconfig you point to build a Linux kernel as well?

Signature · 1 line
Bye, Peter Korsgaard