summaryrefslogtreecommitdiff
path: root/docs/system/s390x/3270.rst
blob: 0e173b323f482439b89534364ea07c61023b1403 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
3270 devices
============

The 3270 is the classic 'green-screen' console of the mainframes (see the
`IBM 3270 Wikipedia article <https://en.wikipedia.org/wiki/IBM_3270>`__).

The 3270 data stream is not implemented within QEMU; the device only provides
TN3270 (a telnet extension; see `RFC 854 <https://tools.ietf.org/html/rfc854>`__
and `RFC 1576 <https://tools.ietf.org/html/rfc1576>`__) and leaves the heavy
lifting to an external 3270 terminal emulator (such as ``x3270``) to make a
single 3270 device available to a guest. Note that this supports basic
features only.

To provide a 3270 device to a guest, create a ``x-terminal3270`` linked to
a ``tn3270`` chardev. The guest will see a 3270 channel device. In order
to actually be able to use it, attach the ``x3270`` emulator to the chardev.

Example configuration
---------------------

* Make sure that 3270 support is enabled in the guest's Linux kernel. You need
  ``CONFIG_TN3270`` and at least one of ``CONFIG_TN3270_TTY`` (for additional
  ttys) or ``CONFIG_TN3270_CONSOLE`` (for a 3270 console).

* Add a ``tn3270`` chardev and a ``x-terminal3270`` to the QEMU command line::

   -chardev socket,id=ch0,host=0.0.0.0,port=2300,wait=off,server=on,tn3270=on
   -device x-terminal3270,chardev=ch0,devno=fe.0.000a,id=terminal0

* Start the guest. In the guest, use ``chccwdev -e 0.0.000a`` to enable
  the device.

* On the host, start the ``x3270`` emulator::

    x3270 <host>:2300

* In the guest, locate the 3270 device node under ``/dev/3270/`` (say,
  ``tty1``) and start a getty on it::

    systemctl start serial-getty@3270-tty1.service

  This should get you an additional tty for logging into the guest.

* If you want to use the 3270 device as the Linux kernel console instead of
  an additional tty, you can also append ``conmode=3270 condev=000a`` to
  the guest's kernel command line. The kernel then should use the 3270 as
  console after the next boot.

Restrictions
------------

3270 support is very basic. In particular:

* Only one 3270 device is supported.

* It has only been tested with Linux guests and the x3270 emulator.

* TLS/SSL is not supported.

* Resizing on reattach is not supported.

* Multiple commands in one inbound buffer (for example, when the reset key
  is pressed while the network is slow) are not supported.