Installation fails on WSL

Jetson Nano “File system and OS” step fails with error:

[exec_command]: /bin/bash -c /tmp/tmp_NV_L4T_FILE_SYSTEM_AND_OS_T210_COMP.myuser.sh; [error]: : File exists

More logs:

17:33:08 INFO: File System and OS - target_image: Root file system directory is /home/myuser/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs
17:33:08 INFO: File System and OS - target_image: Copying public debian packages to rootfs
17:33:11 INFO: File System and OS - target_image: Start L4T BSP package installation
17:33:12 INFO: File System and OS - target_image: QEMU binary is not available, looking for QEMU from host system
17:33:12 INFO: File System and OS - target_image: Found /usr/bin/qemu-aarch64-static
17:33:12 INFO: File System and OS - target_image: Installing QEMU binary in rootfs
17:33:12 ERROR: File System and OS - target_image: mknod: /home/myuser/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs/dev/random
17:33:12 ERROR: File System and OS - target_image: : File exists
17:33:12 ERROR: File System and OS - target_image: [exec_command]: /bin/bash -c /tmp/tmp_NV_L4T_FILE_SYSTEM_AND_OS_T210_COMP.myuser.sh; [error]: : File exists
17:33:12 INFO: File System and OS - target_image: [ Package Install Finished with Error ]
17:33:12 INFO: File System and OS - target_image: [host] [ 964.00 KB released. Disk Avail: 930.49 GB ]
17:33:12 INFO: File System and OS - target_image: [ NV_L4T_FILE_SYSTEM_AND_OS_T210_COMP Install took 9m3s ]
17:33:12 ERROR: File System and OS - target_image: command terminated with error
17:33:12 SUMMARY: File System and OS - target_image: First Error: Installation failed.
17:33:12 SUMMARY: NVIDIA Container Runtime with Docker integration (Beta) - target: Depends on failed component

I removed ~/nvidia folder, restarted WSL and tried again.
Now I have the following error:

chroot: failed to run command 'dpkg': Exec format error

More logs:

19:01:50 INFO: File System and OS - target_image: Copying public debian packages to rootfs
19:01:56 INFO: File System and OS - target_image: Start L4T BSP package installation
19:01:56 INFO: File System and OS - target_image: QEMU binary is not available, looking for QEMU from host system
19:01:56 INFO: File System and OS - target_image: Found /usr/bin/qemu-aarch64-static
19:01:56 INFO: File System and OS - target_image: Installing QEMU binary in rootfs
19:01:56 INFO: File System and OS - target_image: ~/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs ~/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra
19:01:56 INFO: File System and OS - target_image: Installing BSP Debian packages in /home/seriousrc/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs
19:01:56 ERROR: File System and OS - target_image: chroot: failed to run command 'dpkg': Exec format error
19:01:56 ERROR: File System and OS - target_image: [exec_command]: /bin/bash -c /tmp/tmp_NV_L4T_FILE_SYSTEM_AND_OS_T210_COMP.myuser.sh; [error]: chroot: failed to run command 'dpkg': Exec format error
19:01:56 INFO: File System and OS - target_image: [ Package Install Finished with Error ]
19:01:56 INFO: File System and OS - target_image: [host] [ 4.36 GB used. Disk Avail: 930.54 GB ]
19:01:56 INFO: File System and OS - target_image: [ NV_L4T_FILE_SYSTEM_AND_OS_T210_COMP Install took 8m55s ]

QEMU is installed.

Environment: WSL2 Ubuntu 18.04 on Windows 11, Jetpack 4.6.4, SDK Manager 2.0.0.11402

I had 35 GB of available space on Windows even after SDK Manager downloaded everything.

Will be very grateful for help

I tried these commands to fix this issue:

sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils

and

sudo apt install -y binfmt-support qemu-user-static
sudo apt --fix-broken install

but it didn’t help

I’m doing exactly the same right now. I have the exact same setup and I’m getting the same error.

Hi,

Is qemu-aarch64 available under /proc/sys/fs/binfmt_misc/ in your WSL2?
If it’s not, run this command to import the format and try again:

sudo update-binfmts --import qemu-aarch64

Thanks for reply. There is no ‘qemu-aarch64’ in ‘/usr/share/binfmts/qemu-aarch64’. But at the moment the ‘sudo update-binfmts --import qemu-aarch64’ command fails with error:

