Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VNC not working #8

Open
peter81745 opened this issue Sep 8, 2019 · 4 comments
Open

VNC not working #8

peter81745 opened this issue Sep 8, 2019 · 4 comments

Comments

@peter81745
Copy link

Code:

$node = 'AoW';
$vmid = 501;
$f = Nodes::createQemuVncproxy($node, $vmid, $data = array());
$array = json_decode(json_encode($f), True);
Nodes::qemuVncwebsocket($node, $vmid, $array["data"]["port"], $array["data"]["ticket"]);
$vnc = 'https://xxx.xxx.xxx.xxx:8006/?console=kvm&novnc=1&node='.$node.'&resize=scale&vmid='.$vmid.'&path=api2/json/nodes/'.$node.'/qemu/'.$vmid.'/vncwebsocket?port=' . $array["data"]["port"] . '&vncticket=' . $array["data"]["ticket"];
echo $vnc;
echo '<iframe src="'.$vnc.'" width="1280" height="720" allowfullscreen="true"></iframe>';

it always says: Failed to connect to server

@emresaracoglu
Copy link

I don't think proxmox works compatible with this script anymore with new API codes.

@peter81745
Copy link
Author

i am using Proxmox VE 5.4 and everything works just fine except this vnc thing

@rmdhfz
Copy link

rmdhfz commented Oct 16, 2020

same issuem i am using Proxmox VE 6

@AnushK-Fro
Copy link
Contributor

AnushK-Fro commented Nov 2, 2020

Note with this code, the Proxmox panel and Laravel panel must be under the same domain. Also, please create an isolated user for each user. If the user goes to VNC, they can access the Proxmox panel too.

public function vnc() {
        $acl = [
            'username' => 'User username',
            'password' => 'User password',
            'realm' => 'pve'
        ];

        $ticket = Access::createTicket($acl);
        $ticket = json_encode($ticket, true);
        $ticket = json_decode($ticket, true);

        setcookie('PVEAuthCookie', $ticket['data']['ticket'], 0, '/', 'PROXMOXDOMAIN', false);

        return print("<iframe width=\"100%\" height=\"100%\" frameborder=\"0\" allowfullscreen=\"\" src=\"https://PROXMOXHOSTNAME:8006/?console=kvm&novnc=1&node=NODENAMEHERE&resize=scale&vmid=VMIDHERE\"></iframe>");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants