qemu-nbd: Kernel /dev/nbdN support not available

Hello. I'm trying to emulate FreeBSD for arm64 on my Jetson nano (arm64) using qemu and kvm. This is the script that I'm using :
Code:
tunctl -t tap0
ifconfig tap0 up
brctl addif virbr0 tap0

/opt/qemu-5.2.0/build/aarch64-softmmu/./qemu-system-aarch64 -m 2048M -cpu cortex-a57 -M virt --enable-kvm \
       -bios /home/zi/Desktop/Work/I9/Virt/qemu/build/pc-bios/edk2-aarch64-code.fd --nographic \
       -drive if=none,file=/root/Desktop/zi/Work/Android/OS/freebsd/FreeBSD-13.0-RELEASE-arm64-aarch64.qcow2,id=hd0 \
       -device virtio-blk-device,drive=hd0 \
       -device virtio-net-device,netdev=mynet \
       -netdev tap,id=mynet,ifname=tap0,script=no,downscript=no,vhost=on \
       -device virtio-gpu-pci,virgl=on,xres=1024,yres=768 \
       -display sdl,gl=on \
       -no-reboot
What's the problem? Is the size of the root partition of the qcow2 image. It's only 4 GB. Basically I can't do anything of important with it because the space becomes full immediately. I'm looking for some working method to increase it, but at the moment I haven't found the right road. I tried to mount the qcow2 file with this command before to resize it :

Code:
# qemu-nbd -c /dev/nbd0 FreeBSD-13.0-RELEASE-arm64-aarch64.qcow2
qemu-nbd: Kernel /dev/nbdN support not available

What it means? What should I do? Do u have a full tutorial where I can learn the whole procedure?
 
First from host: what does qemu-img info /root/Desktop/zi/Work/Android/OS/freebsd/FreeBSD-13.0-RELEASE-arm64-aarch64.qcow2 say ?
From guest (FreeBSD) what is the disk layout? Please share the output from these commands: gpart show, geom disk list.

There's one thing to expand the disk on a host, the other the actual fs on FreeBSD. As an example you can use this command to expand the disk to 10G: qemu-img resize FreeBSD-13.0-RELEASE-arm64-aarch64.qcow2 10240M. But then you have to take care of the FS in the FreeBSD guest.
 
yes,I have already expanded the qcow2 file on the host,but I didn't yet understood how to expand the ufs2 file system with the growfs command.
 
Use gpart resize. If the freebsd-ufs partition is last, "gpart resize" will increase its size to the end. If the swap partition is last, you have to manually delete it and recreate it to move it to the end, using gpart. This will leave free space just past the ufs partition . Now you can use gpart resize. You will also have to do gpart recover if gpart says your disk is corrupted. Finally, once the ufs partition is expanded, use growfs so that filesystem itself extends to the end.
 
I didn't yet understood how to expand the ufs2 file system with the growfs command.
That's why I asked about output of those commands. It depends on the guest disk layout you did. It can be as easy as bakul said or it could be so big nightmare that you're better off doing a fresh reinstall of this VM.
 
Back
Top