update-binfmts: warning: unable to open /usr/share/binfmts/qemu-aarch64: No such file or directory
update-binfmts: warning: couldn't find information about 'qemu-aarch64' to import
update-binfmts: exiting due to previous errors

I will try troubleshoot it later today. Also I can see in my logs:

19:01:56 INFO: File System and OS - target_image: QEMU binary is not available, looking for QEMU from host system
19:01:56 INFO: File System and OS - target_image: Found /usr/bin/qemu-aarch64-static

As far as I understood “/usr/bin/qemu-aarch64-static” QEMU is bad, because it is from host system, correct?

How did you install QEMU?
Is binfmt_misc enabled in the kernel?

“How did you install QEMU?”
I used this command:
sudo apt install -y binfmt-support qemu-user-static
and this sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils

“Is binfmt_misc enabled in the kernel?”
The command cat /proc/sys/fs/binfmt_misc/status prints enabled

I’ve just tried sudo apt install qemu-user-binfmt
But it didn’t help as well.
I am not a linux user, so don’t judge :)
I am dancing with tambourine

You may need to manually start the binfmt service before using the sdk manager in WSL:

sudo service binfmt-support start

I will try again later. But at the moment same issue:

6:20:25 INFO: File System and OS - target_image: Copying public debian packages to rootfs
16:20:47 INFO: File System and OS - target_image: Start L4T BSP package installation
16:20:47 INFO: File System and OS - target_image: QEMU binary is not available, looking for QEMU from host system
16:20:47 INFO: File System and OS - target_image: Found /usr/bin/qemu-aarch64-static
16:20:47 INFO: File System and OS - target_image: Installing QEMU binary in rootfs
16:20:48 INFO: File System and OS - target_image: ~/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs ~/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra
16:20:49 INFO: File System and OS - target_image: Installing BSP Debian packages in /home/myuser/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs
16:20:49 ERROR: File System and OS - target_image: chroot: failed to run command 'dpkg': Exec format error
16:20:49 ERROR: File System and OS - target_image: [exec_command]: /bin/bash -c /tmp/tmp_NV_L4T_FILE_SYSTEM_AND_OS_T210_COMP.myuser.sh; [error]: chroot: failed to run command 'dpkg': Exec format error

I executed apt list --installed

Here all records which contains ‘qemu’:

	Line  265: ipxe-qemu/bionic-updates,now 1.0.0+git-20180124.fbe8c52d-0ubuntu2.2 all [installed,automatic]
	Line  266: ipxe-qemu-256k-compat-efi-roms/bionic,now 1.0.0+git-20150424.a25a16d-0ubuntu2 all [installed,automatic]
	Line 1400: qemu-block-extra/bionic-updates,now 1:2.11+dfsg-1ubuntu7.42 amd64 [installed,automatic]
	Line 1401: qemu-kvm/bionic-updates,now 1:2.11+dfsg-1ubuntu7.42 amd64 [installed]
	Line 1402: qemu-system-common/bionic-updates,now 1:2.11+dfsg-1ubuntu7.42 amd64 [installed,automatic]
	Line 1403: qemu-system-x86/bionic-updates,now 1:2.11+dfsg-1ubuntu7.42 amd64 [installed,automatic]
	Line 1404: qemu-user/bionic-updates,now 1:2.11+dfsg-1ubuntu7.42 amd64 [installed,auto-removable]
	Line 1405: qemu-user-static/bionic-updates,now 1:2.11+dfsg-1ubuntu7.42 amd64 [installed]
	Line 1406: qemu-utils/bionic-updates,now 1:2.11+dfsg-1ubuntu7.42 amd64 [installed,automatic]

According to logs it picks always the same qemu /usr/bin/qemu-aarch64-static.
I will try to uninstall qemu-suer-static and play with other qemu installations

I removed all QEMU-* packages. Restarted and read more logs. It become more understandable to me. SDK Manager is the one who installs QEMU. And as far as I understand that QEMU does not work for some reason. Here more logs about what packages does it install. There are QEMU:

