mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-09 03:58:34 +00:00
doc: add socket console backend for virtio-console
add new console backend of socket for virtio-console Signed-off-by: Gao Junhao <junhao.gao@intel.com>
This commit is contained in:
parent
d3ac30c639
commit
b5f77c0769
@ -72,7 +72,7 @@ device model: STDIO, TTY, PTY and regular file.
|
|||||||
The device model configuration command syntax for virtio-console is::
|
The device model configuration command syntax for virtio-console is::
|
||||||
|
|
||||||
virtio-console,[@]stdio|tty|pty|file:portname[=portpath]\
|
virtio-console,[@]stdio|tty|pty|file:portname[=portpath]\
|
||||||
[,[@]stdio|tty|pty|file:portname[=portpath]]
|
[,[@]stdio|tty|pty|file:portname[=portpath][:socket_type]]
|
||||||
|
|
||||||
- Preceding with ``@`` marks the port as a console port, otherwise it is a
|
- Preceding with ``@`` marks the port as a console port, otherwise it is a
|
||||||
normal virtio serial port
|
normal virtio serial port
|
||||||
@ -86,6 +86,9 @@ The device model configuration command syntax for virtio-console is::
|
|||||||
(e.g., by ``sleep 2d`` command), and will not read input from stdin before it
|
(e.g., by ``sleep 2d`` command), and will not read input from stdin before it
|
||||||
is used by virtio-console to redirect guest output.
|
is used by virtio-console to redirect guest output.
|
||||||
|
|
||||||
|
- When virtio-console socket_type is appointed to client, please make sure
|
||||||
|
server VM(socket_type is appointed to server) has started.
|
||||||
|
|
||||||
- Claiming multiple virtio serial ports as consoles is supported,
|
- Claiming multiple virtio serial ports as consoles is supported,
|
||||||
however the guest Linux OS will only use one of them, through the
|
however the guest Linux OS will only use one of them, through the
|
||||||
``console=hvcN`` kernel parameter. For example, the following command
|
``console=hvcN`` kernel parameter. For example, the following command
|
||||||
@ -129,18 +132,22 @@ PTY
|
|||||||
after ``acrn-dm`` is launched (``/dev/pts/0`` may be different,
|
after ``acrn-dm`` is launched (``/dev/pts/0`` may be different,
|
||||||
depending on your use case):
|
depending on your use case):
|
||||||
|
|
||||||
.. code-block: console
|
.. code-block:: console
|
||||||
|
|
||||||
virt-console backend redirected to /dev/pts/0
|
virt-console backend redirected to /dev/pts/0
|
||||||
|
|
||||||
#. Use a terminal emulator, such as minicom or screen, to connect to the
|
#. Use a terminal emulator, such as minicom or screen, to connect to the
|
||||||
tty node::
|
tty node:
|
||||||
|
|
||||||
minicom -D /dev/pts/0
|
.. code-block:: console
|
||||||
|
|
||||||
or ::
|
# minicom -D /dev/pts/0
|
||||||
|
|
||||||
screen /dev/pts/0
|
or :
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
# screen /dev/pts/0
|
||||||
|
|
||||||
TTY
|
TTY
|
||||||
===
|
===
|
||||||
@ -149,24 +156,32 @@ TTY
|
|||||||
|
|
||||||
- If you're connected to your device over the network via ssh, use
|
- If you're connected to your device over the network via ssh, use
|
||||||
the linux ``tty`` command, and it will report the node (may be
|
the linux ``tty`` command, and it will report the node (may be
|
||||||
different in your use case)::
|
different in your use case):
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
/dev/pts/0
|
/dev/pts/0
|
||||||
sleep 2d
|
# sleep 2d
|
||||||
|
|
||||||
- If you do not have network access to your device, use screen
|
- If you do not have network access to your device, use screen
|
||||||
to create a new tty::
|
to create a new tty:
|
||||||
|
|
||||||
screen
|
.. code-block:: console
|
||||||
tty
|
|
||||||
|
|
||||||
you will see (depending on your use case)::
|
# screen
|
||||||
|
# tty
|
||||||
|
|
||||||
|
you will see (depending on your use case):
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
/dev/pts/0
|
/dev/pts/0
|
||||||
|
|
||||||
Prevent the tty from responding by sleeping::
|
Prevent the tty from responding by sleeping:
|
||||||
|
|
||||||
sleep 2d
|
.. code-block:: console
|
||||||
|
|
||||||
|
# sleep 2d
|
||||||
|
|
||||||
and detach the tty by pressing :kbd:`CTRL-A` :kbd:`d`.
|
and detach the tty by pressing :kbd:`CTRL-A` :kbd:`d`.
|
||||||
|
|
||||||
@ -180,10 +195,12 @@ TTY
|
|||||||
console=hvc0
|
console=hvc0
|
||||||
|
|
||||||
#. Go back to the previous tty. For example, if you're using
|
#. Go back to the previous tty. For example, if you're using
|
||||||
``screen``, use::
|
``screen``, use:
|
||||||
|
|
||||||
screen -ls
|
.. code-block:: console
|
||||||
screen -r <pid_of_your_tty>
|
|
||||||
|
# screen -ls
|
||||||
|
# screen -r <pid_of_your_tty>
|
||||||
|
|
||||||
FILE
|
FILE
|
||||||
====
|
====
|
||||||
@ -198,3 +215,39 @@ The File backend only supports console output to a file (no input).
|
|||||||
#. Add the console parameter to the guest OS kernel command line::
|
#. Add the console parameter to the guest OS kernel command line::
|
||||||
|
|
||||||
console=hvc0
|
console=hvc0
|
||||||
|
|
||||||
|
SOCKET
|
||||||
|
======
|
||||||
|
|
||||||
|
The virtio-console socket-type can be set as socket server or client. Device model will
|
||||||
|
create an unix domain socket if appointed the socket_type as server, then server VM or
|
||||||
|
another user VM can bind and listen for communication requirement. If appointed to
|
||||||
|
client, please make sure the socket server is ready prior to launch device model.
|
||||||
|
|
||||||
|
1. Add a pci slot to the device model (``acrn-dm``) command line, adjusting
|
||||||
|
the ``</path/to/file.sock>`` to your use case in the VM1 configuration::
|
||||||
|
|
||||||
|
-s n,virtio-console,socket:socket_file_name=</path/to/file.sock>:server
|
||||||
|
|
||||||
|
#. Add a pci slot to the device model (``acrn-dm``) command line, adjusting
|
||||||
|
the ``</path/to/file.sock>`` to your use case in the VM2 configuration::
|
||||||
|
|
||||||
|
-s n,virtio-console,socket:socket_file_name=</path/to/file.sock>:client
|
||||||
|
|
||||||
|
#. Login to VM1, connect to the virtual port(vport1p0, 1 is decided
|
||||||
|
by front-end driver):
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
# minicom -D /dev/vport1p0
|
||||||
|
|
||||||
|
#. Login to VM2, connect to the virtual port(vport3p0, 3 is decided
|
||||||
|
by front-end driver):
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
# minicom -D /dev/vport3p0
|
||||||
|
|
||||||
|
#. Input into minicom window of VM1 or VM2, the minicom window of VM1
|
||||||
|
will indicate the input from VM2, the minicom window of VM2 will
|
||||||
|
indicate the input from VM1.
|
||||||
|
Loading…
Reference in New Issue
Block a user