Xubuntu 20.04 Focal Fossa L4T R32.3.1 - Custom Image for the Jetson Nano

can u attach here the file “tegra210-p3448-0000-p3449-0000-b00.dtb” and the file “vgabios-ramfb.bin” that you are using please ? thanks. it seemed to work,but after having commented out the primary section,it does not work anymore here. it stucks on the nvidia logo. which version of qemu are u using ?

actually this is my conf file :

TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

#LABEL primary
#MENU LABEL primary kernel
#LINUX /boot/Image
#INITRD /boot/initrd
#APPEND ${cbootargs}

LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image_kvm
FDT /boot/tegra210-p3448-0000-p3449-0000-b01-kvm.dtb
INITRD /boot/initrd
APPEND ${cbootargs}

it does not work.

Finally I found the configuration that works for me :

TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

#LABEL primary
#MENU LABEL primary kernel
#LINUX /boot/Image
#INITRD /boot/initrd
#APPEND ${cbootargs}

LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image_kvm
FDT /boot/tegra210-p3448-0000-p3449-0000-a02-kvm.dtb
INITRD /boot/initrd
APPEND ${cbootargs}

basically the file which works for me is for the a02 version. but my nano is b01. why ?

root@zioma-desktop:/home/zioma# kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

PS : it worked one time only.

I think the B01 DTB file is not there in the image provided. Its is B00. I am not sure if you are using 20.04 image or18.04 whihc might have it so I am not sure what the problem is.

Excerpt from my previous post:

#FDT /boot/tegra210-p3448-0000-p3449-0000- b00 .dtb

LABEL kvm
MENU LABEL kvm kernel
LINUX /boot/Image_kvm
FDT /boot/tegra210-p3448-0000-p3449-0000- b00-kvm .dtb

For the qemu you can simply get it from github and use what you need

  git clone --recurse-submodules  https://github.com/qemu/qemu

man,refresh the page…I’ve added a comment before your lastest one.

