[SOLVED] QM Exec Error

May 18, 2019
231
15
38
Varies
Ozd0eQW.png


Started this morning. First time I try to 'qm exec' since updating to the current version:


Code:
proxmox-ve: 6.0-2 (running kernel: 5.0.21-4-pve)
pve-manager: 6.0-15 (running version: 6.0-15/52b91481)
pve-kernel-helper: 6.0-12
pve-kernel-5.0: 6.0-11
pve-kernel-5.0.21-5-pve: 5.0.21-10
pve-kernel-5.0.21-4-pve: 5.0.21-9
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.2-pve4
criu: 3.11-3
glusterfs-client: 5.5-3
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.0-12
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.0-9
pve-container: 3.0-14
pve-docs: 6.0-9
pve-edk2-firmware: 2.20190614-1
pve-firewall: 4.0-8
pve-firmware: 3.0-4
pve-ha-manager: 3.0-5
pve-i18n: 2.0-3
pve-qemu-kvm: 4.1.1-1
pve-xtermjs: 3.13.2-1
qemu-server: 6.1-1
smartmontools: 7.0-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.2-pve2
 
hi,

if you're on the same node as the VM, you can do like this: qm guest exec ID -- ls -la where ls -la can be replaced with whichever command + args you want
 
hi,

if you're on the same node as the VM, you can do like this: qm guest exec ID -- ls -la where ls -la can be replaced with whichever command + args you want

Thanks, but the point is not that the ll didn't work. It is that upgrade.sh was "not found", when it is there. And to prove that something is wrong, shouldn't 'which bash' work?

OMRJ2kI.png
 
Last edited:
you are quoting the whole binary to be executed, so it tries to execute "which bash", which correctly, it does not find anywhere in $PATH ;) compare the difference between bash -c 'exec "which bash"' and bash -c 'exec which bash'
 
you are quoting the whole binary to be executed, so it tries to execute "which bash", which correctly, it does not find anywhere in $PATH ;) compare the difference between bash -c 'exec "which bash"' and bash -c 'exec which bash'

Thanks Fabian. The syntax I have used to work. How do I exec /home/ubuntu/scripts/upgrade.sh ?
 
qm guest exec 200 /home/ubuntu/scripts/upgrade.sh should work, provided the script is executable and has the right shebang. alternatively, qm guest exec 200 -- /bin/bash /home/ubuntu/scripts/upgrade.sh should work in any case.
 
  • Like
Reactions: Proxygen
Dear all !
I am newbie. I want to config ip for guest with command "echo":
qm guest exec 147 -- echo "IPADDRESS=192.168.1.11" ">>" "/etc/sysconfig/network-scripts/ifcfg-eth0"
Command run no error, but file ifcfg-eth0 on guest is empty.
What wrong ? Can you help me !