Showing posts from November, 2022

Connect-NsxtServer shows "Unable to connect to the remote server"

When you run Connect-NsxtServer in the PowerCLI, it may show "Unable to connect to the remote server".  Because the error message is a little bit confusing with other login issues. It's not easy to troubleshoot. The actual reason is the NSX-T uses a self-signed certificate, and the PowerCLI cannot accept the certificate automatically. The fix is super easy. You need to set the PowerCLI to ignore the invalid certificate with the following command: Set-PowerCLIConfiguration -Scope User -InvalidCertificateAction:Ignore -Confirm:$false

Move Terraform Providers to Other Folders

Create a new control file with the name .terraformrc or terraform.rc in your profile folder. Add the following line: plugin_cache_dir = "$HOME/.terraform.d/plugin-cache" Create the folder .terraform.d/plugin-cache in your profile folder. The providers will be downloaded to the cache folder when you run terraform init . If you don't want to create the control file in the profile folder. The alternative is to create an environment variable. export TF_PLUGIN_CACHE_DIR="$HOME/.terraform.d/plugin-cache"

How to Use Proxy on WSL 2

1. Install cntlm.sudo   apt-get install cntlm 2. Configure the permission for cntlm.conf file. sudo chmod 644 /etc/cntlm.conf 3. Configure proxy settings.  sudo vi /etc/cntlm.conf 4. Make sure the following parameters are configured. Domain XXX Username XXX Proxy NoProxy localhost, 127.0.0., 10. Listen 3128 5. Test connectivity. (Hit enter key if it asks a password) cntlm -M 6. Generate hashed passwords. cntlm -H 7. Paste the generated passwords to the cntlm configuration file. 8. Configure proxy. export http_proxy=http://localhost:3128/ export https_proxy=http://localhost:3128 9. Start cntlm sudo cntlm -v -c /etc/cntlm.conf