Oracle Blog

Lubos's Weblog

ssh login lag with VMs in VMware Server 2 (DNS problem?)

I usually run my lab and dev OpenSolaris, Solaris, Debian, RHEL ... machines inside vmware(a server solution, mainly because I run it on my work server on stable debian for production reasons). For a long time I was a happy user of VMware Server 1.x , then I decided to move to version 2.0

Guess what ... every change brings consequences ...

After migration of VMs, upgrading to latest VM HW version I booted my debian and opensolaris dev boxes & wanted to login.
All my machines networking is setup by NAT & DHCP from VMware.
Hmm ... at that time I felt victim of very interesting problem. The login took ages (cca 5mins in comparison to 2s in previous version).

SSH does a reverse resolving of hostname when you try to connect to the target & this did a call to naming services.
This took so long I even got a fatal error complaining about ssh monitor not responding in OpenSolaris.
The same behaviour happened in Debian, so this pointed out a problem with VMware.

After doing some "snoop" and "truss -Df sshd -ddd -p 222" I figured out that the DNS packets are taking a long time and all those packets ask for a "localdomain" host.
localdomain ? WTF ?

Then the root causing and fixing was rather fast & the solution was in the file /etc/vmware/vmnet8/dhcpd/dhcpd.conf .
This file provided two options regarding naming: option domain-name-servers 192.168.1.2;
option domain-name "localdomain";

Simply commenting out second option (so option domain-name) got me rid of the ridiculous resolving problem.
Funny thing is that I always thought "localdomain" is ignored by dns client, but as usual assumptions are evil

I don't think something like that would happened to me if I used virtualbox, but who knows, thanks god we have snoop and truss