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

Next revision
Previous revision
os:proxmox_ve:guest_agent [2020-04-10 22:16] – created Manuel Freios:proxmox_ve:guest_agent [2020-05-19 20:05] (current) Manuel Frei
Line 1: Line 1:
-====== Proxmox VE - Guest Agent ======+====== Guest Agent ======
  
 Proxmox vm's use the QEMU guest agent. The official documentation from Proxmox can be found here: [[https://pve.proxmox.com/wiki/Qemu-guest-agent]] Proxmox vm's use the QEMU guest agent. The official documentation from Proxmox can be found here: [[https://pve.proxmox.com/wiki/Qemu-guest-agent]]
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]])
-  * +  * Mount the ISO to the vm 
 +  * Open the device manager 
 +  * Search the device "PCI Simple Communications Controller" 
 +  * Install the driver for this device from the mounted ISO 
 +  * Start the Guest Agent installer from the mounted ISO ("X:\guest-agent\qemu-ga-x86_64.msi"
 +  * Reboot the vm
  
-===== Linux =====+===== Installation on Linux =====
  
 For Debian/Ubuntu based systems: For Debian/Ubuntu based systems:
os/proxmox_ve/guest_agent.1586549812.txt.gz · Last modified: 2020-04-10 22:16 by Manuel Frei