` torizoncore-builder build` command crashes WSL

It had been working fine, then I edited the .c file in the LKM and it started hanging on the step…

Bootloader found in unpacked image: U-Boot

Once hung, the WSL window is unresponsive and must be restarted.

I’ve completely removed the LKM from the tcbuild.yaml and it still fails in the same place. I’ve tried completely rebuilding the build directory, but same results.

Using all tools/images downloaded within the past 2 weeks. Trying to follow the procedure to add LKM to an image.

Here is my tdx-info:

 sudo tdx-info

Software summary
------------------------------------------------------------
Bootloader:               Unknown
Kernel version:           5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024
Kernel command line:      initrd=\initrd.img WSL_ROOT_INIT=1 panic=-1 nr_cpus=12 hv_utils.timesync_implicit=1 console=hvc0 debug pty.legacy_count=0 WSL_ENABLE_CRASH_DUMP=1
Distro name:              NAME="TorizonOS"
Distro version:           VERSION_ID=1.0.0
Distro variant:           VARIANT=Docker
Hostname:                 DESKTOP-CR2BPO8
------------------------------------------------------------
cat: /sys/devices/virtual/dmi/id/board_name: No such file or directory
cat: /sys/devices/virtual/dmi/id/board_vendor: No such file or directory
cat: /sys/devices/virtual/dmi/id/board_version: No such file or directory
cat: /sys/devices/virtual/dmi/id/board_serial: No such file or directory

Hardware info
------------------------------------------------------------
HW model:
Toradex version:
Serial number:            -
Processor arch:           x86_64
------------------------------------------------------------
🐧 josh @DESKTOP-CR2BPO8~:

What could be wrong and how can I fix?

Thank you,
josh

🐧 josh @DESKTOP-CR2BPO8~/custom-image: torizoncore-builder build
Building image as per configuration file 'tcbuild.yaml'...

=>> Handling input section
Unpacking Toradex Easy Installer image.
Unpacking TorizonCore Toradex Easy Installer image.
Importing OSTree revision 789c47c5e2f5cd8d1aa177ed9db1da6ae097ea69188980e51bf534e463966269 from local repository...
1271 metadata, 9767 content objects imported; 650.0 MB content written
0 metadata, 0 content objects imported; 0 bytes content written
Unpacked OSTree from Toradex Easy Installer image:
  Commit checksum: 789c47c5e2f5cd8d1aa177ed9db1da6ae097ea69188980e51bf534e463966269
  TorizonCore Version: 7.2.0+build.13

=>> Handling customization section

=> Handling device-tree subsection
Not testing overlay because base image does not have a device-tree set!

=> Adding device-tree overlay 'custom-overlay.dts'
'custom-overlay.dts' compiles successfully.
Overlay custom-overlay.dtbo successfully applied.

=> Building module located at 'hello-mod'
make: Entering directory '/workdir/hello-mod'
make -C /storage/linux M=/workdir/hello-mod
make[1]: Entering directory '/storage/linux'
  CC [M]  /workdir/hello-mod/hello.o
  MODPOST /workdir/hello-mod/Module.symvers
  CC [M]  /workdir/hello-mod/hello.mod.o
  LD [M]  /workdir/hello-mod/hello.ko
make[1]: Leaving directory '/storage/linux'
make: Leaving directory '/workdir/hello-mod'

Kernel module(s) successfully built and ready to deploy.
hello-mod/hello.ko is set to be autoloaded on boot.
All kernel module(s) have been built and prepared.

=>> Handling output section
Applying changes from STORAGE/kernel.
Applying changes from STORAGE/dt.
Commit e7296ed79d02a498d194c07279ad79fa18d032345a2ee756273952767233aff8 has been generated for changes and is ready to be deployed.
Deploying commit ref: voyant-flexspi-1
Pulling OSTree with ref voyant-flexspi-1 from local archive repository...
  Commit checksum: e7296ed79d02a498d194c07279ad79fa18d032345a2ee756273952767233aff8
  TorizonCore Version: 7.2.0+build.13-tcbuilder.20250512014229
  Default kernel arguments: quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3

1271 metadata, 9769 content objects imported; 650.0 MB content written
Pulling done.
Deploying OSTree with checksum e7296ed79d02a498d194c07279ad79fa18d032345a2ee756273952767233aff8
Bootloader found in unpacked image: U-Boot

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello Josh,

Thank you for the detailed information and screenshot. From your description, it looks like TorizonCore Builder hangs right after “Bootloader found in unpacked image: U-Boot,” and your WSL2 window becomes completely unresponsive— even after you remove the LKM from the build, the problem persists.

Here are some targeted troubleshooting suggestions for TorizonCore Builder with WSL2:


