[PVE-User] Proxmox API: novnc 401 ticket error
TotallyHosted - Martin Kruijff
info at totallyhosted.nl
Mon Oct 9 11:17:48 CEST 2017
Hello Everyone,
A problem I am facing is getting a ticket for NOVNC submitted. I keep
getting an error ("401 no ticket" in NOVNC). I am trying to remote
connect via the API.
I tried getting NOVNC to work with 2 wrappers,
https://github.com/ZzAntares/ProxmoxVE
<https://github.com/ZzAntares/ProxmoxVE> version is below. The other
version is https://github.com/CpuID/pve2-api-php-client
<https://github.com/CpuID/pve2-api-php-client>
$server = 'myip';
$user = 'root';
$pass = 'mypass';
// Create your Credentials object
$credentials = new Credentials($server, $user, $pass);
// realm and port defaults to 'pam' and '8006' but you can specify them
like so
//$credentials = new Credentials($server, $user, $pass, 'pam', '9009');
// Then simply pass your Credentials object when creating the API client
object.
$proxmox = new Proxmox($credentials);
$action = $proxmox->create("/nodes/mynode/qemu/201/vncproxy");
$vncwebsocket = $proxmox->get("nodes/mynode/qemu/201/vncwebsocket",
array('port' => $action['data']['port'], 'vncticket' =>
$action['data']['ticket']));
<iframe
src="https://mykvmurl:8006/?console=kvm&novnc=1&vmid=201&node=mynode"
<https://mykvmurl:8006/?console=kvm&novnc=1&vmid=201&node=mynode>
frameborder="0" scrolling="no" width="1024px" height="768px"></iframe>
var_dumping $vncwebsocket results in just a port in the data array.
No errors in the httpd error log.
The strange thing is, when I log in to my Proxmox control panel, the
NOVNC screen starts to work and all seems fine. When I log out, I get
the same 401 no ticket error.
Any thoughts?
Your help is greatly appreciated!
PS: i am using the 2.1.1 version without guzzle (I am working with PHP 7.0)
Kind regards,
Martin
More information about the pve-user
mailing list