pfSense QEMU Guest Agent

By

pfSense Proxmox qemu agent

Virtualization has become a key component of modern IT infrastructure. Proxmox and pfSense are two popular open-source solutions for virtualization and network management. While both are great standalone tools, combining them can lead to even greater benefits.

One way to integrate these tools is through the QEMU Guest Agent, a tool that allows for bi-directional communication between the host and guest operating systems. This blog post will explore the benefits of using the QEMU Guest Agent for pfSense and Proxmox, and how to get the QEMU Guest Agent running for pfSense.

What is QEMU Guest Agent?

QEMU Guest Agent is a tool that allows the host operating system (such as Proxmox) to communicate with the guest operating system in a virtual machine (such as pfSense). The agent runs inside the guest operating system and provides a channel for the host operating system to send commands and receive information about the guest system.

The QEMU Guest Agent can be used to perform various tasks, such as shutting down or rebooting the guest, and retrieving information about the guest’s network configuration.

Benefits of using QEMU Guest Agent for pfSense and Proxmox

Integrating the QEMU Guest Agent with pfSense and Proxmox can offer several benefits:

1. Seamless integration between host and guest systems

The QEMU Guest Agent allows for seamless integration between the host and guest systems. By using the agent, the host operating system can retrieve information about the guest system and perform tasks such as shutting down or rebooting the guest system without having to log in to the guest system.

2. Improved network configuration management

With the QEMU Guest Agent, the host operating system can retrieve information about the guest’s network configuration, such as the IP address and gateway of the VM. This allows for improved network configuration management, as the host can make changes to the network settings without having to log in to the guest system.

How to set up QEMU Guest Agent for pfSense and Proxmox

To set up QEMU Guest Agent for pfSense and Proxmox, follow these steps:

Install and configure QEMU Guest Agent on pfSense

For pfSense, the QEMU Guest Agent can be installed from the pfSense package manager.

pkg install -y qemu-guest-agent

Run the below code to add the configuration for the guest agent to /etc/rc.conf.local :

cat >> /etc/rc.conf.local << EOF
qemu_guest_agent_enable="YES"
qemu_guest_agent_flags="-d -v -l /var/log/qemu-ga.log"
#virtio_console_load="YES"
EOF

Create /usr/local/etc/rc.d/qemu-agent.sh to automatically start the guest agent when booting up:

cat > /usr/local/etc/rc.d/qemu-agent.sh << EOF
!/bin/sh
sleep 3
service qemu-guest-agent start
EOF

Make /usr/local/etc/rc.d/qemu-agent.sh executable:

chmod +x /usr/local/etc/rc.d/qemu-agent.sh

Then start the service for the QEMU agent:

service qemu-guest-agent start

In the pfSense web configurator, go to System: Settings / Advanced: Tunables -> Add

Tunable: virtio_console_load, Value: YES

Back at the command prompt, confirm the QEMU Guest Agent service is running:

service qemu-guest-agent status

Enable the QEMU Guest Agent in the Proxmox VM for pfSense

Enable the QEMU Guest Agent in the settings of the Proxmox VM for pfSense by navigating to System > Advanced > Miscellaneous and checking the box “Enable QEMU Guest Agent”.

Restart the pfSense VM.

Confirm that the QEMU guest agent is working in pfSense by checking to see if the VM’s IP address is shown in the Proxmox console by navigating to the Summary page of the VM.

You can also test the QEMU Guest Agent by running the following command on the host operating system (pve of Proxmox):

qm agent <vmid> ping

Replace <vmid> with the ID of the VM for pfSense. If the QEMU Guest Agent is installed and enabled correctly, the command should return a response.

Conclusion

The QEMU Guest Agent is a powerful tool for managing virtual machines, and integrating it with pfSense and Proxmox can offer several benefits. By allowing for seamless integration between the host and guest systems, and improved network configuration management, the QEMU Guest Agent can help you manage your IT infrastructure easier.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.