Mission accomplished : (ubuntu 18.04 + qemu-kvm and qemu-system updated to ubuntu 20.04 + kernel kvm enabled and everything is compatible with the nvidia stuff. windows 10 arm64 runs fast enough.

Good to know that. Could you please share your qemu command line. Are you using VNC by chance ?

Btw, it also works when QEMU is built from sources and I could get a higher display resolution (1024x768) with ramfb following the instructions in the previous link. According to this link only ramfb and virtio gpu works for arm/

https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/

I used this configuration for building qemu:

./configure --prefix=/usr/local --target-list=aarch64-softmmu,arm-softmmu --enable-guest-agent --enable-vnc --enable-vnc-jpeg --enable-vnc-png --enable-kvm --enable-spice --enable-sdl --enable-gtk --enable-virglrenderer --enable-opengl

I plan to check out Rasbpian OS (aarch32) and AOSP performance when possible.

check at this : (im not using VNC)

isoname1=19041.804.210128-1115.VB_RELEASE_SVC_PROD1_CLIENTMULTICOMBINED_UUP_A64FRE_NETFX_IT-IT.ISO

virtio=virtio-win-0.1.185.iso

qemu-system-aarch64 -M virt-2.12 -enable-kvm -cpu host -smp 2 -m 2048 -device qemu-xhci -device usb-kbd -device usb-mouse -drive file=/root/Scrivania/Work/win10arm/win10arm.qcow2,if=virtio -device usb-storage,drive=install -device usb-storage,drive=drivers -drive file="$isoname1",if=none,id=install,media=cdrom,readonly=on -drive file="$virtio",if=none,media=cdrom,readonly=on,id=drivers -bios /root/Scrivania/Work/I9/win10arm/QEMU_EFI.fd -device ramfb

ramfb_fw_cfg_write: 800x600 @ 0xbbd00000

further improvements : how to increase the resolution of ramfb. it says 800x600 and its low. and how to add a network virtual card directly on the command line.

instructions : (on ubuntu 18.04)

apt remove qemu-kvm qemu-system

gedit /etc/apt/sources.list —> (change bionic with focal)

apt install qemu-kvm qemu-system

gedit /etc/apt/sources.list —> (change focal with bionic)

git clone https://github.com/OE4T/linux-tegra-4.9.git

cd linux-tegra-4.9

git checkout oe4t-patches-l4t-r32.5

cp /proc/config.gz .

gunzip config.gz

mv config .config

make menuconfig —> (enable kvm)

apt update

apt install gcc

make menuconfig

make -j4

make -j4 modules_install

make -j4 Image

mv /boot/Image-kvm Image2-kvm

cp arch/arm64/boot/Image /boot/Image-kvm

reboot

I don’t have access to an ethernet connection, does this Xubuntu 20.04 setup work with a wireless internet connection? I’m not seeing anything about wlan.

I used the Xubuntu from the post here since I wanted to use KVM enabled kernel.
But now @marietto2008 has shown that it possible to use the default installation and get the required qemu and kvm kernel.

In case you want Xubuntu check this post. Everything is available and work with this except JetPack

its not a good idea to use xubuntu 20.04 until nvidia officially support this version. there is no need to upgrade the qemu / kvm system files of ubuntu 18.04 with the versions of ubuntu 20.04. win 10 arm works with the latest version of qemu compiled from source and with the oe4t-patches-l4t-r32.5 kernel patches.

Yes. Xubuntu 20.04 custom is not a good idea. I only used it because I was not aware of the OE4T link.

The latest qemu I built from source because it possible to get higher resolution and i wanted to build custom build qemu for android.

"As of writing QEMU’s ramfb has its resolution locked to 800x600, which even breaks EDK2’s menu (press F2 or Esc during boot).

Fortunately, this has already been fixed in master 7 and will be in qemu 5.1.0. You can compile [5.1.0-rc3]"

yeah,we can use the latest version of qemu with these parameters :

-device virtio-gpu-pci,virgl=on,xres=1280,yres=720 -display sdl,gl=on

I just switched to JetPack 4.5.1 by flashing the latest Jetson Nano image. Unfortunately this procedure is not working for me :( …

The boot logo comes up and then after sometime resets and starts over again.

Which version of JetPack do you have …?

You don’t need to use the custom DTB files provided here. Use the default DTB files that u find on the /boot folder as soon as you have flashed the sd card.

Did u get these errors ?

/root/Scrivania/Work/I9/win10arm/qemu/build/aarch64-softmmu/./qemu-system-aarch64: /usr/lib/aarch64-linux-gnu/libspice-server.so.1: version `SPICE_SERVER_0.14.2’ not found (required by /root/Scrivania/Work/I9/win10arm/qemu/build/aarch64-softmmu/./qemu-system-aarch64)

/root/Scrivania/Work/I9/win10arm/qemu/build/aarch64-softmmu/./qemu-system-aarch64: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.28’ not found (required by /root/Scrivania/Work/I9/win10arm/qemu/build/aarch64-softmmu/./qemu-system-aarch64)

I’m using ubuntu 18.04 pure and I get them. But before,I was using a frankenstein ubuntu installation,half 18.04 and half 20.04 and I didn’t get those errors. Qemu 5 was configured like this :

./configure --prefix=/usr/local --target-list=aarch64-softmmu,arm-softmmu --enable-guest-agent --enable-vnc --enable-vnc-jpeg --enable-vnc-png --enable-kvm --enable-spice --enable-sdl --enable-gtk --enable-virglrenderer --enable-opengl

So,with the 18.04 pure it needs more additional work because it uses an old version of the spice server and of the GLIBC libraries. The version of the jetpack that I’ve used before and also now is the 4.5.1 with this version of L4T :

root@ziomario-desktop:# dpkg-query --show nvidia-l4t-core
nvidia-l4t-core 32.5.1-20210219084526

root@ziomario-desktop:# ldd --version

ldd (Ubuntu GLIBC 2.27-3ubuntu1.4) 2.27
Copyright © 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

To fix the glibc error while keeping ubuntu 18.04 I have installed the glibc libraries inside the folder /opt/glibc-2.33 and I created this script :

isoname1=19041.804.210128-1115.VB_RELEASE_SVC_PROD1_CLIENTMULTICOMBINED_UUP_A64FRE_NETFX_IT-IT.ISO
isoname2=Windows10_InsiderPreview_Client_ARM64_en-us_21286.VHDX
virtio=virtio-win-0.1.185.iso

GLIBC=/root/Scrivania/Work/I9/win10arm/glibc-2.33

GCONV_PATH=${GLIBC}/iconvdata LC_ALL=C     \
${GLIBC}/elf/ld.so.1 --library-path \
${GLIBC}:\
${GLIBC}/math:\
${GLIBC}/elf:\
${GLIBC}/dlfcn:\
${GLIBC}/nss:\
${GLIBC}/nis:\
${GLIBC}/rt:\
${GLIBC}/resolv:\
${GLIBC}/crypt:\
${GLIBC}/nptl:\
${GLIBC}/dfp \

/root/Scrivania/Work/I9/win10arm/qemu/build/aarch64-softmmu/./qemu-system-aarch64 -M virt-2.12 -enable-kvm -cpu host -smp 2 -m 2048 -device qemu-xhci -device usb-kbd -device usb-mouse -drive file=/root/Scrivania/Work/win10arm/win10arm.qcow2,if=virtio -nic user,model=virtio -device usb-storage,drive=install -device usb-storage,drive=drivers -drive file="$isoname1",if=none,id=install,media=cdrom,readonly=on -drive file="$virtio",if=none,media=cdrom,readonly=on,id=drivers -bios /root/Scrivania/Work/I9/win10arm/QEMU_EFI.fd -device ramfb

and I ran it. Unfortunately something is broken :

root@ziomario-desktop:# ./startvm.sh

./startvm.sh: line 7: /root/Scrivania/Work/I9/win10arm/glibc-2.33/elf/ld.so.1: No such file or directory

/root/Scrivania/Work/I9/win10arm/qemu/build/aarch64-softmmu/./qemu-system-aarch64: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /root/Scrivania/Work/I9/win10arm/qemu/build/aarch64-softmmu/./qemu-system-aarch64)

As u can see below,the file ld.so.1 is missing from within the build folder. I’ve looked for it in the whole system,but it isn’t in any place.

I believe many of the configuration options are optional. I had put them only for testing actually…

According to this link here:
https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/
Only ramfb and virtio-gpu-pci works for arm

./configure --prefix=/usr/local --target-list=aarch64-softmmu,arm-softmmu => arm-softmmu not really needed
–enable-guest-agent => not needed for simple use cases I think
–enable-vnc --enable-vnc-jpeg --enable-vnc-png => not needed
–enable-kvm => this is needed ofcourse
–enable-spice => again Win10 only supports ramfb I believe
–enable-sdl and --enable-virglrenderer and --enable-opengl => needed for checking Android with qemu options- device virtio-gpu-pci,virgl=on -display sdl,gl=on
–enable-gtk => needed

Other option could be just to use the lower version qemu (not latest) which still works with higher resolution…

Just remove the --enable-spice option and it should work fine…

JFI : I am now able to run Win10 with KVM on the default NVIDIA L4T, and I am also running with an overclocked kernel at 2GHz and performance of windows is even more smooth and nice.

A few issues I saw:

  1. The permissions of /dev/kvm need to be changed: sudo chmod 666 /dev/kvm so that all users can access.

  2. It seems Win10/qemu is sometimes not able to do mouse capture after the login screen. Better leave the mouse captured from boot till login screen. I am not sure if this is because of the 2Hz speed that I running at as the mouse is so damn sensitive now…

  3. I get a few warnings which I am not sure why:
    qemu-system-aarch64: virtio-blk failed to set guest notifier (-11), ensure -accel kvm is set.
    qemu-system-aarch64: virtio_bus_start_ioeventfd: failed. Fallback to userspace (slower).

You need to include -accel=KVM in your qemu command line…

Windows 10 also does not have driver support for virtio-gpu so hardware accelerated graphics are not supported currently … I believe there is currently development for the arm64 virtio-gpu drivers in progress but I’m not sure.