Corsinvest / cv4pve-pepper

Launching SPICE remote-viewer for Proxmox VE VDI client
https://www.corsinvest.it/cv4pve
GNU General Public License v3.0
98 stars 15 forks source link

No spice port #8

Closed gsads closed 2 years ago

gsads commented 3 years ago

When I execute the script in U20.04, it executes but nothing happens. ./cv4pve-pepper --host=192.168.1.111 --username=root --password=secret --vmid 100 --viewer /usr/bin/virt-viewer I'm using the following: --host=IP of the Proxmox server --username=same username as when logging in to Proxmox from the web interface --password=same password as when logging in to Proxmox from the web interface --vmid=virtual machine number in Proxmox Adding the --debug switch reveals a "no spice port" error. Where do I specify the Spice port?

franklupo commented 3 years ago

did you change the default port?

gsads commented 3 years ago

I don't think so... how would I have done that?

franklupo commented 3 years ago

Can attach log execution?

gsads commented 3 years ago

`./cv4pve-pepper --host=192.168.1.101 --username=root --password=secret --vmid 100 --viewer /usr/bin/virt-viewer --debug Method: POST, Url: https://192.168.1.101:8006/api2/json/access/ticket Parameters: password : secret username : root realm : pam StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True { "data": { "ticket": "PVE:root@pam:5BLA5::blablabla==", "username": "root@pam", "cap": { "dc": { "Sys.Audit": 1 }, "access": { "User.Modify": 1, "Group.Allocate": 1, "Permissions.Modify": 1 }, "nodes": { "Sys.Modify": 1, "Sys.Audit": 1, "Sys.PowerMgmt": 1, "Sys.Syslog": 1, "Permissions.Modify": 1, "Sys.Console": 1 }, "vms": { "VM.Snapshot": 1, "VM.Snapshot.Rollback": 1, "VM.Backup": 1, "VM.Config.CPU": 1, "VM.PowerMgmt": 1, "VM.Monitor": 1, "VM.Config.HWType": 1, "VM.Config.Options": 1, "VM.Config.Memory": 1, "VM.Audit": 1, "VM.Clone": 1, "VM.Config.CDROM": 1, "VM.Migrate": 1, "VM.Allocate": 1, "VM.Config.Network": 1, "VM.Console": 1, "Permissions.Modify": 1, "VM.Config.Disk": 1 }, "storage": { "Datastore.Allocate": 1, "Permissions.Modify": 1, "Datastore.AllocateTemplate": 1, "Datastore.AllocateSpace": 1, "Datastore.Audit": 1 } }, "CSRFPreventionToken": "BLA:blablabla" } }

Method: GET, Url: https://192.168.1.101:8006/api2/json/cluster/resources?type=vm StatusCode: OK ReasonPhrase: OK IsSuccessStatusCode: True { "data": [ { "status": "running", "vmid": 100, "cpu": 0.00505773262059924, "disk": 0, "netout": 1153479392, "uptime": 436449, "maxdisk": 34359738368, "type": "qemu", "name": "snow", "node": "nimbus", "diskwrite": 2600908800, "netin": 301120087, "id": "qemu/100", "diskread": 3071012864, "template": 0, "maxcpu": 6, "mem": 3465654272, "maxmem": 8589934592 }, { "maxdisk": 34359738368, "uptime": 631193, "type": "qemu", "name": "rain", "node": "nimbus", "diskwrite": 84623795712, "status": "running", "vmid": 101, "cpu": 0.0780335890035312, "disk": 0, "netout": 169340, "diskread": 585445560, "template": 0, "mem": 1520459776, "maxcpu": 2, "maxmem": 8589934592, "netin": 299856111, "id": "qemu/101" }, { "node": "nimbus", "diskwrite": 20717602816, "uptime": 631189, "maxdisk": 53687091200, "type": "qemu", "name": "mist", "disk": 0, "netout": 43485356, "status": "running", "vmid": 150, "cpu": 0.0146312979381621, "template": 0, "mem": 3531390833, "maxcpu": 2, "maxmem": 4294967296, "diskread": 14264598528, "id": "qemu/150", "netin": 938485831 } ] }

Method: POST, Url: https://192.168.1.101:8006/api2/json/nodes/nimbus/qemu/100/spiceproxy Parameters: proxy : 192.168.1.101 StatusCode: InternalServerError ReasonPhrase: no spice port IsSuccessStatusCode: False { "data": null } =============================`

franklupo commented 3 years ago

The service is running?

franklupo commented 3 years ago

Tenere is the ip of nimbus host ?

gsads commented 3 years ago

What is "tenere"? Yes. My Proxmox host is called nimbus and has IP of 192.168.1.101. I changed it from my first post if you are wondering why it is different.

franklupo commented 3 years ago

have you enabled the firewall?

franklupo commented 3 years ago

you have change display hardware on spice?

gsads commented 3 years ago

