vmTools for FreeBSD and its derivatives (mainly OPNsense)

Davide Mauri Lv1Posted Apr-18-2025 16:34

Hello everyone, I searched for "freebsd" and "opnsense" in these forums, but nothing came up regarding this question. So here I am.

I'm looking for a way to have vmTools running inside FreeBSD guests and its derivatives, mainly OPNsense which my company uses at customers' sites to provide OpenVPN connections with 2FA.
At the moment I have started poking around the setup on a test VM, but I'm in a very very early state of testing, to be generous.
I can point out three things, at the moment:
- FreeBSD does not come with bash, at the moment, so the install script should no be bash-specific, if possible, or it should be pointed out that bash is a requirement
- the `uname -a` command outputs amd64 as system  architecture, which is not expected by the script, even if it's equivalent to linux's "x86_64"
- optical drives, on a fresh FreeBSD 14.2 UEFI install, are named /dev/cdX and the filesystem type is cd9660 instead of iso9660.
I'm willing to contribute to the cause, so to say, with tests and logs, as working needs allow.

Has anyone poked around the tools install script more than this?

Thanks and best regards.

Davide

AimanHakim has solved this question and earned 10 coins.

Posting a reply earns you 2 coins. An accepted reply earns you 20 coins and another 10 coins for replying within 10 minutes. (Expired) What is Coin?

Enter your mobile phone number and company name for better service. Go

Hi there, unfortunately VMtool is not supported installing in FreeBSD. I've tried patching it up for a test lab using TrueNAS core as NFS storage. You can refer to Sangfor Professional training slide or the manual. The slide is about explaining the principle of VMtools. You can get it in the KB

Is this answer helpful?
Newbie614090 Lv1Posted Jul-04-2025 03:13
  
Hi Dear,

I would like to know how is the support to vmTools for FreeBSD?
We have planning migrate some OPNSense/PFSense and im checking that there is no support for vmTools for this.

Best regards
Davide Mauri Lv1Posted Apr-22-2025 16:34
  
Hello everyone and thanks for the feedback provided so far.

I'm not a developer, so I doubt I'd be able to contribute to the development of vmware- or open-vm-tools packages, but I can try to play around the existing packages. Also the quemu-guest-agent is a nice suggestion, I didn't think about that.
I'll try and do a bit more of testing during these days and let you know. I would say that including FreeBSD amd64 in the arch check block, and moving from Bash to Shell should be probably easy.

Best regards to everyone.
Newbie017872 Lv1Posted Apr-21-2025 11:12
  
Thanks for sharing
Saddam Hussain Lv1Posted Apr-19-2025 16:28
  
Hello



Hello everyone, I searched for "freebsd" and "opnsense" in these forums, but nothing came up regarding this question. So here I am.

I'm looking for a way to have vmTools running inside FreeBSD guests and its derivatives, mainly OPNsense which my company uses at customers' sites to provide OpenVPN connections with 2FA.
At the moment I have started poking around the setup on a test VM, but I'm in a very very early state of testing, to be generous.
I can point out three things, at the moment:
- FreeBSD does not come with bash, at the moment, so the install script should no be bash-specific, if possible, or it should be pointed out that bash is a requirement
- the uname -a command outputs amd64 as system  architecture, which is not expected by the script, even if it's equivalent to linux's "x86_64"
- optical drives, on a fresh FreeBSD 14.2 UEFI install, are named /dev/cdX and the filesystem type is cd9660 instead of iso9660.
I'm willing to contribute to the cause, so to say, with tests and logs, as working needs allow.

Has anyone poked around the tools install script more than this?
ChatGPT said:
Great question—FreeBSD support for VMware tools has historically lagged a bit behind Linux, and OPNsense adds even more nuance since it's a FreeBSD derivative with its own set of packages and constraints.

Here's a bit of background and some suggestions to help you move forward with VMware Tools or open-vm-tools on FreeBSD/OPNsense:

1. VMware Tools vs open-vm-tools
FreeBSD and its derivatives (like OPNsense) generally use open-vm-tools, the open-source implementation of VMware Tools, and it's often the preferred option.

2. Installing open-vm-tools on FreeBSD 14.2
You can install it using pkg:

