[GH-ISSUE #102] Getting VNCProxy information out of proxmoxer #51

Closed
opened 2026-02-27 15:46:11 +03:00 by kerem · 6 comments
Owner

Originally created by @WillNilges on GitHub (Jul 2, 2022).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/102

Originally assigned to: @jhollowe on GitHub.

Hello!

I'm wondering if it's possible to hit the vncproxy POST endpoint and the vncwebsocket GET endpoint via proxmoxer?

https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/vncproxy

https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/vncwebsocket

If so, can someone give me an example for how you'd do this?

Originally created by @WillNilges on GitHub (Jul 2, 2022). Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/102 Originally assigned to: @jhollowe on GitHub. Hello! I'm wondering if it's possible to hit the `vncproxy` POST endpoint and the `vncwebsocket` GET endpoint via proxmoxer? https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/vncproxy https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/vncwebsocket If so, can someone give me an example for how you'd do this?
kerem 2026-02-27 15:46:11 +03:00
Author
Owner

@WillNilges commented on GitHub (Jul 2, 2022):

This worked for the first call...

print(proxmox.nodes("my_proxmox_node").qemu(my_id).vncproxy.post())
<!-- gh-comment-id:1172928078 --> @WillNilges commented on GitHub (Jul 2, 2022): This worked for the first call... ``` print(proxmox.nodes("my_proxmox_node").qemu(my_id).vncproxy.post()) ```
Author
Owner

@WillNilges commented on GitHub (Jul 2, 2022):

Getting this error while running this command:

vnc_socket = proxmox.nodes("my_proxmox_node").qemu(my_id).vncwebsocket.get()
Traceback (most recent call last):
  File "/Users/willard.nilges/Code/python-proxmox-vnc/main.py", line 49, in <module>
    vnc_socket = proxmox.nodes("proxmox01-nrh").qemu(search_id).vncwebsocket.get()
  File "/Users/willard.nilges/Code/python-proxmox-vnc/venv/lib/python3.9/site-packages/proxmoxer/core.py", line 143, in get
    return self(args)._request("GET", params=params)
  File "/Users/willard.nilges/Code/python-proxmox-vnc/venv/lib/python3.9/site-packages/proxmoxer/core.py", line 123, in _request
    raise ResourceException(
proxmoxer.core.ResourceException: 400 Bad Request: Parameter verification failed. - {'vncticket': 'property is missing and it is not optional', 'port': 'property is missing and it is not optional'}

Clearly missing a property---how can I add that? I have both of them, I just don't know how to insert them into the command.

<!-- gh-comment-id:1172929640 --> @WillNilges commented on GitHub (Jul 2, 2022): Getting this error while running this command: ``` vnc_socket = proxmox.nodes("my_proxmox_node").qemu(my_id).vncwebsocket.get() ``` ``` Traceback (most recent call last): File "/Users/willard.nilges/Code/python-proxmox-vnc/main.py", line 49, in <module> vnc_socket = proxmox.nodes("proxmox01-nrh").qemu(search_id).vncwebsocket.get() File "/Users/willard.nilges/Code/python-proxmox-vnc/venv/lib/python3.9/site-packages/proxmoxer/core.py", line 143, in get return self(args)._request("GET", params=params) File "/Users/willard.nilges/Code/python-proxmox-vnc/venv/lib/python3.9/site-packages/proxmoxer/core.py", line 123, in _request raise ResourceException( proxmoxer.core.ResourceException: 400 Bad Request: Parameter verification failed. - {'vncticket': 'property is missing and it is not optional', 'port': 'property is missing and it is not optional'} ``` Clearly missing a property---how can I add that? I have both of them, I just don't know how to insert them into the command.
Author
Owner

@WillNilges commented on GitHub (Jul 2, 2022):

Theoretically, this works

vnc_socket = proxmox.nodes("my_node").qemu(my_id).vncwebsocket().get(port=vnc_port, vncticket=vnc_ticket)

If this all works out, I'm opening a documentation PR.

<!-- gh-comment-id:1172934288 --> @WillNilges commented on GitHub (Jul 2, 2022): Theoretically, this works ``` vnc_socket = proxmox.nodes("my_node").qemu(my_id).vncwebsocket().get(port=vnc_port, vncticket=vnc_ticket) ``` If this all works out, I'm opening a documentation PR.
Author
Owner

@jhollowe commented on GitHub (Jul 3, 2022):

It seems that you first need to call nodes/{node}/qemu/{vmid}/vncproxy to get the port and ticket information to use with nodes/{node}/qemu/{vmid}/vncwebsocket

However, I have no idea how proxmoxer (and ultimately requests) will handle the VNC websocket. I really don't see this being useful for programmatic use, but if to wanted to do that, I don't think you would use proxmoxer to handle the VNC traffic. You can use the vncproxy endpoint to setup a connection and use other software to manage the VNC connection.

<!-- gh-comment-id:1173001845 --> @jhollowe commented on GitHub (Jul 3, 2022): It seems that you first need to call `nodes/{node}/qemu/{vmid}/vncproxy` to get the port and ticket information to use with `nodes/{node}/qemu/{vmid}/vncwebsocket` However, I have no idea how proxmoxer (and ultimately requests) will handle the VNC websocket. I really don't see this being useful for programmatic use, but if to wanted to do that, I don't think you would use proxmoxer to handle the VNC traffic. You can use the `vncproxy` endpoint to setup a connection and use other software to manage the VNC connection.
Author
Owner

@WillNilges commented on GitHub (Jul 3, 2022):

Thanks for the info!

I spent yesterday poking around the proxmox forums, and yes, it appears that that secondary endpoint should be used as a websocket (wss://) connection. It seems like Proxmox has some patches for noVNC that enable it to handle this. I've been trying to get that set up as a standalone thing, but am struggling. I don't suppose you have any recommendations for VNC clients that can handle websockets?

<!-- gh-comment-id:1173165905 --> @WillNilges commented on GitHub (Jul 3, 2022): Thanks for the info! I spent yesterday poking around the proxmox forums, and yes, it appears that that secondary endpoint should be used as a websocket (`wss://`) connection. It seems like Proxmox has some patches for noVNC that enable it to handle this. I've been trying to get that set up as a standalone thing, but am struggling. I don't suppose you have any recommendations for VNC clients that can handle websockets?
Author
Owner

@jhollowe commented on GitHub (Jul 4, 2022):

Well, I think you can use noVNC which Proxmox uses, but I'm not sure if that will work for your needs.

I'm going to close as it seems proxmoxer is working as intended. If you get something working, feel free to open a PR against the documentation repo.

<!-- gh-comment-id:1173765734 --> @jhollowe commented on GitHub (Jul 4, 2022): Well, I think you can use noVNC which Proxmox uses, but I'm not sure if that will work for your needs. I'm going to close as it seems proxmoxer is working as intended. If you get something working, feel free to open a PR against the [documentation repo](https://github.com/proxmoxer/docs).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmoxer#51
No description provided.