NestBox is not maintained and does not recognize Pixel 8, so I did some digging. I used the kernel and image from kdrag0n's nestbox, and I was able to launch a pKVM with just adb. I could not figure out how to get shell access, though, and it does not seem to have network, either.
# in Termux:
pkg install android-tools
unset LD_PRELOAD
# Wireless ADB
adb pair localhost:<port>
adb connect localhost:<port>
# Resources for launching VM
adb push nestbox-kernel /data/local/tmp/nestbox-kernel
adb push nestbox-rootfs.img /data/local/tmp/nestbox-rootfs.img
cat <<EOF > vm_config.json
{
"kernel": "/data/local/tmp/nestbox-kernel",
"initrd": "/data/local/tmp/nestbox-rootfs.img",
"disks": [
{
"image": "/data/local/tmp/nestbox-rootfs.img",
"writable": false
}
],
"params": "root=/dev/vda init=/bin/cat /etc/os-release",
"platform_version": "1.0.0"
}
EOF
adb push vm_config.json /data/local/tmp/vm_config.json
# Launch the VM
adb shell "/apex/com.android.virt/bin/vm run /data/local/tmp/vm_config.json"
This prints the OS name of the VM and crashes.
If anyone can help with how to interact with a shell and network inside the VM, and how to build a kernel and image that works, it would be greatly appreciated.
References:
https://www.esper.io/blog/android-dessert-bites-13-virtualization-on-pixel-6-379185
https://source.android.com/docs/core/virtualization/virtualization-service
https://android.googlesource.com/platform/packages/modules/Virtualization/+/HEAD/docs/getting_started.md
https://android.googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/docs/custom_vm.md
https://android.googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/libs/vmconfig/src/lib.rs
https://www.patreon.com/posts/nestbox-beta-7-76632132