The DHCP server in VMware Workstation is on by default for host-only networking. This can be very annoying for those who run hosts that already have DHCP servers, or use host-only and masquerade packets out to the LAN. This simple patch completely disables the VMware DHCP server if the USE flag no-dhcp is set. The way I have integrated it with the ebuild may be wrong, my apologies if so. Attached will be the new ebuild (2 lines different from the current one) and the patch (one change plus comments). It works by changing the line in net-services.sh, the script that starts/stops VMware services. I thought this would be possible by editing a script in /etc, but that does not appear to be the case.
Created attachment 86067 [details, diff] Patch to net-services.sh to disable DHCP server
Created attachment 86068 [details] Modified ebuild that will apply the patch if USE flag "no-dhcp" is set
Well, if anything, this should be configurable by some setting in /etc/vmware and the script should just parse the value set in there, instead of hardcoding this via a use flag.
Indeed, that would be an excellent longer term change and I hadn't thought of it. I might look into it if I get a spare minute. That would require quite a change from the existing VMware scripts though which would be more liable to break on updates. However, in the meantime, people can at least disable it easily using the diff. Thanks for your suggestion.
David, can I ask why you've chosen to do masquerading, rather than using the built in vmware NAT connection, or the built in bridging connection? The host-only connection really is designed to provide host-only networking, and there are other systems in place for further connectivity... However, if there is some extremely rare case where running any DHCP server on vmware isn't wanted, then you can try the following (note: it will deactivate ALL DHCPs, not just those for a particular device). In /etc/vmware/config, change the location pointed to by dhcpd.fullpath (I've only got the server available at the moment, but the config location I believe is very similar). As Jakub pointed out, disabling it via a patch during installation is not a good way to fix the problem. It should be a configuration change that can be made at any time. Also the lack of a way to do this in vmware suggests that no one else has suffered the problem, or those that have found a satisfactory workaround... If you could provide a few more details concerning your setup and the need to use the host-only network connection, we might be able to find you an alternative solution too. 5:)
While this patch looks good enough, I'm not going to include it. This sort of thing should be taken up with VMware themselves. We do not want to diverge from upstream so much as to have to maintain this ourselves. Currently, the Gentoo VMware Team is *tiny* and we simply don't have the manpower to keep up with the actual bugs, let alone maintain new features that differ from upstream. I apologise, but I cannot possibly accept this change into our tree.