VMware Cloud Community
SM_WAHED
Contributor
Contributor
Jump to solution

[Connect-VIServer], ViError

Hello

I am using powercli on linux

I need to connect to a virtualcenter through a http proxy

when I try to connect I am the following error :

CategoryInfo      : NotSpecified: (:) [Connect-VIServer], ViError

+ FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_Exception,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer

I try webrequest and powershell correctly retrieve the vsphere web ui

Did anyone have successfully using viconnect trough a http proxy?

Thanks a lot

0 Kudos
1 Solution

Accepted Solutions
SM_WAHED
Contributor
Contributor
Jump to solution

Hello,

After several tests, it appears that it was the proxy who was in fault

my original settings :

My Linux workstation is behind a rebond/firewall and have to open a Socks5 proxy using SSH to connect to rebond server and I have to run my powercli script on my workstaton.

As powershell doesn't supports socks5 proxy (except if I am wrong), I've setup a polipo on my workstation to convert socks5 to http proxy, polipo send the traffic but nothing get back.

After few test, I have replace polipo with proxychains to do the same things and every works fine!

So If you need to pass trough a SSH jumphost to connect get access to your virtual center using a linux workstation :

open a ssh connection to the jumphost using ssh -D 12345 jumphost

Configure proxychains to convert socks5 to http prox

launch powershell using proxychains : proxychains pwsh

and everything works fine!

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Can you share the instructions you are using for the connection, and how you specify the Proxy?

Or is that the system proxy defined on your station?

Can you do a Get-PowerCLIConfiguration, and check what it says for ProxyPolicy?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
SM_WAHED
Contributor
Contributor
Jump to solution

Hello,

After several tests, it appears that it was the proxy who was in fault

my original settings :

My Linux workstation is behind a rebond/firewall and have to open a Socks5 proxy using SSH to connect to rebond server and I have to run my powercli script on my workstaton.

As powershell doesn't supports socks5 proxy (except if I am wrong), I've setup a polipo on my workstation to convert socks5 to http proxy, polipo send the traffic but nothing get back.

After few test, I have replace polipo with proxychains to do the same things and every works fine!

So If you need to pass trough a SSH jumphost to connect get access to your virtual center using a linux workstation :

open a ssh connection to the jumphost using ssh -D 12345 jumphost

Configure proxychains to convert socks5 to http prox

launch powershell using proxychains : proxychains pwsh

and everything works fine!

0 Kudos