Proxmox qemu agent linux

Qemu-guest-agent

The qemu-guest-agent is a helper daemon, which is installed in the guest. It is used to exchange information between the host and guest, and to execute command in the guest.

In Proxmox VE, the qemu-guest-agent is used for mainly three things:

  1. To properly shutdown the guest, instead of relying on ACPI commands or windows policies
  2. To freeze the guest file system when making a backup/snapshot (on windows, use the volume shadow copy service VSS). If the guest agent is enabled and running, it calls guest-fsfreeze-freeze and guest-fsfreeze-thaw to improve consistency.
  3. In the phase when the guest (VM) is resumed after pause (for example after shapshot) it immediately synchronizes its time with the hypervisor using qemu-guest-agent (as first step).

Installation

Host

You have to install guest-agent in each VM and then enable it, you can do that in the Proxmox VE Webinterface (GUI)

QEMU Guest Agent Option

or via CLI: qm set VMID —agent 1

Guest

Linux

On Linux you have to simply install the qemu-guest-agent, please refer to the documentation of your system.

We show here the commands for Debian/Ubuntu and Redhat based systems:

on Debian/Ubuntu based systems (with apt-get) run:

apt-get install qemu-guest-agent

and on Redhat based systems (with yum):

yum install qemu-guest-agent

Depending on the distribution, the guest agent might not start automatically after the installation.

Start it either directly with

systemctl start qemu-guest-agent

Then enable the service to autostart (permanently) if not auto started, with

systemctl enable qemu-guest-agent

(should work for most distributions) or reboot the guest.

Windows

Screen-vioserial-device-manager.png

Screen-vioserial-driver.png

First you have to download the virtio-win driver iso (see Windows VirtIO Drivers).

Then install the virtio-serial driver:

  1. Attach the ISO to your windows VM (virtio-*.iso)
  2. Go to the windows Device Manager
  3. Look for «PCI Simple Communications Controller»
  4. Right Click -> Update Driver and select on the mounted iso in DRIVE:\vioserial\\ where is your Windows Version (e.g. 2k12R2 for Windows 2012 R2)
Читайте также:  Networking with windows and linux

