[GH-ISSUE #28] Bug Change VM Password #24

Closed
opened 2026-02-26 17:32:09 +03:00 by kerem · 4 comments
Owner

Originally created by @SergioTGSerra on GitHub (Jan 1, 2024).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-api-php/issues/28

I'm using x cv4pve-api-php to communicate with the api

I'm trying to reset the password of a vm using the proxmox API.

$data = $pve->getNodes()->get($node)->getQemu()->get($vmid)->getAgent()->getSetUserPassword()->setUserPassword('Administrator', 'QAZ2wsx2')->getResponse();

return $data;

When I do this command I get the following API response:

{"data": null}

I went to vm but the password is not changed. So I tried the following commands to check if communication to the VM was working and yes it was.

$data1 = $pve->getNodes()->get($node)->getQemu()->get($vmid)->getAgent()->getGetUsers()->getUsers()->getResponse();

$data2 = $pve->getNodes()->get($node)->getQemu()->get($vmid)->getAgent()->getNetworkGetInterfaces()->networkGetInterfaces()->getResponse();

return $data1;

return $data2;
{"data":{"result":[{"user":"Administrator","login-time":1703928164.75337,"domain":"WIN-42DB1GRE758"}]}}

{"data":{"result":[{"name":"Ethernet","statistics":{"rx-bytes":37858,"tx-dropped":0,"tx-errs":0,"rx-packets":16,"rx-errs":0,"rx-dropped":0,"tx-bytes":7751,"tx-packets":13},"hardware-address":"bc:24:11:7b:69:b1","ip-addresses":[{"prefix":64,"ip-address-type":"ipv6","ip-address":"fe80::8629:4e3c:bc25:63e3%14"},{"prefix":24,"ip-address-type":"ipv4","ip-address":"163.172.112.35"},{"ip-address":"169.254.165.33","ip-address-type":"ipv4","prefix":16}]},{"name":"Loopback Pseudo-Interface 1","ip-addresses":[{"ip-address-type":"ipv6","prefix":128,"ip-address":"::1"},{"ip-address":"127.0.0.1","ip-address-type":"ipv4","prefix":8}],"statistics":{"rx-bytes":0,"tx-errs":0,"tx-dropped":0,"rx-packets":0,"rx-errs":0,"rx-dropped":0,"tx-bytes":0,"tx-packets":0}}]}}

Then I changed the password through the proxmox shell with the following command and the password is changed:

qm guest passwd 104 root -password QAZ2wsx

I tried to change the username to root and with that user the error message appears.

$data = $pve->getNodes()->get($node)->getQemu()->get($vmid)->getAgent()->getSetUserPassword()->setUserPassword('root', 'QAZ2wsx2')->getResponse();

return $data;

{"errors":{"password":"value must be at least 5 characters long"},"data":null}

I can't understand why this happened since the root user does not exist in the vm's OS.

If anyone can help I would be grateful. Thanks

Originally created by @SergioTGSerra on GitHub (Jan 1, 2024). Original GitHub issue: https://github.com/Corsinvest/cv4pve-api-php/issues/28 I'm using x [cv4pve-api-php](https://github.com/Corsinvest/cv4pve-api-php) to communicate with the api I'm trying to reset the password of a vm using the proxmox API. ``` $data = $pve->getNodes()->get($node)->getQemu()->get($vmid)->getAgent()->getSetUserPassword()->setUserPassword('Administrator', 'QAZ2wsx2')->getResponse(); return $data; ``` When I do this command I get the following API response: `{"data": null}` I went to vm but the password is not changed. So I tried the following commands to check if communication to the VM was working and yes it was. ``` $data1 = $pve->getNodes()->get($node)->getQemu()->get($vmid)->getAgent()->getGetUsers()->getUsers()->getResponse(); $data2 = $pve->getNodes()->get($node)->getQemu()->get($vmid)->getAgent()->getNetworkGetInterfaces()->networkGetInterfaces()->getResponse(); return $data1; return $data2; ``` ``` {"data":{"result":[{"user":"Administrator","login-time":1703928164.75337,"domain":"WIN-42DB1GRE758"}]}} {"data":{"result":[{"name":"Ethernet","statistics":{"rx-bytes":37858,"tx-dropped":0,"tx-errs":0,"rx-packets":16,"rx-errs":0,"rx-dropped":0,"tx-bytes":7751,"tx-packets":13},"hardware-address":"bc:24:11:7b:69:b1","ip-addresses":[{"prefix":64,"ip-address-type":"ipv6","ip-address":"fe80::8629:4e3c:bc25:63e3%14"},{"prefix":24,"ip-address-type":"ipv4","ip-address":"163.172.112.35"},{"ip-address":"169.254.165.33","ip-address-type":"ipv4","prefix":16}]},{"name":"Loopback Pseudo-Interface 1","ip-addresses":[{"ip-address-type":"ipv6","prefix":128,"ip-address":"::1"},{"ip-address":"127.0.0.1","ip-address-type":"ipv4","prefix":8}],"statistics":{"rx-bytes":0,"tx-errs":0,"tx-dropped":0,"rx-packets":0,"rx-errs":0,"rx-dropped":0,"tx-bytes":0,"tx-packets":0}}]}} ``` Then I changed the password through the proxmox shell with the following command and the password is changed: `qm guest passwd 104 root -password QAZ2wsx` I tried to change the username to root and with that user the error message appears. ``` $data = $pve->getNodes()->get($node)->getQemu()->get($vmid)->getAgent()->getSetUserPassword()->setUserPassword('root', 'QAZ2wsx2')->getResponse(); return $data; ``` `{"errors":{"password":"value must be at least 5 characters long"},"data":null}` I can't understand why this happened since the root user does not exist in the vm's OS. If anyone can help I would be grateful. Thanks
kerem closed this issue 2026-02-26 17:32:09 +03:00
Author
Owner

@franklupo commented on GitHub (Feb 15, 2024):

Hi,m
try with new version.

best regards

<!-- gh-comment-id:1946445816 --> @franklupo commented on GitHub (Feb 15, 2024): Hi,m try with new version. best regards
Author
Owner

@franklupo commented on GitHub (Feb 19, 2024):

News?

<!-- gh-comment-id:1953074227 --> @franklupo commented on GitHub (Feb 19, 2024): News?
Author
Owner

@SergioTGSerra commented on GitHub (Feb 19, 2024):

Hello,

I haven't had time to test it yet. I'll let you know when I test.

<!-- gh-comment-id:1953095195 --> @SergioTGSerra commented on GitHub (Feb 19, 2024): Hello, I haven't had time to test it yet. I'll let you know when I test.
Author
Owner

@SergioTGSerra commented on GitHub (Feb 28, 2024):

Hello,

The team that was developing it chose to migrate software development to Java. So I don't think I'll have the opportunity to test with PHP again. If anyone has problems in the future and sees this issue, they can let you know.

Thank you for your availability.

<!-- gh-comment-id:1969337294 --> @SergioTGSerra commented on GitHub (Feb 28, 2024): Hello, The team that was developing it chose to migrate software development to Java. So I don't think I'll have the opportunity to test with PHP again. If anyone has problems in the future and sees this issue, they can let you know. Thank you for your availability.
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/cv4pve-api-php#24
No description provided.