@@ -72,7 +72,7 @@ device model: STDIO, TTY, PTY and regular file.
72
72
The device model configuration command syntax for virtio-console is::
73
73
74
74
virtio-console,[@]stdio|tty|pty|file:portname[=portpath]\
75
- [,[@]stdio|tty|pty|file:portname[=portpath]]
75
+ [,[@]stdio|tty|pty|file:portname[=portpath][:socket_type] ]
76
76
77
77
- Preceding with ``@ `` marks the port as a console port, otherwise it is a
78
78
normal virtio serial port
@@ -86,6 +86,9 @@ The device model configuration command syntax for virtio-console is::
86
86
(e.g., by ``sleep 2d `` command), and will not read input from stdin before it
87
87
is used by virtio-console to redirect guest output.
88
88
89
+ - When virtio-console socket_type is appointed to client, please make sure
90
+ server VM(socket_type is appointed to server) has started.
91
+
89
92
- Claiming multiple virtio serial ports as consoles is supported,
90
93
however the guest Linux OS will only use one of them, through the
91
94
``console=hvcN `` kernel parameter. For example, the following command
@@ -108,39 +111,43 @@ STDIO
108
111
109
112
1. Add a pci slot to the device model (``acrn-dm ``) command line::
110
113
111
- -s n,virtio-console,@stdio:stdio_port
114
+ -s n,virtio-console,@stdio:stdio_port
112
115
113
116
#. Add the ``console `` parameter to the guest OS kernel command line::
114
117
115
- console=hvc0
118
+ console=hvc0
116
119
117
120
PTY
118
121
===
119
122
120
123
1. Add a pci slot to the device model (``acrn-dm ``) command line::
121
124
122
- -s n,virtio-console,@pty:pty_port
125
+ -s n,virtio-console,@pty:pty_port
123
126
124
127
#. Add the ``console `` parameter to the guest os kernel command line::
125
128
126
- console=hvc0
129
+ console=hvc0
127
130
128
131
One line of information, such as shown below, will be printed in the terminal
129
132
after ``acrn-dm`` is launched (``/dev/pts/0`` may be different,
130
133
depending on your use case):
131
134
132
- .. code-block: console
135
+ .. code-block:: console
133
136
134
- virt-console backend redirected to /dev/pts/0
137
+ virt-console backend redirected to /dev/pts/0
135
138
136
139
#. Use a terminal emulator, such as minicom or screen, to connect to the
137
- tty node::
140
+ tty node:
141
+
142
+ .. code-block :: console
138
143
139
- minicom -D /dev/pts/0
144
+ # minicom -D /dev/pts/0
145
+
146
+ or :
140
147
141
- or ::
148
+ .. code-block :: console
142
149
143
- screen /dev/pts/0
150
+ # screen /dev/pts/0
144
151
145
152
TTY
146
153
===
@@ -149,41 +156,51 @@ TTY
149
156
150
157
- If you're connected to your device over the network via ssh, use
151
158
the linux ``tty `` command, and it will report the node (may be
152
- different in your use case)::
159
+ different in your use case):
153
160
154
- /dev/pts/0
155
- sleep 2d
161
+ .. code-block :: console
156
162
163
+ /dev/pts/0
164
+ # sleep 2d
165
+
157
166
- If you do not have network access to your device, use screen
158
- to create a new tty::
167
+ to create a new tty:
168
+
169
+ .. code-block :: console
170
+
171
+ # screen
172
+ # tty
173
+
174
+ you will see (depending on your use case):
159
175
160
- screen
161
- tty
176
+ .. code-block :: console
162
177
163
- you will see (depending on your use case)::
178
+ /dev/pts/0
164
179
165
- /dev/pts/0
180
+ Prevent the tty from responding by sleeping:
166
181
167
- Prevent the tty from responding by sleeping::
182
+ .. code-block :: console
168
183
169
- sleep 2d
184
+ # sleep 2d
170
185
171
186
and detach the tty by pressing :kbd: `CTRL - A ` :kbd: `d `.
172
187
173
188
#. Add a pci slot to the device model (``acrn-dm ``) command line
174
189
(changing the ``dev/pts/X `` to match your use case)::
175
190
176
- -s n,virtio-console,@tty:tty_port=/dev/pts/X
191
+ -s n,virtio-console,@tty:tty_port=/dev/pts/X
177
192
178
193
#. Add the console parameter to the guest OS kernel command line::
179
194
180
- console=hvc0
195
+ console=hvc0
181
196
182
197
#. Go back to the previous tty. For example, if you're using
183
- ``screen ``, use::
198
+ ``screen ``, use:
184
199
185
- screen -ls
186
- screen -r <pid_of_your_tty>
200
+ .. code-block :: console
201
+
202
+ # screen -ls
203
+ # screen -r <pid_of_your_tty>
187
204
188
205
FILE
189
206
====
@@ -193,8 +210,44 @@ The File backend only supports console output to a file (no input).
193
210
1. Add a pci slot to the device model (``acrn-dm ``) command line,
194
211
adjusting the ``</path/to/file> `` to your use case::
195
212
196
- -s n,virtio-console,@file:file_port=</path/to/file>
213
+ -s n,virtio-console,@file:file_port=</path/to/file>
197
214
198
215
#. Add the console parameter to the guest OS kernel command line::
199
216
200
- console=hvc0
217
+ console=hvc0
218
+
219
+ SOCKET
220
+ ======
221
+
222
+ The virtio-console socket-type can be set as socket server or client. Device model will
223
+ create an unix domain socket if appointed the socket_type as server, then server VM or
224
+ another user VM can bind and listen for communication requirement. If appointed to
225
+ client, please make sure the socket server is ready prior to launch device model.
226
+
227
+ 1. Add a pci slot to the device model (``acrn-dm ``) command line, adjusting
228
+ the ``</path/to/file.sock> `` to your use case in the VM1 configuration::
229
+
230
+ -s n,virtio-console,socket:socket_file_name=</path/to/file.sock>:server
231
+
232
+ #. Add a pci slot to the device model (``acrn-dm ``) command line, adjusting
233
+ the ``</path/to/file.sock> `` to your use case in the VM2 configuration::
234
+
235
+ -s n,virtio-console,socket:socket_file_name=</path/to/file.sock>:client
236
+
237
+ #. Login to VM1, connect to the virtual port(vport1p0, 1 is decided
238
+ by front-end driver):
239
+
240
+ .. code-block :: console
241
+
242
+ # minicom -D /dev/vport1p0
243
+
244
+ #. Login to VM2, connect to the virtual port(vport3p0, 3 is decided
245
+ by front-end driver):
246
+
247
+ .. code-block :: console
248
+
249
+ # minicom -D /dev/vport3p0
250
+
251
+ #. Input into minicom window of VM1 or VM2, the minicom window of VM1
252
+ will indicate the input from VM2, the minicom window of VM2 will
253
+ indicate the input from VM1.
0 commit comments