PfSense VM on ProxMox : Qemu-agent installation
-
@weehooey I have a VPS with runs on KVM. Will I profit from using this even if it is not Proxmox? Any hint what it actually is, it doesn't say, other than being KVM.
-
Hey @Bob-Dig I think it should. Of course, you will want to test to confirm.
Proxmox is KVM/QEMU under the hood. We have used this successfully with OpenStack (in OVHcloud), which is also KVM.
Although, if you have a VPS that is hosted by a third party, there may be things which prevent it from working correctly.
The QEMU guest agent gives insight into the VM and provides some communication. In Proxmox, with the guest agent, you get an accurate reading of the RAM the VM is actually using and the VM responds to the power off/reboot commands.
I would not want to run a VM without a guest agent for the platform it is running on.
-
@weehooey If I connect via VNC to it, it says QEMU, so I think I am good. But can't see any differences in their web-GUI nor in pfSense after installing.
-
@shadeless said in PfSense VM on ProxMox : Qemu-agent installation:
does this work on 2.7.0?
It works the same on pfsense v2.6 and v2.7
You have to do all of- Create file /etc/rc.conf.local with above contents
- Create file /usr/local/etc/rc.d/qemu-agent.sh with above contents and change it's properties to enable execute permission
- Install the package qemu-guest-agent in the VM
- Enable Qemu agent in Proxmox, stop the VM then restart it.
-
@Patch you do not need to stop and restart the VM.
Check out the script for the commands: https://github.com/Weehooey/pfSense-scripts
-
Neat, this works for 23.05.1 too.
Thanks -
I am now a proxmox user too and your script is awesome, thanks.
-
Or do it manually.
Takes about 2 minutes using (paste from a cheat sheet works)- Diagnostics -> Edit file
- Diagnostics -> Command prompt -> Execute Shell Command
-
@Patch said in PfSense VM on ProxMox : Qemu-agent installation:
Or do it manually
Never failed and my preferred method, thanks Patch...
-
i was not able to use your script because the agent gives me a error.
service qemu-guest-agent start Cannot 'start' qemu_guest_agent. Set qemu_guest_agent_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.
but as soon as i added it in the /etc/rc.conf i was able to start the agent. Has something changed with 2.7.1? (first time using proxmox and QEMU)
-
@thewho I installed on 2.7 and upgraded to 2.7.1 and mine appears to remain functional. service qemu-guest-agent start tells me qemu_guest_agent already running? and provides the pid for it. That said .. something is wrong as my memory consumed in the proxmox host has doubled after the move 2.7>2.7.1 (3.2G>7.1G)
-
Does this still work under 2.8.1?
qemu-guest-agent is installed and runs when I start it as a service.
I also added the following to /etc/rc.conf.local:
qemu_guest_agent_enable="YES"
but it won't start after reboot?
-
@lifeofguenter said in PfSense VM on ProxMox : Qemu-agent installation:
but it won't start after reboot?
pfSense does not use the standard FreeBSD RC system.
I did install the 'Shellcmd' package and created an entry of type 'shellcmd' with command
service qemu-guest-agent start
that is executed at the start. Although that is on pfSense+ I'm sure it will work as well on pfSense CE. -
@lifeofguenter yes, tested and working on
2.8.1
Did you use the code from our repo?
github.com - Weehooey - pfSense Scripts
It has code that works functionally the same as what @patient0 mentions.
-
@weehooey your script does not work.
When I install qemu-guest-agent it already installs a start script:
Shell Output - cat /usr/local/etc/rc.d/qemu-guest-agent #!/bin/sh # # PROVIDE: qemu_guest_agent # REQUIRE: DAEMON # KEYWORD: nojail # # # Add the following lines to /etc/rc.conf to enable qemu-guest-agent: # #qemu_guest_agent_enable="YES" # # For detailed logging add flags -v and -l to /etc/rc.conf # #qemu_guest_agent_flags="-d -v -l /var/log/qemu-ga.log" . /etc/rc.subr name=qemu_guest_agent rcvar=qemu_guest_agent_enable load_rc_config $name qemu_guest_agent_flags=${qemu_guest_agent_flags-"-d"} qemu_guest_agent_enable=${qemu_guest_agent_enable:-"NO"} qemu_guest_agent_bin=/usr/local/bin/qemu-ga command=${qemu_guest_agent_bin} pidfile="/var/run/qemu-ga.pid" run_rc_command "$1"
but it never executes.
-
@lifeofguenter are those
#
part of the contents of the file? If so, everything in the file is commented out except the shebang line. -
@weehooey it’s cropped , you need to scroll inside the text field
-
@lifeofguenter said in PfSense VM on ProxMox : Qemu-agent installation:
but it won't start after reboot?
Hmm, we have a CE 2.7.2 VM that was rebooted recently and it's running. Are we saying it doesn't in 2.8.x?
/etc/rc.conf.local:
qemu_guest_agent_enable="YES"
#qemu_guest_agent_flags="-d -v -l /var/log/qemu-ga.log"
qemu_guest_agent_flags="-d -l /var/log/qemu-ga.log"and:
service qemu-guest-agent status:
qemu_guest_agent is running as pid 87501. -
@SteveITS at least that is my observation.
Manually starting the service works, but it’s not being picked up my rc.conf.local or any similar option.
-
@lifeofguenter Ah. I see that now. I did not realized the windows scrolled.
@weehooey your script does not work.
When I install qemu-guest-agent it already installs a start script:What you are showing is not what our script does.
I can tell you that we tested using the script we provided, and it works on
2.8.1
.Perhaps you have not marked your script as executable?