commit | a0f58e8e6f6df1c47433dc60ef753ccc9b7410f0 | [log] [tgz] |
---|---|---|
author | Yi-Yo Chiang <yochiang@google.com> | Fri May 10 18:09:15 2024 +0800 |
committer | Yi-Yo Chiang <yochiang@google.com> | Mon May 27 17:12:41 2024 +0800 |
tree | 4a2d6db68e14ee5e2bd29c83effb78e9eb860fa9 | |
parent | 9290081b6a28d5ab49ea826b4678b56d84028b52 [diff] |
Guest OS serial console VirtualMachine library changes: Add a new debug config "connectVmConsole". If it is true then AVF would create a pty (pseudoterminal) on host and connect it to the VM serial console. If "vmOutputCaptured" is also true, then a worker thread would be submitted to the background and tee the VM console output to both VirtualMachine#getConsoleOutput() and the host pty. VirtualMachine#getHostConsoleName() to get the name of the peer end of the pty (aka. ptsname) which usually looks like `/dev/pts/<num>`. The number of the pts node is not fixed as it is dynamically allocated by the pty driver. You can then connect to the serial console through adb: ``` $ # Get the readonly logs only $ adb shell cat /dev/pts/0 $ # Connect to console with microcom; exit with `ctrl-]` then `q` $ adb shell -t microcom /dev/pts/0 $ # Or with netcat $ adb shell -t 'stty raw -echo && netcat -f /dev/pts/0' ``` Keep in mind that special characters like ctrl-c and ctrl-z are _not_ intepreted, so you would not be able to interrupt the host netcat command by typing ctrl-c. Pressing ctrl-c would send the ctrl-c keycode to the other end of the serial console, and cause an interrupt in the guest VM console. If you want to be able to interrupt and stop the host netcat command, pass the `isig` terminal option: ``` adb shell -t 'stty raw isig -echo && netcat -f /dev/pts/0' ``` Vmlauncher APP changes: Don't flood the host logcat with guest VM console logs. Instead direct it to a file: /data/user/0/com.android.virtualization.vmlauncher/files/console.log User can also connect to the host pts to connect to the VM console. BYPASS_INCLUSIVE_LANGUAGE_REASON=It is well known that "man" stands for the "[man]ual" command in the unix world. Bug: 335362012 Test: Start a vm and then `adb shell -t microcom /dev/pts/0` Change-Id: I9179510b237b8a19b8da7c527f3f42846a127dd3
Android Virtualization Framework (AVF) provides secure and private execution environments for executing code. AVF is ideal for security-oriented use cases that require stronger isolation assurances over those offered by Android’s app sandbox.
Visit our public doc site to learn more about what AVF is, what it is for, and how it is structured. This repository contains source code for userspace components of AVF.
If you want a quick start, see the getting started guideline and follow the steps there.
For in-depth explanations about individual topics and components, visit the following links.
AVF components:
AVF APIs:
How-Tos: