Skip to content

Workstation Setup

We will be going through creating resources and installing tools on your PC/Mac.

stateDiagram-v2
    direction LR

    state PrepWorkstation {
        [*] --> GenrateRSAKeys
        GenrateRSAKeys --> InstallTofu
        InstallTofu --> InstallVSCode
        InstallVSCode --> [*]
    }

    [*] --> PrepWorkstation 
    PrepWorkstation --> DeployJumpHost : Next section

Note

These are the only binaries that you will need to install on your workstation or any other OS to get the jump host VM running.

  1. Create RSA key pair We will need a RSA key pair to connect to the jumphost
  2. Install Visual Studio Code (VSC)
  3. Install OpenTofu on Linux

Generate a RSA Key Pair

Based on your local workstation OS, follow these instuctions to:

  1. Run the following command to generate an RSA key pair.

    ssh-keygen -t rsa
    
  2. [Optional] Modify or Accept the default file location as ~/.ssh/id_rsa

  3. If the default file location was accepted, the keys will be in the following location:

    ~/.ssh/id_rsa.pub 
    ~/.ssh/id_rsa
    

On Windows machine, See Generate a RSA key pair on Windows example.

Install OpenTofu

OpenTofu is a fork of Terraform that is open-source, community-driven, and managed by the Linux Foundation and is used to simplify provisioning resources using the Nutanix Terraform Provider while following Infrastructure as Code (IaC) practices.

To Install OpenTofu, follow the steps below for your respective local workstation:

Download the installer script:
curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
Give it execution permissions:
chmod +x install-opentofu.sh
Run the installer:
./install-opentofu.sh --install-method standalone
Remove the installer:
rm -f install-opentofu.sh

Download the installer script:
Invoke-WebRequest -outfile "install-opentofu.ps1" -uri "https://get.opentofu.org/install-opentofu.ps1"
Run the installer
& .\install-opentofu.ps1 -installMethod standalone
Remove the installer
Remove-Item install-opentofu.ps1

Install Visual Studio Code (VSCode)

We will be doing all the labs by connecting to your jump host using VSCode remote shell environment. This allows for easy browsing and editing of configuration files. For additional details, see Visual Studio Code

Having a rich text editor capable of integrating with the rest of our tools, and providing markup to the different source code file types will provide significant value in upcoming exercises and is a much simpler experience for most users compared to command line text editors.

If you don't already have VSCode installed on your local, you can either Download and Install VSCode or choose to follow one of the steps belows:

brew install --cask visual-studio-code # (1)
  1. If you do not have brew macOS package manager installed, use the following command to install it in Terminal. For additional details, see HomeBrew Installation Docs.

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
choco install vscode # (1)
  1. If you do not have choco Windows package manager installed, use the following command to install it in PowerShell. For additional details, see Chocolatey Installation Docs.

    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
    

The steps above leverage HomeBrew Package Manager for macOS and Chocolatey Package Manager for Windows respectively to install VSCode, click on links to see additional details.

We will proceed to deploying jumphost VM.