From: Dominik Csapak Date: Mon, 11 Dec 2017 13:55:33 +0000 (+0100) Subject: enable vncproxy with vncterm for serial ports X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=9e6d6e97c4363681a73e44a8dbc2711b95565aff;p=qemu-server.git enable vncproxy with vncterm for serial ports this enables the output via vncterm when the vm has configured a serial port Signed-off-by: Dominik Csapak --- diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 2b23c6b1..8ff6bd43 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -1429,14 +1429,22 @@ __PACKAGE__->register_method({ if ($conf->{vga} && ($conf->{vga} =~ m/^serial\d+$/)) { - die "Websocket mode is not supported in vga serial mode!" if $websocket; my $termcmd = [ '/usr/sbin/qm', 'terminal', $vmid, '-iface', $conf->{vga} ]; - #my $termcmd = "/usr/bin/qm terminal -iface $conf->{vga}"; + $cmd = ['/usr/bin/vncterm', '-rfbport', $port, '-timeout', $timeout, '-authpath', $authpath, - '-perm', 'Sys.Console', '-c', @$remcmd, @$termcmd]; + '-perm', 'Sys.Console']; + + if ($param->{websocket}) { + $ENV{PVE_VNC_TICKET} = $ticket; # pass ticket to vncterm + push @$cmd, '-notls', '-listen', 'localhost'; + } + + push @$cmd, '-c', @$remcmd, @$termcmd; + PVE::Tools::run_command($cmd); + } else { $ENV{LC_PVE_TICKET} = $ticket if $websocket; # set ticket with "qm vncproxy"