After that, you have to install the qemu-guest-agent:

  1. Go to the mounted ISO in explorer
  2. The guest agent installer is in the directory guest-agent
  3. Execute the installer with double click (either qemu-ga-x86_64.msi (64-bit) or qemu-ga-i386.msi (32-bit)

After that the qemu-guest-agent should be up and running. You can validate this in the list of Window Services, or in a PowerShell with:

PS C:\Users\Administrator> Get-Service QEMU-GA Status Name DisplayName ------ ---- ----------- Running QEMU-GA QEMU Guest Agent

If it is not running, you can use the Services control panel to start it and make sure that it will start automatically on the next boot.

Testing that the communication with the guest agent is working

The communication with the guest agent takes place over a unix socket located in /var/run/qemu-server/.qga You can test the communication qm agent:

if the qemu-guest-agent is correctly runnning in the VM, it will return without an error message.

Источник

Install Proxmox qemu-guest-agent on Ubuntu 20.04

In this tutorial I will show you how to install the qemu-guest-agent package on Ubuntu 20.04.

1. What is qemu-guest-agent?

The qemu-guest-agent is a helper daemon, which is installed in a guest VM. It is used to exchange information between the host and guest, and to execute commands in the guest machine.

For example, when using Proxmox VE, the qemu-guest-agent is used for the following major features:

  1. To properly shutdown the guest, instead of relying on ACPI commands or windows policies.
  2. To freeze the guest file system when making a backup (on windows, use the volume shadow copy service VSS).

It is a good practice to install the qemu-guest-agent on all VM’s for the above reasons but also for various other stability tweaks and features.

2. Enable qemu-guest-agent in Proxmox for VM

The first step is to enable the qemu-guest-agent option for your VM. In Proxmox VE you can do this as follows.

Firstly, connect to your Proxmox server web interface (by default this is https://proxmox_ip:8006).

Important: Make sure the VM is shutdown before continuing. If the VM is currently running, shut it down now.

Читайте также:  Unpacking tar gz in linux

  1. Select the VM in the Proxmox interface, and then click on the “options” tab.
  2. Click on the “QEMU Guest Agent” row.
  3. Click on the “Edit” button.

  1. Check the “Use QEMU Guest Agent” checkbox.
  2. Click “OK”.
  3. Boot the VM / turn it on.

3. Install QEMU guest agent package on Ubuntu VM

Login to your Ubuntu VM via SSH and issue the following commands:

sudo apt -y install qemu-guest-agent sudo systemctl enable qemu-guest-agent sudo systemctl start qemu-guest-agent

Note: if you get a message saying “The unit files have no installation config” you can safely ignore it.

The qemu-guest-agent is now installed! You can check if the service is running with this command:

sudo systemctl status qemu-guest-agent

This command should give the following output:

● qemu-guest-agent.service - QEMU Guest Agent Loaded: loaded (/lib/systemd/system/qemu-guest-agent.service; static; vendor preset: enabled) Active: active (running) since Mon 2021-11-22 19:52:07 CET; 19min ago Main PID: 464 (qemu-ga) Tasks: 1 (limit: 4637) Memory: 1.0M CGroup: /system.slice/qemu-guest-agent.service └─464 /usr/sbin/qemu-ga

4. Check if guest agent is succesfully running in Proxmox webinterface

An easy way to check if the qemu-guest-agent is running, is to look at the “summary” tab of your VM in Proxmox. It should now show the IP address(es) currently in use by the VM:

That’s it. Your VM is now running the qemu-guest-agent! I hope this guide helped you.

By Leendert de Borst

Freelance software architect with 10+ years of experience. Expert in translating complex technical problems into creative & simple solutions.

Источник

Как подключить qemu-guest-agent на VM в Proxmox

Proxmox

Сегодня расскажу как подключить на виртуальную машину (ВМ) в Proxmox утилиту qemu-guest-agent для просмотра IP-адреса через WEB-интерфейс и правильной завершении работы ВМ.

Что такое qemu-guest-agent

qemu-guest-agent – это вспомогательный демон, который устанавливается в гостевой системе. Он используется для обмена информацией между хостом и гостем, а также для выполнения команды в госте.

В Proxmox VE qemu-guest-agent используется в основном для двух вещей:

  1. Чтобы правильно завершить работу гостя, вместо того чтобы полагаться на команды ACPI или политики Windows
  2. Чтобы заморозить гостевую файловую систему при создании резервной копии (в Windows используйте службу теневого копирования томов VSS).

Установка qemu-guest-agent

На Proxmox

Вы должны установить гостевой агент в каждой виртуальной машине, а затем включить его, вы можете сделать это в веб-интерфейсе Proxmox VE (GUI).

Читайте также:  Посмотреть температуру процессора линукс минт

На Linux VM

В Linux вам нужно просто установить пакет qemu-guest-agent .

Здесь мы покажем команды для систем на базе Debian/Ubuntu и Redhat:

В системах на Debian/Ubuntu выполняем следующие команды:

sudo apt install qemu-guest-agent

На системах на базе Redhat:

yum install qemu-guest-agent

На Windows VM

Сначала вы должны скачать драйвер virtio-win iso (см. Windows VirtIO Drivers).

Затем установите драйвер virtio-serial:

  1. Прикрепите ISO к виртуальной машине Windows (virtio-*.iso)
  2. Перейдите в Диспетчер устройств Windows
  3. Найдите “PCI Simple Communications Controller
  4. Щелкните правой кнопкой мыши ->Обновить драйвер и выберите на смонтированном iso DRIVE:\vioserial\\ where is your Windows Version – ваша версия Windows (например, W7 для Windows 7)

После этого необходимо установить qemu-guest-agent:

  1. Перейти к смонтированному ISO в проводнике
  2. Установщик гостевого агента находится в каталоге гостевой агент
  3. Запустите установщик двойным щелчком (либо qemu-ga-x86_64.msi (64-разрядная версия), либо qemu-ga-i386.msi (32-разрядная версия)

После этого qemu-guest-agent должен быть запущен.

Если он не запущен, вы можете использовать панель управления Службами, чтобы запустить его и убедиться, что он запустится автоматически при следующей загрузке.

Настройка qemu-guest-agent в Linux

В зависимости от дистрибутива гостевой агент может не запускаться автоматически после установки. Для запуска воспользуемся следующими командами:

sudo systemctl enable qemu-guest-agent sudo systemctl start qemu-guest-agent

Проверка того, что связь с гостевым агентом работает

Связь с гостевым агентом происходит через сокет unix, расположенный в /var/run/qemu-server/.qga Вы можете проверить связь агента qm в proxmox:

если qemu-guest-agent правильно запущен в виртуальной машине, он выдаст пустое сообщения.

Если есть вопросы, то пишем в комментариях.

Также можете вступить в Телеграм канал, ВКонтакте или подписаться на Twitter. Ссылки в шапке страницы.
Заранее всем спасибо.

RSS

Если вы нашли ошибку, пожалуйста, выделите фрагмент текста и нажмите Ctrl+Enter.

kvm-logo

Сегодня в статье установим и настроим KVM сервер на операционной системе Ubuntu Server 20.04 LTS. KVM — это программное обеспечения Читать

linux-logo

Сегодня в статье рассмотрим пример устранения ошибки “You need to install openssh-askpass or similar to connect to this host» выдаваемой Читать

kvm-logo

Сегодня поговорим о ошибке при установки виртуальной машины KVM. Ошибка появляется на этапе установке самой операционной системы

kvm-logo

Сегодня рассмотрим пример переноса виртуальной машины с VirtualBox в KVM виртуализацию. Возможно, у вас есть несколько важных гостевых машин на Читать

Источник

Оцените статью
Adblock
detector