Hi all,
I'm working on a minimalistic service to let users create and manage their own OpenVZ VMs and access their VM terminal through my website.
My original plan was to simply embed in an iframe (in my website) the VM's NoVNC console url, ex:
However this doesn't work because I need to pass a cookie containing the access-ticket (which I can get via the API) to my proxmox server in order to access such page. The problem is that I can't set cookies to my proxmox server from my website server (they live on separate machines), this is a general rule with cookies.
Question:
Is there an API or page on my proxmox server that I can call/create to set the access-ticket cookie? For example I could create a php page in my proxmox server that receives a POST request containing the ticket and set it as a cookie. Is there already such a page somewhere? If not, can anyone point me on how I would go about creating one?
Alternatively, (since I create a proxmox user for every user in my website) is there a way to programmatically log in a proxmox user via API? This way I'm prettey sure the user would have the ticket correctly set to access the VM console URL.
If there is any other method I didn't think of to setup VM console access from another website which is not the proxmox server please let me know.
Thank you!
Mic
I'm working on a minimalistic service to let users create and manage their own OpenVZ VMs and access their VM terminal through my website.
My original plan was to simply embed in an iframe (in my website) the VM's NoVNC console url, ex:
HTML:
<iframe src="https://<proxmox-server-iport>/?console=openvz&novnc=1&vmid=123&vmname=hostname&node=proxmox">...
However this doesn't work because I need to pass a cookie containing the access-ticket (which I can get via the API) to my proxmox server in order to access such page. The problem is that I can't set cookies to my proxmox server from my website server (they live on separate machines), this is a general rule with cookies.
Question:
Is there an API or page on my proxmox server that I can call/create to set the access-ticket cookie? For example I could create a php page in my proxmox server that receives a POST request containing the ticket and set it as a cookie. Is there already such a page somewhere? If not, can anyone point me on how I would go about creating one?
Alternatively, (since I create a proxmox user for every user in my website) is there a way to programmatically log in a proxmox user via API? This way I'm prettey sure the user would have the ticket correctly set to access the VM console URL.
If there is any other method I didn't think of to setup VM console access from another website which is not the proxmox server please let me know.
Thank you!
Mic
Last edited: