Agent guest trouble

haiwan

Well-Known Member
Apr 23, 2019
249
1
58
37
HTML:
root@pvehk:~# qm guest exec 108 / bin / ping 8.8.8.8
Wide character in die at /usr/share/perl5/PVE/RESTHandler.pm line 860.
Agent error: Guest agent command failed, error was 'Failed to execute child process “/” (Permission denied)'
root@pvehk:~# qm guest exec 108 /bin/ping 8.8.8.8
Wide character in die at /usr/share/perl5/PVE/RESTHandler.pm line 860.
Agent error: Guest agent command failed, error was 'Failed to execute child process “/bin/ping” (Permission denied)'
we read this url https://forum.proxmox.com/threads/q...qemu-vmid-agent-exec-how-to-send-array.58800/
and test failed.
please give me guide. tks
 
Hi,

/bin/ping” (Permission denied)'

Weird! ping is permission denied, please see if you have permission to execute ping, or see your id
qm guest exec 108 '/bin/id'

or try with way please /bin/ping
qm guest exec 108 -- /bin/ping -c 1 8.8.8.8
 
Hi,



Weird! ping is permission denied, please see if you have permission to execute ping, or see your id
qm guest exec 108 '/bin/id'

or try with way please /bin/ping
qm guest exec 108 -- /bin/ping -c 1 8.8.8.8
Moayad
tks. let me try
 
Hi,



Weird! ping is permission denied, please see if you have permission to execute ping, or see your id
qm guest exec 108 '/bin/id'

or try with way please /bin/ping
qm guest exec 108 -- /bin/ping -c 1 8.8.8.8
still reply this
root@pvehk:~# qm guest exec 108 -- /bin/ping -c 1 8.8.8.8
Wide character in die at /usr/share/perl5/PVE/RESTHandler.pm line 860.
Agent error: Guest agent command failed, error was 'Failed to execute child process “/bin/ping” (Permission denied)'
 
what the output of this command qm guest exec 108 '/bin/id' ?
Code:
root@pvehk:~# qm guest exec 108 -- /bin/ping -c 1 8.8.8.8
Wide character in die at /usr/share/perl5/PVE/RESTHandler.pm line 860.
Agent error: Guest agent command failed, error was 'Failed to execute child process “/bin/ping” (Permission denied)'
root@pvehk:~# qm guest exec 108 -- ./bin/ping -c 1 8.8.8.8
Wide character in die at /usr/share/perl5/PVE/RESTHandler.pm line 860.
Agent error: Guest agent command failed, error was 'Failed to execute child process “./bin/ping” (Permission denied)'
root@pvehk:~# qm guest exec 108 '/bin/id'
{
   "exitcode" : 0,
   "exited" : 1,
   "out-data" : "uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:virt_qemu_ga_t:s0\n"
}
root@pvehk:~#
 
Please post output the fallowing commands:

pveversion -v
qm config 108
Code:
root@pvehk:~# pveversion -v
proxmox-ve: 6.1-2 (running kernel: 5.3.10-1-pve)
pve-manager: 6.1-3 (running version: 6.1-3/37248ce6)
pve-kernel-5.3: 6.0-12
pve-kernel-helper: 6.0-12
pve-kernel-5.3.10-1-pve: 5.3.10-1
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.2-pve4
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
ksm-control-daemon: 1.3-1
libjs-extjs: 6.0.1-10
libknet1: 1.13-pve1
libpve-access-control: 6.0-5
libpve-apiclient-perl: 3.0-2
libpve-common-perl: 6.0-9
libpve-guest-common-perl: 3.0-3
libpve-http-server-perl: 3.0-3
libpve-storage-perl: 6.1-2
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve3
lxc-pve: 3.2.1-1
lxcfs: 3.0.3-pve60
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.1-1
pve-cluster: 6.1-2
pve-container: 3.0-14
pve-docs: 6.1-3
pve-edk2-firmware: 2.20191002-1
pve-firewall: 4.0-9
pve-firmware: 3.0-4
pve-ha-manager: 3.0-8
pve-i18n: 2.0-3
pve-qemu-kvm: 4.1.1-2
pve-xtermjs: 3.13.2-1
qemu-server: 6.1-2
smartmontools: 7.0-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.2-pve2
root@pvehk:~#
Code:
root@pvehk:~# qm config 108
agent: 1,fstrim_cloned_disks=1
bootdisk: scsi0
cores: 2
ide2: local:iso/CentOS-7-x86_64-DVD-1611.iso,media=cdrom
memory: 4096
name: testagent
net0: virtio=D6:6F:FF:84:5C:BD,bridge=vmbr0,firewall=1,rate=2
numa: 0
ostype: l26
scsi0: local-zfs:vm-108-disk-0,size=32G
scsihw: virtio-scsi-pci
smbios1: uuid=c6dde6f1-3f86-4f88-865b-daade5578905
sockets: 2
vmgenid: e80a221e-e5eb-4d16-bb63-b7c3e10d33b1
root@pvehk:~#
 
