I am trying to connect to a VM using a spice console without using the Web UI as many have done before
(see https://forum.proxmox.com/threads/spiceproxy-via-api.103395
I have looked at using both VDI viewer and trying to use the proxmox api in python to get the ticket
I am able to launch a spice session through the web ui however I cannot get it to work any other way
Anytime I try query the APII always get a 501 not found
when looking for a solution, I was directed to the api viewer and discovered that it does not appear as if the spice server is being exposed through the api
https://10.10.20.2:8006/api2/html/
I have tried with many curl commands
/api2/json/nodes/
/api2/spiceconfig/nodes/
etc
I can only seem to get a spice connexion when clicking the button in the web UI and haven't got anything to work any other way
Cannot find anybody else with the same problem whose solution worked, at a bit of a loss
(see https://forum.proxmox.com/threads/spiceproxy-via-api.103395
I have looked at using both VDI viewer and trying to use the proxmox api in python to get the ticket
Python:
cmd = 'curl -f -X POST -s -S -k -b "PVEAuthCookie={}" -H "CSRFPreventionToken: {}" https://{}:8006//api2/json/nodes/miniboi1/qemu/108/spiceproxy > ./spiceproxy.vv'.format(Ticket,Token,server,node,vm)
os.system(cmd)
I am able to launch a spice session through the web ui however I cannot get it to work any other way
Anytime I try query the APII always get a 501 not found
Code:
C:\Users\tobyw>curl -f -X POST -v -s -S -k -b "PVEAuthCookie=PVE:root@pam:MY TOKEN" -H "CSRFPreventionToken: TOKEN" https://10.10.20.2:8006//api2/json/nodes/miniboi1/qemu/108/spiceproxy
* Trying 10.10.20.2:8006...
* schannel: disabled automatic use of client certificate
* schannel: using IP address, SNI is not supported by OS.
* ALPN: curl offers http/1.1
* ALPN: server did not agree on a protocol. Uses default.
* Connected to 10.10.20.2 (10.10.20.2) port 8006
* using HTTP/1.x
> POST //api2/json/nodes/miniboi1/qemu/108/spiceproxy HTTP/1.1
> Host: 10.10.20.2:8006
> User-Agent: curl/8.10.1
> Accept: */*
> Cookie: PVEAuthCookie=THE TOKEN
> CSRFPreventionToken: THE OTHER MORE DIFERANT TOKEN
>
* schannel: remote party requests renegotiation
* schannel: renegotiating SSL/TLS connection
* schannel: SSL/TLS connection renegotiated
* schannel: remote party requests renegotiation
* schannel: renegotiating SSL/TLS connection
* schannel: SSL/TLS connection renegotiated
< HTTP/1.1 501 no such file '/json/nodes/miniboi1/qemu/108/spiceproxy'
< Cache-Control: max-age=0
< Connection: close
< Date: Thu, 09 Jan 2025 20:59:24 GMT
< Pragma: no-cache
< Server: pve-api-daemon/3.0
< Expires: Thu, 09 Jan 2025 20:59:24 GMT
* The requested URL returned error: 501
<
* closing connection #0
curl: (22) The requested URL returned error: 501
when looking for a solution, I was directed to the api viewer and discovered that it does not appear as if the spice server is being exposed through the api
https://10.10.20.2:8006/api2/html/
I have tried with many curl commands
/api2/json/nodes/
/api2/spiceconfig/nodes/
etc
I can only seem to get a spice connexion when clicking the button in the web UI and haven't got anything to work any other way
Cannot find anybody else with the same problem whose solution worked, at a bit of a loss