1. Check Docker Storage Driver in WSL2

TorizonCore Builder depends on Docker with the overlay2 storage driver. Sometimes, after WSL2 or Docker updates, the storage driver might not be properly configured, leading to strange hangs or failures.

You can check the Docker storage driver by running (inside your WSL2 terminal):

docker info | grep Storage

If it does not say overlay2, you need to reconfigure Docker’s storage backend for WSL2.
Refer to: TorizonCore Builder - Prerequisites


2. Run from a Clean State

It’s possible that leftover build artifacts or corrupted Docker/OSTree data are causing the hang. Try these cleanup steps:

# Ensure no build containers running/stalled
docker ps -a

# Remove stopped containers and unused images
docker system prune -af

# Clean up TorizonCore Builder working directories (make a backup if you want)
rm -rf ~/custom-image/storage
rm -rf ~/custom-image/output
rm -rf ~/custom-image/tmp  # if this exists

Now, try running source tcb-env-setup.sh and your build command again.


3. Use a New WSL2 Terminal with Only Necessary Services

Close all WSL2 windows, re-open just one, and ensure you run your commands from that one. Too many concurrent sessions can sometimes cause problems with mounted filesystems and Docker in WSL2.


4. Check Windows Filesystem Access

Confirm your project directory is within your WSL2 Linux filesystem (such as /home/josh/custom-image), not inside /mnt/c/... which is mapped from Windows. Operations on Windows-mounted volumes can behave unpredictably with Docker and overlay filesystems on WSL2.
See: Storage Driver Compatibility


5. Check for Disk Space

Make sure your WSL2 distribution and the underlying Windows drive are not out of disk space. A full disk will cause builds to hang unexpectedly.

df -h

6. Restart WSL2 and Docker

From Windows CMD or PowerShell:

wsl --shutdown

Then, restart Docker Desktop and relaunch your WSL2 terminal.


7. (Optional) Update TorizonCore Builder Script

Make sure you’re sourcing the latest tcb-env-setup.sh:

cd ~/tcbdir
source tcb-env-setup.sh
torizoncore-builder --help  # Confirm it works before starting your build

Summary Checklist:

  • Project root is in WSL2 Linux FS, not in /mnt/c/...
  • Docker uses overlay2
  • Enough disk space available (df -h)
  • Build directory cleaned up
  • WSL2 and Docker both restarted

If it still hangs after these steps, please let me know the results of docker info | grep Storage, your project directory path, and df -h. With that info, I can suggest next steps.

References:

Best regards,
Toradex AI Assistant.

Here is my response to the docker info…

🐧 josh @DESKTOP-CR2BPO8~: docker info | grep Storage
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-ai" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-ai: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-buildx" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-buildx: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-compose" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-compose: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-debug" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-debug: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-desktop" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-desktop: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-dev" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-dev: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-extension" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-extension: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-feedback" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-feedback: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-init" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-init: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-sbom" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-sbom: no such file or directory
WARNING: Plugin "/usr/local/lib/docker/cli-plugins/docker-scout" is not valid: failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-scout: no such file or directory
 Storage Driver: overlay2
WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
🐧 josh @DESKTOP-CR2BPO8~:

I looked at the linked page an it is not clear to me what I should do now to “reconfigure Docker’s storage backend for WSL2”?

Greetings @bigjosh,

This is a very strange looking issue. Let me try to ask some initial questions to try and understand the situation better.

It had been working fine, then I edited the .c file in the LKM and it started hanging on the step…

I assume you mean you edited the file for the kernel module that TorizonCore Builder is adding to the OS?

If yes, what exactly did you edit? If you revert the edit does the issue go away?

I’ve completely removed the LKM from the tcbuild.yaml and it still fails in the same place. I’ve tried completely rebuilding the build directory, but same results.

This sounds like then the issue is completely unrelated to the kernel module then.

What could be wrong and how can I fix?

There’s not a lot of information to suggest what could be going wrong here. No similar issue has been reported as well either. So you said this worked in the past. Can you think of anything that might have changed about your environment around the time this stopped working? You said it was cause you modified the source file for the kernel module, but this seems unrelated since the issue still happens even if you remove the kernel module from the build.

Could you try running the build command with additional logs like so torizoncore-builder --log-level debug build. Perhaps the additional log output will give us more hints on what is happening.

Best Regards,
Jeremias

I ended up uninstalling and reinstalling Docker and rebooting the machine and now it works again. I will report if problem comes back. Thanks!

I ended up uninstalling and reinstalling Docker and rebooting the machine and now it works again.

I see, perhaps Docker was in some weird state or something similar. In any case, I’m glad to hear the issue is resolved for you now.

Best Regards,
Jeremias