]> git.proxmox.com Git - qemu-server.git/commitdiff
enable vncproxy with vncterm for serial ports
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 11 Dec 2017 13:55:33 +0000 (14:55 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 12 Dec 2017 07:34:03 +0000 (08:34 +0100)
this enables the output via vncterm when the vm has
configured a serial port

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Qemu.pm

index 2b23c6b15a6bc550c6eb3f92d5413838e7196428..8ff6bd438bca4fae729e9caa52c7a9f9d8ef73bc 100644 (file)
@@ -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"