Connect to a Machine


How to download and see general CLI docs #

Download Instructions #

Download the public binary

curl -o dz

Running this command in the terminal at the desired location will download the dz binary

Doc Image

Set the execute permission on the file

chmod +x dz

Running +x adds the execute permission to the file in the path

Move the executable to the bin folder under your usr folder

[sudo] mv dz /usr/local/bin/

If you don’t already have a bin folder, you might receive an error No such file or directory. If so, Use the shortcut Shift + ⌘ + C and go to /usr/local/ path. Then create a new folder bin

💡 usr is an abbreviation of “user related”

General CLI Help #

All DevZero commands start with dz and the usage is dz [command] Available commands are shared below:

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  ide         Connects an IDE to a box
  kube        devzero in k8
  login       Authenticates the user
  new         Get a new machine
  ssh         Connect to a running DevZero instance
  update      Updates the dz binary
  version     CLI version

  -h, --help   help for dz

Use "dz [command] --help" for more information about a command.

Example: dz ide is used to connect a supported IDE to a running DevBox Running the above command shows the usage and available commands

Doc Image

If you are further interested to learn more about each available command, you can do so by using:
dz ide <command> -h or dz ide <command> --help

Doc Image

Auth to the CLI #

From the terminal, login in to DevZero using the dz login command which initiates the device authentication process using the Device Authorization Flow(specified in OAuth 2.0)

dz login
  • You should be navigated to the verification page with embedded user code in the browser.
Doc Image
  • Ensure the confirmation code displayed in the browser matches up with the one in your terminal. If it does match, Click Confirm which will trigger one/more of the following processes:
    • Authenticating the user;
    • Redirecting the user to an Identity Provider to handle authentication;
    • Checking for active SSO sessions;
    • Obtaining user consent for the device, unless consent has been previously given.
Doc Image

Upon successful authentication and consent, the confirmation prompt will be shown: At this point, authentication is complete the device has been authorized and you should also see the following message in the terminal:

Doc Image

Successfully logged in. Session valid for 168h0m0s

💡 Authenticating allows you to create new DevBoxes(dz new), connecting to existing DevBoxes(dz ssh), connecting an IDE to DevBoxes(dz ide <ide_name>) and running DevZero in K8s(dz kube <command>)

VS Code #

Install our VS Code extension from the Visual Studio Marketplace here.

Upon successful installation, you should see a welcome screen as follows.

Doc Image

By this time, as you already have an account with DevZero, simply click Sign In which takes you through the authentication process for VS Code Extension.

Doc Image

Once authenticated you should be taken back to VS Code where you should see available environments ready to Launch with a button click and also running environments

Doc Image

Once you click LAUNCH , you are set to START CODING !!

Jetbrains IDE #

DevZero supports JetBrains IDEs by leveraging built-in features of the JetBrains Gateway.

Prerequisites #

  1. JetBrains Gateway has been installed on the user's local machine.
  2. The remote VM must be running Linux.

Connecting via JetBrains Gateway #

  1. Open JetBrains Gateway and click on SSH under Connections.
  2. Click the New Connection button.
    1. In the Username field enter "devzero"
    2. In the Host field, enter the name of the remote VM. This can be easily copied from the Console portal.
  3. Click Check Connection and Continue.
  4. Select the desired IDE to be installed and the desired project directory.
  5. Click Download IDE and Connect

Connecting via JetBrains Gateway:

Connecting via JetBrains Gateway

PreviousUpgrade Machine Disk Storage
NextBuild your First Environment