NetBSD Problem Report #51476

From  Wed Sep 14 11:22:53 2016
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer "Postmaster" (verified OK))
	by (Postfix) with ESMTPS id 304157A111
	for <>; Wed, 14 Sep 2016 11:22:53 +0000 (UTC)
Message-Id: <>
Date: Wed, 14 Sep 2016 11:22:52 +0000 (UTC)
Subject: vmt can't send long hostnames to VMware host
X-Send-Pr-Version: www-1.0

>Number:         51476
>Category:       port-i386
>Synopsis:       vmt can't send long hostnames to VMware host
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 14 11:25:00 +0000 2016
>Originator:     Francis Rounds
>Release:        -current 7.99.37 201609140250Z
Bridgeworks Ltd
NetBSD aaaaaaa.aaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaa.aaaaaaaab.domain.local 7.99.37 NetBSD 7.99.37 (GENERIC.201609140250Z) amd64
When a long hostname is set (240 characters or longer), the vmt driver is unable to send the hostname to the VMware/ESXi host.

dmesg shows the following errors:

vmt0: rpci command didn't fit in buffer
vmt0: unable to set hostname
Set a hostname of 240 characters or longer, either using /etc/rc.conf and rebooting or using the hostname(1) command and waiting until the vmt0 errors appear on the console. In either case, dmesg should show the error.

That is, either set the following in /etc/rc.conf:


or run:

hostname aaaaaaa.aaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaa.aaaaaaaab.domain.local
In src/sys/arch/x86/x86/vmt.c, VMT_RPC_BUFLEN (the maximum size of the buffer used to communicate over the RPCI channel) is set to 256, which is also the value of MAXHOSTNAMELEN, the maximum length of a fully-qualified domain name.

Since the command to be sent is "SetGuestInfo  1 hostname" (where "hostname" is obviously the hostname to send to the host) and the "SetGuestInfo  1" prefix is 16 bytes long, adding at least 16 bytes to VMT_RPC_BUFLEN fixes the issue.

This was apparently also an issue in the original vmt from OpenBSD, but the buffer length was recently increased and so it's no longer an issue there:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.