package main import ( "fmt" "github.com/ptrcnull/govmtools" ) func main() { sock, err := govmtools.NewSocket() if err != nil { panic(err) } fmt.Printf("connected! %#v\n", sock) err = sock.ReportVersionData() if err != nil { panic(err) } sock.MustSendCommand("vmx.capability.unified_loop toolbox\x00") sock.MustSendCommand("log toolbox: Version: 11.2.5.26209 (build-17337674)\x00") sock.MustSendCommand("tools.capability.statechange ") sock.MustSendCommand("tools.capability.softpowerop_retry ") sock.MustSendCommand("tools.capability.guest_conf_directory /etc/vmware-tools\x00") sock.MustSendCommand("tools.set.versiontype 11333 4\x00") sock.MustSendCommand("info-set guestinfo.ip 10.99.0.6\x00") guestInfoNetwork, err := govmtools.GetGuestInfoNetwork() if err != nil { panic(err) } sock.SetGuestInfo(govmtools.GuestInfoDnsName, "openldap") sock.SetGuestInfo(govmtools.GuestInfoUptime, "26642699") sock.SetGuestInfo(govmtools.GuestInfoIpAddressV3, guestInfoNetwork) sock.SetGuestInfo(govmtools.GuestInfoBuildNumber, "build-" + govmtools.BuildNumber) sock.MustSendCommand("info-set guestinfo.appInfo \x00") select {} }