Proxmox Serial Port Pass Through Rear
From:Proxmox 使用 qemu/kvm manager (qm) 工具管理 qemu server,「qm」是它的主要用來管理的命令。由 qm 的手冊得知「args」是 VM CONFIGURATION 中的一條屬性設定,其目的是將參數傳遞至「kvm」。因此在 qemu-server 設定檔中加上一行「args: -serial /dev/ttyS0」,則表示在「kvm」依設定檔配置虛擬機會跟據「args」裏的參數,也虛擬一個serial port 裝置,虛擬的裝置仍映射至 Host 端 /dev/ttyS0 的裝置上。args.Note: this option is for experts only. It allows you to pass arbitrary arguments to kvm, for example:args: -no-reboot -no-hpet而 kvm 配置虛擬機硬體 serial port 裝置時,也有多樣的設定方式不是只能從 Host 端直接映射。完整設定方式可由 man qemu 查詢得知。-serial devRedirect the virtual serial port to host character device dev. The default device is 'vc' ingraphical mode and 'stdio' in non graphical mode.This option can be used several times to simulate up to 4 serial ports.Use '-serial none' to disable all serial ports.Available character devices are:vc:WxHVirtual console. Usb dongle software download.
Optionally, a width and height can be given in pixel withvc:800x600It is also possible to specify width or height in characters:vc:80Cx24Cpty Linux only Pseudo TTY (a new PTY is automatically allocated)noneNo device is allocated.nullvoid device/dev/XXXLinux only Use host tty, e.g. The host serial port parameters are set accordingto the emulated ones./dev/parportNLinux only, parallel port only Use host parallel port N. Currently SPP and EPP parallel portfeatures can be used.file:filenameWrite output to filename. No character can be read.stdioUnix only standard input/outputpipe:filenamename pipe filenameCOMnWindows only Use host serial port nudp:remotehost:remoteport@srcip:srcportThis implements UDP Net Console. When remotehost or srcip are not specified they default to0.0.0.0.
When not using a specified srcport a random port is automatically chosen.If you just want a simple readonly console you can use 'netcat' or 'nc', by starting QEMUwith: '-serial udp::4555' and nc as: 'nc -u -l -p 4555'. Any time QEMU writes something tothat port it will appear in the netconsole session.If you plan to send characters back via netconsole or you want to stop and start QEMU a lot oftimes, you should have QEMU use the same source port each time by using something like'-serial udp::4555@4556' to QEMU.
Another approach is to use a patched version of netcat whichcan listen to a TCP port and send and receive characters via udp. If you have a patchedversion of netcat which activates telnet remote echo and single char transfer, then you canuse the following options to step up a netcat redirector to allow telnet on port 5555 toaccess the QEMU port.' QEMU Options:'-serial udp::4555@4556'netcat options:'-u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T'telnet options:'localhost 5555tcp:host:port,server,nowait,nodelayThe TCP Net Console has two modes of operation. It can send the serial I/O to a location orwait for a connection from a location.
Proxmox Serial Port Pass Through Rear Door
By default the TCP Net Console is sent to host at theport. If you use the server option QEMU will wait for a client socket application to connectto the port before continuing, unless the 'nowait' option was specified. The 'nodelay' optiondisables the Nagle buffering algorithm. If host is omitted, 0.0.0.0 is assumed. Only one TCPconnection at a time is accepted. You can use 'telnet' to connect to the correspondingcharacter device.'
Example to send tcp console to 192.168.0.2 port 4444'-serial tcp:192.168.0.2:4444'Example to listen and wait on port 4444 for connection'-serial tcp::4444,server'Example to not wait and listen on ip 192.168.0.100 port 4444'-serial tcp:192.168.0.100:4444,server,nowaittelnet:host:port,server,nowait,nodelayThe telnet protocol is used instead of raw tcp sockets. The options work the same as if youhad specified '-serial tcp'. The difference is that the port acts like a telnet server orclient using telnet option negotiation. This will also allow you to send the MAGICSYSRQsequence if you use a telnet that supports sending the break sequence.
Typically in unixtelnet you do it with Control- and then type 'send break' followed by pressing the enter key.unix:path,server,nowaitA unix domain socket is used instead of a tcp socket. The option works the same as if you hadspecified '-serial tcp' except the unix domain socket path is used for connections.mon:devstringThis is a special option to allow the monitor to be multiplexed onto another serial port. Themonitor is accessed with key sequence of Control-a and then pressing c. See monitor accesspcsyskeys in the -nographic section for more keys. Devstring should be any one of theserial devices specified above. An example to multiplex the monitor onto a telnet serverlistening on port 4444 would be:'-serial mon:telnet::4444,server,nowait'brailleBraille device.
This will use BrlAPI to display the braille output on a real or fake device.msmouseThree button serial mouse.
From:Proxmox 使用 qemu/kvm manager (qm) 工具管理 qemu server,「qm」是它的主要用來管理的命令。由 qm 的手冊得知「args」是 VM CONFIGURATION 中的一條屬性設定,其目的是將參數傳遞至「kvm」。因此在 qemu-server 設定檔中加上一行「args: -serial /dev/ttyS0」,則表示在「kvm」依設定檔配置虛擬機會跟據「args」裏的參數,也虛擬一個serial port 裝置,虛擬的裝置仍映射至 Host 端 /dev/ttyS0 的裝置上。args.Note: this option is for experts only. It allows you to pass arbitrary arguments to kvm, for example:args: -no-reboot -no-hpet而 kvm 配置虛擬機硬體 serial port 裝置時,也有多樣的設定方式不是只能從 Host 端直接映射。完整設定方式可由 man qemu 查詢得知。-serial devRedirect the virtual serial port to host character device dev. The default device is 'vc' ingraphical mode and 'stdio' in non graphical mode.This option can be used several times to simulate up to 4 serial ports.Use '-serial none' to disable all serial ports.Available character devices are:vc:WxHVirtual console. Optionally, a width and height can be given in pixel withvc:800x600It is also possible to specify width or height in characters:vc:80Cx24Cpty Linux only Pseudo TTY (a new PTY is automatically allocated)noneNo device is allocated.nullvoid device/dev/XXXLinux only Use host tty, e.g. The host serial port parameters are set accordingto the emulated ones./dev/parportNLinux only, parallel port only Use host parallel port N.
Currently SPP and EPP parallel portfeatures can be used.file:filenameWrite output to filename. No character can be read.stdioUnix only standard input/outputpipe:filenamename pipe filenameCOMnWindows only Use host serial port nudp:remotehost:remoteport@srcip:srcportThis implements UDP Net Console. When remotehost or srcip are not specified they default to0.0.0.0. When not using a specified srcport a random port is automatically chosen.If you just want a simple readonly console you can use 'netcat' or 'nc', by starting QEMUwith: '-serial udp::4555' and nc as: 'nc -u -l -p 4555'. Any time QEMU writes something tothat port it will appear in the netconsole session.If you plan to send characters back via netconsole or you want to stop and start QEMU a lot oftimes, you should have QEMU use the same source port each time by using something like'-serial udp::4555@4556' to QEMU.
Another approach is to use a patched version of netcat whichcan listen to a TCP port and send and receive characters via udp. If you have a patchedversion of netcat which activates telnet remote echo and single char transfer, then you canuse the following options to step up a netcat redirector to allow telnet on port 5555 toaccess the QEMU port.' QEMU Options:'-serial udp::4555@4556'netcat options:'-u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T'telnet options:'localhost 5555tcp:host:port,server,nowait,nodelayThe TCP Net Console has two modes of operation. It can send the serial I/O to a location orwait for a connection from a location. By default the TCP Net Console is sent to host at theport.
If you use the server option QEMU will wait for a client socket application to connectto the port before continuing, unless the 'nowait' option was specified. The 'nodelay' optiondisables the Nagle buffering algorithm. If host is omitted, 0.0.0.0 is assumed. Only one TCPconnection at a time is accepted. You can use 'telnet' to connect to the correspondingcharacter device.' Example to send tcp console to 192.168.0.2 port 4444'-serial tcp:192.168.0.2:4444'Example to listen and wait on port 4444 for connection'-serial tcp::4444,server'Example to not wait and listen on ip 192.168.0.100 port 4444'-serial tcp:192.168.0.100:4444,server,nowaittelnet:host:port,server,nowait,nodelayThe telnet protocol is used instead of raw tcp sockets.
The options work the same as if youhad specified '-serial tcp'. The difference is that the port acts like a telnet server orclient using telnet option negotiation. This will also allow you to send the MAGICSYSRQsequence if you use a telnet that supports sending the break sequence. Typically in unixtelnet you do it with Control- and then type 'send break' followed by pressing the enter key.unix:path,server,nowaitA unix domain socket is used instead of a tcp socket. The option works the same as if you hadspecified '-serial tcp' except the unix domain socket path is used for connections.mon:devstringThis is a special option to allow the monitor to be multiplexed onto another serial port. Themonitor is accessed with key sequence of Control-a and then pressing c. See monitor accesspcsyskeys in the -nographic section for more keys.
Devstring should be any one of theserial devices specified above. An example to multiplex the monitor onto a telnet serverlistening on port 4444 would be:'-serial mon:telnet::4444,server,nowait'brailleBraille device. This will use BrlAPI to display the braille output on a real or fake device.msmouseThree button serial mouse.
From:RemserialThe remserial program acts as a communications bridge between a TCP/IP network port and a Linux device such as a serial port. Any character-oriented Linux /dev device will work.The program can also use pseudo-ttys as the device. A pseudo-tty is like a serial port in that it has a /dev entry that can be opened by a program that expects a serial port device, except that instead of belonging to a physical serial device, the data can be intercepted by another program. The remserial program uses this to connect a network port to the “master' (programming) side of the pseudo-tty allowing the device driver (slave) side to be used by some program expecting a serial port. See example 3 below for details.The program can operate as a server accepting network connections from other machines, or as a client, connecting to remote machine that is running the remserial program or some other program that accepts a raw network connection. The network connection passes data as-is, there is no control protocol over the network socket.Multiple copies of the program can run on the same computer at the same time assuming each is using a different network port and device.
Some examples: Give access to a RS232 device over a network.The computer with the serial port connected to the device (such as a data aquisition device) runs the remserial program: remserial -d -p 23000 -s '9600 raw' /dev/ttyS0 &This starts the program in daemon mode so that it runs in the background, it waits for connections on port 23000 and sets up the serial port /dev/ttyS0 at 9600 baud. Network connections to port 23000 from any machine can then read and write to the device attached to the serial port.This can be started from /etc/rc.local or as an entry in /etc/inittab or set up as a system service with a file in /etc/rc.init/. Connect an RS232 device to a specified server.The computer with the serial port connected to the device (such as a data aquisition device) runs the remserial program: remserial -d -r server-name -p 23000 -s '9600 raw' /dev/ttyS0 &This would be used with case number 1 above creating an end-to-end serial port connection. What goes in the serial port on one machine would come out the serial port of the other machine. The ports could be running at different baud rates or other serial port settings. Connect a Linux program that needs a serial port to a remote serial port.Some programs are written to communicate directly with a serial port such as some data aquisition programs. The remserial program can use pseudo-ttys to fool the program into thinking that it is talking to a real serial port on the local machine: remserial -d -r server-name -p 23000 -l /dev/remserial1 /dev/ptmx &This creates a file called /dev/remserial1 which can be used by the data aquisition application as its serial port.
Any data sent or received is passed to the remote server-name on port 23000 where a computer configured in case number 1 above passes it to a real serial port.The remserial program uses the special pseudo-tty master device /dev/ptmx (see man ptmx) which creates a slave device that looks like a normal serial port named /dev/pts/something. Unfortunately, the actual device name created isn’t consistent, so the remserial program creates a symbol link from the device name specified with the -l option to the /dev/pts/ name that was created allowing the other application to be configured with a consistent device name. Server farm console control.Assuming multiple Linux servers (such as web servers) are set up to have a serial port as their console instead of a monitor/keyboard, their serial ports could be connected to a control server using a multi-port serial board. On the control server, a copy of remserial is run for each server: remserial -d -p 23000 -s “115200 raw' /dev/ttyS0 & remserial -d -p 23001 -s “115200 raw' /dev/ttyS1 & remserial -d -p 23002 -s “115200 raw' /dev/ttyS2 & remserial -d -p 23003 -s “115200 raw' /dev/ttyS3 & etc.From any computer on the local network, use a telnet program to connect to the control server on the appropriate port: telnet control-server-name 23002This would connect through the associated serial port to the desired server’s console. This example would then give the user console access to the 3rd server.Careful scripting such as using the Linux “expect' program could allow batches of commands to be run on each server.