[pve-devel] [PATCH qemu-server v3 2/2] enable vncproxy with vncterm for serial ports
Dominik Csapak
d.csapak at proxmox.com
Mon Dec 11 14:55:33 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 2b23c6b..8ff6bd4 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