[PVE-User] New wiki article: Serial Terminal with PVE

Wolfgang Bumiller w.bumiller at proxmox.com
Sat May 16 19:11:14 CEST 2015



> On May 16, 2015 at 4:56 AM Adam Thompson <athompso at athompso.net> wrote:
> On 2015-05-12 04:04 AM, Emmanuel Kasper wrote:
> > 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 user at 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




More information about the pve-user mailing list