Link to home
Start Free TrialLog in
Avatar of NAMEWITHELD12
NAMEWITHELD12Flag for United States of America

asked on

how to you install "govc" on ubuntu server

where and how can I install "govc"?


this is in response to my other question an error I am getting using docker machine

"Error creating machine: exec: "govc": executable file not found in $PATH"
Avatar of NAMEWITHELD12
NAMEWITHELD12
Flag of United States of America image

ASKER

http://www.virtuallyghetto.com/2014/09/govmomi-vsphere-sdk-for-go-govc-cli-kubernetes-on-vsphere-part-1.html

I am following this link but I when i run

"go get github.com/vmware/govmomi/govc"

I get

"package encoding: unrecognized import path "encoding""
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
This is because, building govc from the source, has broken, download the binary!

curl $URL_TO_BINARY | gzip -d > /usr/local/bin/govc
chmod +x /usr/local/bin/govc

see here

https://github.com/vmware/govmomi/tree/master/govc

(PS, it really is a nightmare all this, not well documented or corrected!)

for completeness, the error can be...

Step 16 : RUN go get github.com/vmware/govmomi/govc
 ---> Running in 8f766e8b9953
# github.com/vmware/govmomi/vim25/soap
src/go/src/github.com/vmware/govmomi/vim25/soap/client.go:68: unknown net.Dialer
 field 'KeepAlive' in struct literal
src/go/src/github.com/vmware/govmomi/vim25/soap/client.go:74: c.t.TLSHandshakeTi
meout undefined (type *http.Transport has no field or method TLSHandshakeTimeout
)
The command '/bin/sh -c go get github.com/vmware/govmomi/govc' returned a non-ze
ro code: 2
I run curl $URL_TO_BINARY | gzip -d > /usr/local/bin/govc

and I get


-bash: /usr/local/bin/govc: Permission denied

also I cannot create govc

cannot modify the permissions on /usr/local/bin/

can i expand to another folder ???

thanks
you have to put in the variable to the $URL_TO_BINARY
ok  now I have downloaded and unzipped govc into /usr/local/bin/govc

i am thinking that it is the right thing as If i type "govc" i get  

Usage of govc:
  about
  datacenter.create
  datacenter.destroy
  datastore.cp
  datastore.download
  datastore.ls
  datastore.mkdir
  datastore.mv
  datastore.rm
  datastore.upload
  device.boot
  device.cdrom.

and it seems to be in the PATH

usr/local/bin/govc$ echo $PATH
/usr/local/bin/govc:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games



BUT when I run the command



sudo docker-machine create -d vmwarevsphere --vmwarevsphere-vcenter="VCTR01.int.vxxxxi.com" --vmwarevsphere-username="administrator" --vmwarevsphere-password="Cxxxxxx71" --vmwarevsphere-datacenter="Txxxxi" --vmwarevsphere-compute-ip="test" --vmwarevsphere-datastore="Txxxxi Datastore01" --vmwarevsphere-network="VM Network"  testmachine278

I get this

Generating SSH Keypair...
INFO[0000] Uploading Boot2docker ISO ...
INFO[0000] Creating directory boot2docker-iso on datastore Tufani Datastore01 of vCenter VCTR01.int.vizuri.com...
ERRO[0000] Error creating machine: exec: "govc": executable file not found in $PATH
WARN[0000] You will want to check the provider to make sure the machine and associated resources were properly removed.
FATA[0000] Error creating machine


thanks !!!!!!!
ASKER CERTIFIED SOLUTION
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
still working on this , weill have an update soon!
i know it has been a while but I have been pulled away on other projects


I will have an update soon!!!!
I did not get this to work totally , but I really appicate the help