sorry again ask qemu agent trouble.

haiwan

Active Member
Apr 23, 2019
234
1
38
36
Hi . we many times try use agent config ip address
eg centos7 or windows 2016
if we use scripts config ip address, how to send scripts into vm inside?
because we use php running pve api running this scripts config ip.
tks give me guide.
and we panel is PHP language developing. so we no understand how to use php running
qm guest exec <VMID> -- <Commad inside VM>
 
Last edited:
hi,

are you asking how to run that command in php?

you can use system or shell_exec to run commands on the host. be very careful for input sanitization since these can also be abused by attackers to execute commands on your systems
 
hi,

are you asking how to run that command in php?

you can use system or shell_exec to run commands on the host. be very careful for input sanitization since these can also be abused by attackers to execute commands on your systems
tks,
oguz
my pve manage system is php.now have support cloud-init config ip address set password all ok,
and we still resolve about use qemu-agent config ip address inside vm.
before you tell me maybe write shell, later call shell running config ip. but have a case , how to send script into vm inside ?
sorry too trouble you . we just let manage system more power.
 
i'm not sure what you're trying to accomplish, can you explain your setup?

from what i understand you have a PHP panel using the PVE API and you want to use the guest agent to execute commands inside the VM?

what "script" are you trying to send inside the VM?
 
i'm not sure what you're trying to accomplish, can you explain your setup?

from what i understand you have a PHP panel using the PVE API and you want to use the guest agent to execute commands inside the VM?

what "script" are you trying to send inside the VM?
we plan use execute commmands edit vm inside network eth(eg:centos eth name is ifcfg-eth0) config ip address.
now we use cloud-init Full support. just wish agent same .
tks use your time.
 
i'm not sure what you're trying to accomplish, can you explain your setup?

from what i understand you have a PHP panel using the PVE API and you want to use the guest agent to execute commands inside the VM?

what "script" are you trying to send inside the VM?
sorry let you reay trouble.
now we just wish get guide this
eg:
on pve server shell we use : qm agent vmid ping is ok
but we use api unknow how to write command and input-data send in vm.
 
to execute commands on the VM through guest agent:
# qm guest exec ID yourcommand -- "arguments here"

over the API you can do it the same [0] [1] just follow the documentation

[0]: https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/agent/exec
[1]: https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/qemu/{vmid}/agent/exec_status
:eek: issue we use shell qm guest is running successfull. but use api still error. we client is php . so just unknow how to use php running this .
eg: qm guest exec 100 -- /bin/ping -c 2 8.8.8.8
if use php code, how to write let work?
tks your reply. but really need you guide. tks again.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!