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"
LVL 1
NAMEWITHELD12Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NAMEWITHELD12Author Commented:
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""
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
NAMEWITHELD12Author Commented:
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
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
you have to put in the variable to the $URL_TO_BINARY
NAMEWITHELD12Author Commented:
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 !!!!!!!
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
govc is not being found, in the path, oh

when you resolv the govc issue.....

try this command


$ docker-machine create -d  vmwarevsphere --vmwarevsphere-vcenter="IP Address" --vmwarevsphere-username="administrator password" --vmwarevsphere-password="password"  --vmwarevsphere-network="VM Network" --vmwarevsphere-datastore="datastore"   --vmwarevsphere-datacenter="datacenter" vmdocker-name

after that you'll likely get....

Error creating machine: Unable to upload on datastore "Datacenter Name" due to Error: 500 Internal Server Error

due to bugs....!!!!!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NAMEWITHELD12Author Commented:
still working on this , weill have an update soon!
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
no probs.
NAMEWITHELD12Author Commented:
i know it has been a while but I have been pulled away on other projects


I will have an update soon!!!!
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Same here.....no problems!
NAMEWITHELD12Author Commented:
I did not get this to work totally , but I really appicate the help
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.