|
|
Line 1: |
Line 1: |
| The 3270 is the classic 'green-screen' console (see [https://en.wikipedia.org/wiki/IBM_3270 the wikipedia article]).
| | This information has been moved into the [https://www.qemu.org/docs/master/system/s390x/3270.html 3270 devices] chapter of the [https://www.qemu.org/docs/master/system/ QEMU System Emulation Users Guide]. |
| | |
| == Code ==
| |
| * <s>Postings: [https://lists.gnu.org/archive/html/qemu-devel/2017-02/msg05216.html] [https://lists.gnu.org/archive/html/qemu-devel/2017-04/msg01209.html]</s>
| |
| * <s>Git: [https://github.com/cohuck/qemu/tree/3270]</s>
| |
| Merged into qemu/master for 2.10 as of commit f03f9f0c10dcfadee5811d43240f0a6af230f1ce
| |
| | |
| == Implementation ==
| |
| | |
| The 3270 data stream is not implemented within QEMU; the code only implements tn3270 (a telnet extension; see RFCs 854 and 1576) and leaves the heavy lifting to an emulator (currently only tested with x3270).
| |
| | |
| == Setup ==
| |
| | |
| This example setup is done with a Linux guest running in an s390x-ccw-virtio machine and the x3270 emulator running on a local Linux machine.
| |
| | |
| === Prereqs ===
| |
| | |
| ==== Guest ====
| |
| | |
| * Make sure that 3270 support is enabled in the kernel. You'll need CONFIG_TN3270 and at least one of CONFIG_TN3270_TTY (for additional ttys) or CONFIG_TN3270_CONSOLE (for a 3270 console).
| |
| | |
| ==== Host ====
| |
| | |
| * You need a recent version of QEMU containing commit f03f9f0c10dcfadee5811d43240f0a6af230f1ce; this means a recent checkout or version 2.10 or later.
| |
| | |
| ==== Other ====
| |
| | |
| * You need to have a copy of the [http://x3270.bgp.nu/ x3270 emulator] (should be packaged for most Linux distributions). Other 3270 emulators have not been tested.
| |
| | |
| === Starting QEMU ===
| |
| | |
| * Add a tn3270 chardev and an x-terminal3270 device to your QEMU command line (machine needs to be s390x-ccw-virtio). Example: <code>-chardev socket,id=char_0,host=0.0.0.0,port=23,nowait,server,tn3270 -device x-terminal3270,chardev=char_0,devno=fe.0.000a,id=terminal_0</code>
| |
| * Start QEMU. Your guest will be presented with a 3270 channel-attached device.
| |
| | |
| === Guest Configuration ===
| |
| | |
| The guest will see the 3270 as a channel-attached device. With the example above, the device will show up as 0.0.000a.
| |
| | |
| ==== Using 3270 as an additional tty ====
| |
| | |
| You can use the defined 3270 as an additional tty.
| |
| | |
| * Start the guest and log in via an alternative method (for example, via the sclp console).
| |
| * Enable the device. For the example above, use <code>chccwdev -e 0.0.000a</code>
| |
| * Find the respective device node, usually under /dev/3270/.
| |
| * Start a getty on that device node, for example via <code>systemctl start serial-getty@3270-tty1.service</code>
| |
| ** You may want to defer this step until after you connected via x3270, or you won't see the banner.
| |
| | |
| ==== Using 3270 as the console ====
| |
| | |
| You can use the defined 3270 as the guest's console. However, you'll usually want to use the sclp console instead.
| |
| | |
| * Make sure you switch the guest console to 3270. For the example above, append <code>conmode=3270 condev=000a</code> to the guest's kernel command line.
| |
| * Start the guest.
| |
| | |
| === Starting the 3270 emulator ===
| |
| | |
| Connect x3270 to <host>:<port> (for the example above, <host>:23).
| |
| | |
| == Restrictions ==
| |
| | |
| 3270 support is still experimental. In particular,
| |
| | |
| * Only one 3270 device is supported.
| |
| * Only tested with Linux guests and the x3270 emulator.
| |
| * TLS/SSL is not yet supported.
| |
| * Resizing on reattach is not yet supported.
| |
| * Multiple commands in one inbound buffer (for example, when the reset key is pressed while the network is slow) are not yet supported.
| |