18:33:27.206 - info: exec_command: /tmp/tmp_NV_L4T_FILE_SYSTEM_AND_OS_T210_COMP.myuser.sh
18:45:00.728 - info: Get:1 file:/var/cuda-repo-cross-aarch64-ubuntu1804-10-2-local  InRelease
18:45:01.140 - info: Ign:1 file:/var/cuda-repo-cross-aarch64-ubuntu1804-10-2-local  InRelease
18:45:01.141 - info: Get:2 file:/var/cuda-repo-ubuntu1804-10-2-local  InRelease
18:45:01.143 - info: Ign:2 file:/var/cuda-repo-ubuntu1804-10-2-local  InRelease
18:45:01.145 - info: Get:3 file:/var/visionworks-repo  InRelease
18:45:01.146 - info: Ign:3 file:/var/visionworks-repo  InRelease
18:45:01.152 - info: Get:4 file:/var/visionworks-sfm-repo  InRelease
18:45:01.157 - info: Ign:4 file:/var/visionworks-sfm-repo  InRelease
18:45:01.163 - info: Get:5 file:/var/visionworks-tracking-repo  InRelease
18:45:01.165 - info: Ign:5 file:/var/visionworks-tracking-repo  InRelease
18:45:01.166 - info: Get:6 file:/var/cuda-repo-cross-aarch64-ubuntu1804-10-2-local  Release [563 B]
18:45:01.166 - info: Get:7 file:/var/cuda-repo-ubuntu1804-10-2-local  Release [564 B]
18:45:01.167 - info: Get:8 file:/var/visionworks-repo  Release [1,999 B]
18:45:01.167 - info: Get:6 file:/var/cuda-repo-cross-aarch64-ubuntu1804-10-2-local  Release [563 B]
18:45:01.167 - info: Get:9 file:/var/visionworks-sfm-repo  Release [2,003 B]
18:45:01.168 - info: Get:7 file:/var/cuda-repo-ubuntu1804-10-2-local  Release [564 B]
18:45:01.168 - info: Get:10 file:/var/visionworks-tracking-repo  Release [2,008 B]
18:45:01.169 - info: Get:8 file:/var/visionworks-repo  Release [1,999 B]
18:45:01.170 - info: Get:9 file:/var/visionworks-sfm-repo  Release [2,003 B]
18:45:01.170 - info: Get:10 file:/var/visionworks-tracking-repo  Release [2,008 B]
18:45:01.171 - info: Hit:11 http://archive.ubuntu.com/ubuntu bionic InRelease
18:45:01.171 - info: Hit:12 http://security.ubuntu.com/ubuntu bionic-security InRelease
18:45:01.340 - info: Hit:13 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
18:45:01.342 - info: Hit:14 https://dl.google.com/linux/chrome/deb stable InRelease
18:45:01.343 - info: Hit:15 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
18:45:30.390 - info: Reading package lists...
18:45:31.042 - info: Reading package lists...
18:45:31.912 - info: Building dependency tree...
18:45:32.358 - info: Reading state information...
18:45:33.812 - info: binfmt-support is already the newest version (2.1.8-2).
18:45:33.813 - info: device-tree-compiler is already the newest version (1.4.5-3).
18:45:33.814 - info: dosfstools is already the newest version (4.1-1).
18:45:33.814 - info: python is already the newest version (2.7.15~rc1-1).
18:45:33.814 - info: python3-yaml is already the newest version (3.12-1build2).
18:45:33.815 - info: whois is already the newest version (5.3.0).
18:45:33.815 - info: abootimg is already the newest version (0.6-1build1).
18:45:33.815 - info: lbzip2 is already the newest version (2.5-2).
18:45:33.816 - info: sshpass is already the newest version (1.06-1).
18:45:33.816 - info: binutils is already the newest version (2.30-21ubuntu1~18.04.9).
18:45:33.816 - info: cpp is already the newest version (4:7.4.0-1ubuntu2.3).
18:45:33.817 - info: libxml2-utils is already the newest version (2.9.4+dfsg1-6.1ubuntu1.9).
18:45:33.817 - info: nfs-kernel-server is already the newest version (1:1.3.4-2.1ubuntu5.5).
18:45:33.818 - info: udev is already the newest version (237-3ubuntu10.57).
18:45:33.818 - info: uuid-runtime is already the newest version (2.31.1-0.4ubuntu3.7).
18:45:33.819 - info: The following NEW packages will be installed:
18:45:33.831 - info:   qemu-user-static
18:45:36.639 - info: 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
18:45:36.641 - info: Need to get 0 B/9,973 kB of archives.
18:45:36.642 - info: After this operation, 101 MB of additional disk space will be used.
18:45:37.016 - info: Selecting previously unselected package qemu-user-static.
18:45:40.561 - info: (Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 129799 files and directories currently installed.)
18:45:40.753 - info: Preparing to unpack .../qemu-user-static_1%3a2.11+dfsg-1ubuntu7.42_amd64.deb ...
18:45:40.755 - info: Unpacking qemu-user-static (1:2.11+dfsg-1ubuntu7.42) ...
18:45:50.945 - info: Setting up qemu-user-static (1:2.11+dfsg-1ubuntu7.42) ...
18:45:51.099 - info: Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
18:45:59.441 - info: Reading package lists...
18:46:00.234 - info: Building dependency tree...
18:46:00.351 - info: Reading state information...
18:46:01.146 - info: liblz4-tool is already the newest version (0.0~r131-2ubuntu3.1).
18:46:01.147 - info: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
18:46:01.245 - info: Using rootfs directory of: /home/myuser/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs
18:46:01.267 - info: Installing extlinux.conf into /boot/extlinux in target rootfs
18:46:01.357 - info: /home/myuser/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/nv_tegra/nv-apply-debs.sh
18:46:01.358 - info: Root file system directory is /home/myuser/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs
18:46:01.359 - info: Copying public debian packages to rootfs
18:46:05.240 - info: Start L4T BSP package installation
18:46:05.339 - info: QEMU binary is not available, looking for QEMU from host system
18:46:05.341 - info: Found /usr/bin/qemu-aarch64-static
18:46:05.342 - info: Installing QEMU binary in rootfs
18:46:05.520 - info: ~/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs ~/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra
18:46:05.521 - info: Installing BSP Debian packages in /home/myuser/nvidia/nvidia_sdk/JetPack_4.6.4_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/rootfs
18:46:05.669 - error: chroot: failed to run command 'dpkg': Exec format error
18:46:05.671 - info: Event: NV_L4T_FILE_SYSTEM_AND_OS_T210_COMP@JETSON_NANO_TARGETS - error is: chroot: failed to run command 'dpkg': Exec format error
18:46:05.695 - error: [exec_command]: /bin/bash -c /tmp/tmp_NV_L4T_FILE_SYSTEM_AND_OS_T210_COMP.myuser.sh; [error]: chroot: failed to run command 'dpkg': Exec format error
18:46:05.695 - info: Event: NV_L4T_FILE_SYSTEM_AND_OS_T210_COMP@JETSON_NANO_TARGETS - error is: [exec_command]: /bin/bash -c /tmp/tmp_NV_L4T_FILE_SYSTEM_AND_OS_T210_COMP.myuser.sh; [error]: chroot: failed to run command 'dpkg': Exec format error