pkg install open-vm-tools
Then enable it in /etc/rc.conf:

vmware_guest_vmblock_enable="YES"
vmware_guest_vmhgfs_enable="YES"
vmware_guest_vmmemctl_enable="YES"
vmware_guest_vmxnet_enable="YES"
vmware_guestd_enable="YES"
Make sure the kernel modules are loaded too. You might need to load vmware.ko if it exists for your kernel version.

Note: Some modules like vmhgfs are not always useful or supported depending on your guest configuration.

3. On OPNsense
OPNsense doesn’t include a package manager by default (at least not one that’s exposed like in FreeBSD), but you can manually enable the FreeBSD package repository.

Here's a rough way to test it (NOT recommended in production without backups):
# Enable FreeBSD repos
mount -uw /
echo 'FreeBSD: { enabled: yes }' > /usr/local/etc/pkg/repos/FreeBSD.conf
pkg update
pkg install open-vm-tools
Then add similar rc.conf entries.

Warning: OPNsense expects its environment to be controlled—adding third-party packages can break upgrades or destabilize the system.

4. Regarding Your Script Observations
Bash: You're spot on—FreeBSD uses /bin/sh (POSIX shell), not bash, and bash isn't installed by default. Any install script should either be pure POSIX shell or explicitly depend on bash.

Architecture string: FreeBSD reports amd64 vs Linux’s x86_64, which can break scripts. A workaround would be using uname -m and a mapping logic.

Mounting optical drive: Yes, FreeBSD uses cd9660 as the filesystem. Mount like this:

mount -t cd9660 /dev/cd0 /mnt
5. Helpful Hint for Development
If you want to contribute or work on a custom installer script:

Test in vanilla FreeBSD before moving to OPNsense

Write everything in /bin/sh compatibility

Use uname -s, uname -r, uname -m for portable system checks

Consider making a small port overlay or package for OPNsense

6. Alternative: Use QEMU/KVM if You're Flexible
If VMware is too fiddly, and you can control the environment, some find it easier to run OPNsense under KVM with virtio drivers and qemu-guest-agent.

Newbie740733 Lv1Posted Apr-19-2025 15:52
  
Hello dear VMware Tools on FreeBSD and OPNsense

It's great that you're exploring VMware Tools compatibility with FreeBSD and OPNsense. You're right that there are several challenges to address. Here's what I can share:

Current State of VMware Tools on FreeBSD

1. **Official Support**: VMware officially provides VMware Tools for FreeBSD, but it's not as well-maintained as the Linux/Windows versions. The latest supported version is for FreeBSD 12.

2. **OPNsense Considerations**: Since OPNsense is FreeBSD-based but often runs custom kernels, you might need to adapt the tools specifically for it.

Key Issues You've Identified

1. Bash Dependency
- FreeBSD uses `/bin/sh` (a more basic shell) by default
- Solutions:
  - Install bash via `pkg install bash`
  - Modify the install script to use POSIX-compliant shell syntax
  - Create a FreeBSD-specific installer

2. Architecture Detection (`uname -a` output)
- FreeBSD reports `amd64` instead of `x86_64`
- The script should handle both variants or translate them

3. CD-ROM Device Naming
- `/dev/cdX` instead of typical Linux device names
- Filesystem type `cd9660` (this is actually correct - it's FreeBSD's name for ISO9660)

Potential Approaches

1. **Official VMware Tools**:
   - Try the official FreeBSD VMware Tools package
   - May need to modify the installer script for newer FreeBSD versions

2. **Open-VM-Tools**:
   - The open-source alternative often has better BSD support
   - Available in FreeBSD ports: `pkg install open-vm-tools`

3. **Manual Installation**:
   - Extract the tools manually and adapt the init scripts

Contribution Path

If you'd like to contribute back:
1. Document your installation process
2. Create patches for the installer script to handle FreeBSD cases
3. Consider submitting changes to VMware or the open-vm-tools project

Would you like me to provide more specific details about any of these approaches? I can help with more technical details about modifying the installer scripts or alternative installation methods.

I Can Help:

Change

Board Leaders

NyxZale...

Weekly Sharers

Newbie5...

Weekly Questioners