No firewall. I haven't changed anything on virt-viewer. I just tested it and it works on a VM I have running locally: sads@SadsXPS:~$ virt-viewer de6a8d2b-9d2a-4f3b-90e8-7725f27fd0d9 --debug (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.393: connecting ... (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.393: Opening connection to libvirt with URI <null> (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.438: initial connect (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.438: notebook show status 0x55e9cde2e310 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.440: virt_viewer_app_set_uuid_string: UUID changed to de6a8d2b-9d2a-4f3b-90e8-7725f27fd0d9 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.440: notebook show status 0x55e9cde2e310 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.440: Guest de6a8d2b-9d2a-4f3b-90e8-7725f27fd0d9 is running, determining display (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.443: Set connect info: (null),(null),-1,-1,(null),(null),(null),0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.453: Guest Win10-200106 has a spice display (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.468: Guest graphics address is 127.0.0.1:5900 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.468: Set connect info: localhost,127.0.0.1,5900,-1,(null),(null),(null),-1 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.468: Error operation forbidden: read only access prevents virDomainOpenGraphicsFD (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.468: After open connection callback fd=-1 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.468: Opening direct TCP connection to display at 127.0.0.1:5900:-1 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.475: New spice channel 0x55e9ce290c00 SpiceMainChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.475: notebook show status 0x55e9cde2e310 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.475: reconnect_poll: 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.945: main channel: opened (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.945: notebook show status 0x55e9cde2e310 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.949: app is not in full screen (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.949: app is not in full screen (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.949: New spice channel 0x55e9ce0c9f90 SpiceUsbredirChannel 1 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.949: new usbredir channel (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.949: New spice channel 0x55e9cdfdc9e0 SpiceUsbredirChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.949: new usbredir channel (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.949: New spice channel 0x55e9ce300e70 SpiceRecordChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.949: New spice channel 0x55e9ce3ef670 SpicePlaybackChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:14.949: new audio channel (virt-viewer:26165): virt-viewer-DEBUG: 08:55:15.006: New spice channel 0x55e9cdf7cab0 SpiceDisplayChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:15.006: New spice channel 0x55e9cdf8ea80 SpiceCursorChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:15.009: New spice channel 0x55e9ce553290 SpiceInputsChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:15.009: new inputs channel (virt-viewer:26165): virt-viewer-DEBUG: 08:55:15.120: creating spice display (#:0) (virt-viewer:26165): virt-viewer-DEBUG: 08:55:15.120: Insert display 0 0x55e9ce2a3f50 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:15.132: Found a window without a display, reusing for display #0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:15.132: notebook show display 0x55e9cde2e310 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:15.164: Allocated 1280x800 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:15.164: Child allocate 1280x800 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:15.191: Allocated 1280x800 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:15.192: Child allocate 1280x800 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:24.723: Allocated 1280x800 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:24.723: Child allocate 1280x800 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.458: Window closed (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.461: Destroying spice display 0x55e9ce2a3f50 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.462: Not removing main window 0 0x55e9cdfbc120 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.465: Destroy SPICE channel SpiceInputsChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.466: Destroy SPICE channel SpiceCursorChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.466: Destroy SPICE channel SpiceDisplayChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.466: zap display channel (#0) (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.466: Destroy SPICE channel SpicePlaybackChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.466: Destroy SPICE channel SpiceRecordChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.466: Destroy SPICE channel SpiceUsbredirChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.466: zap usbredir channel (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.466: Destroy SPICE channel SpiceUsbredirChannel 1 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.466: zap usbredir channel (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.466: Destroy SPICE channel SpiceMainChannel 0 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.466: zap main channel (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.469: notebook show status 0x55e9cde2e310 (virt-viewer:26165): virt-viewer-DEBUG: 08:55:27.469: Guest Win10-200106 display has disconnected, shutting down

franklupo commented 3 years ago

in Proxmox VE to use SPICE you have to change video on spice see https://pve.proxmox.com/wiki/SPICE

ghost commented 3 years ago

I have same issue with Proxmox 6.2 and Ubuntu 20.04 No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal

Debug messages show all OK but I see error message Unable to connect to libvirt with URI: [no]

Spice hw is selected in Proxmox VM and with original spice client works perfectly fine.

Any ideas?

franklupo commented 3 years ago

could this be the problem? https://forum.proxmox.com/threads/cant-connect-to-spice.33383/

Best regards

ghost commented 3 years ago

I do not think so.

If I download spice config file from Proxmox web panel or open it directly in virt-viewer it works fine

franklupo commented 3 years ago

can you attach spiace config?

ghost commented 3 years ago

Here is my spice.config

Some passwords and certificartes are shortened :-)

https://pastebin.com/pqy12RQN

franklupo commented 3 years ago

test new relase with parameter --proxy

ghost commented 3 years ago

Sorry for dumb question.

How should I use proxy parameter? Should it be proxmox host IP? If I use this IP, result is unfortunately same same. No connection.

franklupo commented 3 years ago

HI, Can you attach the command line you use?

best regards

ghost commented 3 years ago

I use standard command from your page

cv4pve-pepper --host=hv.c2.uz --username=root --password=12345 --vmid 201 --viewer=/usr/bin/virt-viewer --proxy=hv.c2.uz

franklupo commented 3 years ago

You can ecexute with --debug and attach output?

Best regards

ghost commented 3 years ago

Here are debug logs

https://pastebin.com/p0en54T0

franklupo commented 3 years ago

Hi, test new version 1.3.7

best regards

ghost commented 3 years ago

Hi, I am sorry to say but result is same.

No connection.

here are debug logs https://pastebin.com/fuZPyRey

franklupo commented 3 years ago

Test new version. I imporve the log. Use the parameter --debug and attach me result.

Bets regards

ghost commented 3 years ago

Here are logs as requested.

https://pastebin.com/qanZdjeQ

and virt-client config file https://pastebin.com/KWXFjucd

Links are working for 1 week.

PS I tried latest version on another Proxmox node, result is same, no connection.

franklupo commented 3 years ago

The problem is Ubuntu 20.04. I'm investigating

Best rgards