Why SDK installs something that doesn’t work for Ubuntu 18.04 or for target image? Maybe there some additional requirements to host OS and architecture which I don’t know? Maybe I need change links to repositories for apt. I don’t know. Maybe I need to install some alternative QEMU and try again. Or QEMU is ok and for some reason dpkg is picked from wrong place.

I’ve had similar issues with ubuntu 18 on WSL 2.
I think I’ve also tried: sudo update-binfmts --enable

I don’t know why it does not work on Ubuntu 18.04, and seems like it’s the same on my side.
However, I somehow found that if you launch a Ubuntu 20.04/22.04 instance with the 18.04 instance running, then the binfmt_misc information gets populated correctly on 18.04.
I don’t know the detail of WSL, but maybe procfs is also shared across all WSL distros, so once it gets registered on 20.04/22.04, it’s also there in 18.04.

Do I correctly understand you:
“seems like it’s the same on my side” - you mean you was able to reproduce it on your side by using 18.04 Ubuntu on WSL?
“if you launch a Ubuntu 20.04/22.04 instance with the 18.04 instance running, then the binfmt_misc information gets populated correctly on 18.04” - you mean you got rid of that error by running WSL Ubuntu 20/22 and Ubuntu 18 at the same time, correct?

YES. I somehow also didn’t see procfs get populated with QEMU stuff on 18.04.

YES. You run 20.04/22.04 along with 18.04, then it gets working on 18.04, also.

However, most of the time, you only need the SD card image for flashing Jetson Nano, which is also feasible on Windows with tools like Balena, and there is no strong need of SDK Manager in case you cannot get the WSL environment ready.

My Jetson Nano doesn’t SD card slot. So it like everything against me :)
I will try your workaround for WSL today and post my results here.

That approach didn’t work for me. I will reinstall the Ubuntu distribution and start everything from scratch on weekends.

Have you seen WSLInstall/docs/Chroot_ARM64_Linux_Distro.md at master · Biswa96/WSLInstall · GitHub?

I just tried it but it didn’t work.