[pve-devel] [PATCH qemu-server 2/2] enable vncproxy with vncterm for serial ports

Dominik Csapak d.csapak at proxmox.com
Fri Dec 1 09:29:58 CET 2017


this enables the output via vncterm when the vm has
configured a serial port

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Qemu.pm | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 20306fc..c294190 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"
-- 
2.11.0





More information about the pve-devel mailing list