Thank you,

everything is ok, i would to say you need to run this command setenforce 0 in CentOS as root then try again

Bash:
qm guest exec 108  -- /bin/ping -c 2 8.8.8.8


I hope this helps :)
 
Thank you,

everything is ok, i would to say you need to run this command setenforce 0 in CentOS as root then try again

Bash:
qm guest exec 108  -- /bin/ping -c 2 8.8.8.8


I hope this helps :)
root@pvehk:~# qm guest exec 122 -- /bin/ping -c 2 8.8.8.8
Wide character in die at /usr/share/perl5/PVE/RESTHandler.pm line 860.
Agent error: Guest agent command failed, error was 'Failed to execute child process “/bin/ping” (Permission denied)'
 
Please post output of this command:
cat /etc/sysconfig/qemu-ga
hi have give me more guide?
tks
root@Taiwan:/etc# qm guest exec 100 -- /bin/ping -c 2 8.8.8.8
Agent error: Guest agent command failed, error was 'Failed to execute child process "/bin/ping" (Permission denied)'
 
Hi,

I tested here works already just setenforce 0 on the VM and do qm guest exec this is my output:

Bash:
qm guest exec 131  -- /bin/ping -c 2 8.8.8.8

{

   "exitcode" : 0,

   "exited" : 1,

   "out-data" : "PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.\n64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=15.5 ms\n64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=15.1 ms\n\n--- 8.8.8.8

ping statistics ---\n2 packets transmitted, 2 received, 0% packet loss, time 1001ms\nrtt min/avg/max/mdev = 15.184/15.348/15.513/0.205 ms\n"                                             

}
 
Hi,

I tested here works already just setenforce 0 on the VM and do qm guest exec this is my output:

Bash:
qm guest exec 131  -- /bin/ping -c 2 8.8.8.8

{

   "exitcode" : 0,

   "exited" : 1,

   "out-data" : "PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.\n64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=15.5 ms\n64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=15.1 ms\n\n--- 8.8.8.8

ping statistics ---\n2 packets transmitted, 2 received, 0% packet loss, time 1001ms\nrtt min/avg/max/mdev = 15.184/15.348/15.513/0.205 ms\n"                                           

}
great. tks
we test ok.
root@Taiwan:~# qm guest exec 100 -- /bin/ping -c 2 8.8.8.8
{
"exitcode" : 0,
"exited" : 1,
"out-data" : "PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.\n64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=0.775 ms\n64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=0.843 ms\n\n--- 8.8.8.8 ping statistics ---\n2 packets transmitted, 2 received, 0% packet loss, time 1000ms\nrtt min/avg/max/mdev = 0.775/0.809/0.843/0.034 ms\n"
}
root@Taiwan:~#

so we have get about how to use qm guest exec config ip address. tks .we still no how to work .
 
so we have get about how to use qm guest exec config ip address. tks .we still no how to work .

this depends on the distribution/OS you're running in the VM, since they have different implementations (networkmanager, systemd-networkd. /etc/network/interfaces, and so on..)

cloud-init can be used to configure networking for VMs though, which would work simpler..

otherwise you can try writing scripts for each distro to configure network, and call that script with arguments via `qm guest exec`
 
  • Like
Reactions: Moayad
this depends on the distribution/OS you're running in the VM, since they have different implementations (networkmanager, systemd-networkd. /etc/network/interfaces, and so on..)

cloud-init can be used to configure networking for VMs though, which would work simpler..

otherwise you can try writing scripts for each distro to configure network, and call that script with arguments via `qm guest exec`
now we all test in centos 7 . so have wish give me a demo let me study.
tks oguz
 
great. tks
we test ok.
root@Taiwan:~# qm guest exec 100 -- /bin/ping -c 2 8.8.8.8
{
"exitcode" : 0,
"exited" : 1,
"out-data" : "PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.\n64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=0.775 ms\n64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=0.843 ms\n\n--- 8.8.8.8 ping statistics ---\n2 packets transmitted, 2 received, 0% packet loss, time 1000ms\nrtt min/avg/max/mdev = 0.775/0.809/0.843/0.034 ms\n"
}
root@Taiwan:~#

so we have get about how to use qm guest exec config ip address. tks .we still no how to work .
so you complete use qm guest exec config ip? how to do it?
 

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!