Thursday, October 27, 2022

Re: VMware Tools driver to advertise OS as 'FreeBSD 64-bit' OS, not 32-bit version

Index: sys/dev/pv/vmt.c
===================================================================
RCS file: /cvs/src/sys/dev/pv/vmt.c,v
retrieving revision 1.26
diff -u -p -p -r1.26 vmt.c
--- sys/dev/pv/vmt.c 8 Sep 2022 10:22:06 -0000 1.26
+++ sys/dev/pv/vmt.c 27 Oct 2022 21:55:40 -0000
@@ -633,7 +633,11 @@ vmt_update_guest_info(struct vmt_softc *
*/

if (vm_rpc_send_rpci_tx(sc, "SetGuestInfo %d %s",
+#ifdef __amd64__
+ VM_GUEST_INFO_OS_NAME, "FreeBSD-64") != 0) {
+#else
VM_GUEST_INFO_OS_NAME, "FreeBSD") != 0) {
+#endif
DPRINTF("%s: unable to set guest OS", DEVNAME(sc));
sc->sc_rpc_error = 1;
}
On 10/27/22 20:02, Mike Larkin wrote:
> On Wed, Oct 26, 2022 at 07:39:03PM +0200, Kalabic S. wrote:
>> Hello @misc,
>>
>> I do not see a reason not to update OS version that vmt (kernel level
>> implementation of VMware Tools) is advertising to VMware hypervisor from 32
>> bit FreeBSD to 64 bit version.
>>
>> If for nothing else, there's clock running forward issue that appeared in
>> 7.2 release and that is solved simply by manually specifying "FreeBSD
>> 64-bit" instead of "FreeBSD 32-bit" for "Guest OS Version".
>> - https://marc.info/?t=166674083700007&r=1&w=2
>> - https://marc.info/?t=166630469300002&r=1&w=2
>>
>> Attached is a simple patch that I tested and that changes string "FreeBSD"
>> to "FreeBSD-64" in a call to "SetGuestInfo" function on hypervisor and that
>> accomplishes the task.
>>
>> What could be a drawback? Is author David Gwynne still active and can he
>> give some feedback?
>
> What versions of ESXi did you test this with?
>
> Did you test both i386 OpenBSD VMs and amd64 ones on each version?
>
> -ml

Mike, good point, I forgot about i386 and so I actually did install a
new OpenBSD i386 Guest on ESXi 6.5.
Also have adjusted a patch for vmt to send 32-bit OS identifier for i386
and 64-bit identifier for amd64, it is attached here.
Tested on both guest on same hypervisor, ESXi 6.5.

No comments:

Post a Comment