Discussion:
[PVE-User] New wiki article: Serial Terminal with PVE
Emmanuel Kasper
2015-05-12 09:04:55 UTC
Permalink
Hi
I found out the *qm terminal* command line switch was lacking a
comprehensive documentation so I wrote a wiki article about it.

https://pve.proxmox.com/wiki/Serial_Terminal

Serial Terminal / Serial Consoles are text only, but much faster [1] than
the NoVNC javascript console, and a very powerful tool if you like to
have a command line workflow instead of a web base workflow.

IMHO, a serialk terminal can provide the speed of the java VNC applet,
without the need to install the java applet in your browser.

Emmanuel


[1] If you try something like

while true; do
dmesg
done

in your NoVNC console, it will generate a lot of text output and freeze
your browser. A serial terminal handle this without problem.
Adam Thompson
2015-05-16 02:56:31 UTC
Permalink
Post by Emmanuel Kasper
Hi
I found out the *qm terminal* command line switch was lacking a
comprehensive documentation so I wrote a wiki article about it.
https://pve.proxmox.com/wiki/Serial_Terminal
That's great! I didn't even know KVM could do that. Now, all I need is
a way to connect a TCP port, possibly even an SSH session, to the socket
*without* having to log into PVE host, so that it can be used remotely.
Any ideas on how to do that? PVEProxy would be an ideal candidate to
handle that the same way NoVNC ports are handled, IMHO, but I'm not
enough of a Perl programmer to build it.
-Adam
--
-Adam Thompson
***@athompso.net
+1 (204) 291-7950 - cell
+1 (204) 489-6515 - fax
Wolfgang Bumiller
2015-05-16 17:11:14 UTC
Permalink
Post by Adam Thompson
Post by Emmanuel Kasper
Hi
I found out the *qm terminal* command line switch was lacking a
comprehensive documentation so I wrote a wiki article about it.
https://pve.proxmox.com/wiki/Serial_Terminal
That's great! I didn't even know KVM could do that. Now, all I need is
a way to connect a TCP port, possibly even an SSH session, to the socket
*without* having to log into PVE host, so that it can be used remotely.
Any ideas on how to do that? PVEProxy would be an ideal candidate to
handle that the same way NoVNC ports are handled, IMHO, but I'm not
enough of a Perl programmer to build it.
Not sure what you mean: if you can SSH into the server you can use `qm terminal`
from it anyway. Which btw runs `socat
UNIX-CONNECT:/var/run/qemu-server/${VMID}.serial${id}
STDIO,raw,echo=0,escape=0x0f`
On the pve host you could expose the socket to TCP via socat's TCP-LISTEN (or
even OPENSSL-LISTEN) options. That might even be a convenient option... but
security is another topic there.

With socat you can setup all kinds of connections though, even create an
ssh-tunneled relay socket to connect to locally:
You could probably do something like (untested):
$ socat UNIX-LISTEN:/your/local/relay EXEC:'ssh ***@pvehost socat
STDIO,raw,echo=0,escape=0x0f
UNIX-CONNECT:/var/run/qemu-server/105.serial0',pty,setsid,ctty
(If you don't need to type a password you can leave away the ,pty,setsid,ctty
options)
And connect to it with:
$ socat UNIX-CONNECT:/your/local/relay STDIO,raw,echo=0,escape=0x0f
Emmanuel Kasper
2015-05-18 08:17:30 UTC
Permalink
Post by Adam Thompson
Post by Emmanuel Kasper
Hi
I found out the *qm terminal* command line switch was lacking a
comprehensive documentation so I wrote a wiki article about it.
https://pve.proxmox.com/wiki/Serial_Terminal
That's great! I didn't even know KVM could do that. Now, all I need is
a way to connect a TCP port, possibly even an SSH session, to the socket
*without* having to log into PVE host, so that it can be used remotely.
Any ideas on how to do that? PVEProxy would be an ideal candidate to
handle that the same way NoVNC ports are handled, IMHO, but I'm not
enough of a Perl programmer to build it.
qemu also supports binding the emulated serial port to a telnet server.
Look for the -chardev parameter in the qemu-kvm manual page.( With
proxmox you would then use the "args: " parameter in vm.conf to specify
extra args )

This would allow you to telnet to your host on a specific port to get a
serial console. As with every telnet traffic remember than nothing is
encrypted, so I would'n t do this in a productive setup.

Emmanuel

Loading...