Avahi Extension for VMware Server
Avahi is an implementation of mDNS/DNS-SD. It provides automatic service discovery in LAN. With the official distribution of Debian/Ubuntu, sample server side service registration file of SSH was included. The file is very simple, and a registration file of VMware Server can be generated based on it:
VMware Server on %h
_vmware._tcp
902
Saving the above file as /etc/avahi/services/vmware.service and restart avahi daemon:
sudo /etc/init.d/avahi-daemon restart
Then, the service can be detected by the client(service-discover):
But, it's not supported by service-discovery-applet yet. Two more changes are required for service-discovery-applet yet:
* To add a service definition in /usr/lib/avahi/service-types.db. Actually, it's generated by source package of avahi with a source file like /usr/share/avahi/service-types. Just add one more line to the source file:
_vmware._tcp:VMware Console Access* To add a handler plugin in folder /usr/share/service-discovery-applet/plugins like this:
# -*- coding: UTF-8 -*-
# -*- python -*-
# Copyright (C) 2006 by Yale Huang
#
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free Software Foundation.
# This file is distributed without any warranty; without even the implied
# warranty of merchantability or fitness for a particular purpose.
# See "COPYING" in the source distribution for more information.
#
# $Id: vmware.py.in 115 2006-08-06 23:52:31Z yale $
#
from sdapplet.pluginutils import *
import subprocess
class plugin_vmware:
def __init__(self):
self.service_type = ["_vmware._tcp"]
self.author = "Yale Huang"
self.description = "Start VMware Server console"
def connect(self, use_host_names, name, stype, hostname, address, port, txts):
# if use_host_names == True:
# address = hostname
print "connecting using vmware"
cmdline = ["/usr/share/service-discovery-applet/tools//exec_wrapper", "vmware"]
cmdline += ["-h", "%s" % (address), "-P", "%s" % (port)]
print cmdline
pid = subprocess.Popen(cmdline).pid
def load():
return plugin_vmware()
Then, reload service-discovery-applet, enable service type _vmware._tcp in Preferences, remote VMware Server can be detected:
Select the VMware Server service from the m enu, your VMware Server console will be started.
Labels: Virtualization


