User Tools

Site Tools


os:proxmox_ve:guest_agent

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
os:proxmox_ve:guest_agent [2020-04-13 01:37] Manuel Freios:proxmox_ve:guest_agent [2020-05-19 20:05] (current) Manuel Frei
Line 19: Line 19:
 </code> </code>
  
-===== Windows =====+ 
 +===== Execute Command ===== 
 + 
 +==== Enable ==== 
 + 
 +Per default the qemu-guest-agent doesn't allow command execution. You will see the following error message, if you try it:  
 + 
 +<code> 
 +root@mypve:~# qm guest exec 101 /bin/ls 
 +Agent error: The command guest-exec has been disabled for this instance 
 +</code> 
 + 
 +=== CentOS / RHEL === 
 + 
 +Open the config file. 
 +<code> 
 +vi /etc/sysconfig/qemu-ga 
 +</code> 
 + 
 +Search for the blacklist line. 
 +<code> 
 +BLACKLIST_RPC=guest-file-open,guest-file-close,guest-file-read,guest-file-write,guest-file-seek,guest-file-flush,guest-exec,guest-exec-status 
 +</code> 
 + 
 +Remove guest-exec (and guest-exec-status for async exec calls). 
 +<code> 
 +BLACKLIST_RPC=guest-file-open,guest-file-close,guest-file-read,guest-file-write,guest-file-seek,guest-file-flush 
 +</code> 
 + 
 +Restart the agent. 
 +<code> 
 +systemctl restart qemu-guest-agent 
 +</code> 
 + 
 +==== Use ==== 
 + 
 +<code> 
 +qm guest exec <vmid> <command> <arg1> <arg2> ... 
 +</code> 
 + 
 +<code> 
 +root@mypve:~# qm guest exec 101 /bin/ls -- "-la" "/etc/hosts" 
 +
 +   "exitcode" : 0, 
 +   "exited" : 1, 
 +   "out-data" : "-rw-r--r--. 1 root root 158 Sep 10  2018 /etc/hosts\n" 
 +
 +</code> 
 + 
 +===== Installation on Windows =====
  
   * Download the latest VirtIO ISO ([[https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/|Fedora VirtIO Archive]])   * Download the latest VirtIO ISO ([[https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/|Fedora VirtIO Archive]])
Line 29: Line 78:
   * Reboot the vm   * Reboot the vm
  
-===== Linux =====+===== Installation on Linux =====
  
 For Debian/Ubuntu based systems: For Debian/Ubuntu based systems:
os/proxmox_ve/guest_agent.1586734662.txt.gz · Last modified: 2020-04-13 01:37 by Manuel Frei