development tools to help building and debugging custom images
The idea is that we need to have so development/debugging tools to help with building custom VM images (microvms)
- I already created this script which allows you to boot a VM https://gist.github.com/muhamadazmy/a10bfb0cc77084c9b09dea5e49ec528e
- We also need to inject cidata (cloud-init seed) that include config to configure a simple network, and also add user key to the vm to make sure cloud-init is well configured
- Missing dep installation: mtools and cargo.
- Installation happened in the /root.
- Got this when trying to run with flist
https://hub.grid.tf/omarabdulaziz.3bot/ubuntu-jammy.flist
Booting ...
+ boot
+ sudo cloud-hypervisor --cpus boot=1,max=1 --memory size=1024M,shared=on --kernel /tmp/overlay/kernel --initramfs /tmp/overlay/initramfs-linux.img --fs tag=vroot,socket=/tmp/virtiofs.sock --disk path=/tmp/cidata.img --cmdline 'rw console=ttyS0 reboot=k panic=1 root=vroot rootfstype=virtiofs rootdelay=30' --serial tty --console off
:: running hook [bootstrap]
mounting pts
ln: /dev/fd/fd: No such file or directory
trying to mount root
:: mounting 'vroot' on real root
:: trial '1'
:: running late hook [bootstrap]
settign up environment
setting up system
seed directory: /seed
root directory: /new_root
failed to apply network: failed to load network config file: failed to open file /seed/network-config: open /seed/network-config: no such file or directory
generating host ssh keys
PING 8.8.8.8 (8.8.8.8): 56 data bytes
ping: sendto: Network is unreachable
fill /etc/hosts
ERROR: Root device mounted successfully, but /sbin/init does not exist.
Bailing out, you are on your own. Good luck.
sh: can't access tty; job control turned off
[rootfs ]#
thanks ya harby, i will look at it
@A-Harby i couldn't know exactly what happened to make the booting stuck in the initramfs and failed to chroot to the new_root to continue the booting process, but mostly it is a wrong deps installation. in the mentioned pr i separated the deps installtion on a file and add some missing deps.
on a new env setted up with the new install_deps script i managed to run a VM with the mentioned flist. could you try again by cleaning your env and setup with the script?
I tried again on a newly created VM to follow the instructions to install the tool, but it still fails to install libraries packages.
I'll communicate with @Omarabdul3ziz to identify errors and fix them.
@A-Harby nested virtualization isn't supported on the vms on the grid, so the script will not run on a VM.
i added some docs/configs can you try to verify again on your local machine from the main_debug-image-script_deps branch?
I was able to run the debug script on a Flist image after using the udpated install_preq script on the Omar branch main_debug-image-script_deps.
And image was successfully booted.
final changes are merged