Try Android Virtualization Framework (AVF)

pKVM is included in the Generic Kernel Image configuration files for android-13-5.x. To try AVF, follow these steps:

  1. Include com.android.virt APEX in your system image.

  2. Run tests to confirm that pKVM is working:

    $ atest MicrodroidHostTestCases MicrodroidTestApp
    
  3. Execute the following commands to run a demo app that spawns a pVM, boots Microdroid, and adds two numbers together:

    $ TARGET_BUILD_APPS=MicrodroidDemoApp m apps_only dist
    
    $ adb install -t out/dist/MicrodroidDemoApp.apk
    
    $ adb shell pm grant com.android.microdroid.demo android.permission.MANAGE_VIRTUAL_MACHINE
    

To download source code for this demo app, refer to MicrodroidDemo.