home topics contact

Using telnet to Connect to the Serial Port of an ESXi 6.7 VM

Virtualization ESXi

Some virtual machines like router/firewall appliances can be configured with telnet by connecting to the serial port of the VM. This post will demonstrate how to connect to the Serial Port of a Juniper VCP appliance running on ESXi 6.7.

Introduction

Sometimes you can’t use SSH to connect to an appliance because the management network needs to be configured first. Typing lots of commands at the console is a pain, and so in the following steps we’ll demonstrate how telnet can be used to connect to a Juniper appliance.

Step 1: Enable Firewall Rule

The first thing we need to do is edit the ESXi firewall rules so that the serial port of a VM can be accessed over the ESXi management network.

Login to the web management interface of the ESXi 6.7 host then do the following steps.

  1. Click Networking.
  2. Click the Firewall rules tab.
  3. Scroll down, and right click on VM serial port connected over network.
  4. Click Enable.

Enable VM serial port connection over network ESXi firewall rule

Step 2: Edit Virtual Machine

Next we will edit the virtual hardware of a VM that we want to enable telnet communications on. The following example shows how to enable the serial port on a Juniper VCP virtual machine.

Right click on the powered off VM then click Edit settings.

Add serial port to VM - Step 1

Click Add other device then Serial port.

Add serial port to VM - Step 2

Select Use network in the dropdown menu of the new serial port.

Add serial port to VM - Step 3

For the port URI enter telnet://:8602, then click Save.

Add serial port to VM - Step 4

Power on the VM and wait for it for it to finish booting.

Step 3: Test telnet connection

Open up a Terminal/Command prompt then run the following command.

telnet 10.1.1.11 8602

If the virtual machine is configured to allow telnet over the serial port, you should now be connected to the VM. The output below shows the result of the command when connecting to the Juniper VCP appliance.

$ telnet 10.1.1.11 8602
Trying 10.1.1.11...
Connected to 10.1.1.11.
Escape character is '^]'.

login: root
Last login: Tue Dec 10 22:29:08 on ttyu0

--- JUNOS 18.1R3.3 Kernel 64-bit  JNPR-11.0-20180816.8630ec5_buil
root@:~ #

As you can see, we’re logged into the appliance and ready to issue commands.

Summary

In this tutorial, we configured the ESXi 6.7 firewall to allow the serial port of a VM to be accessed over the network. We added a serial port to a virtual machine and configured it so that telnet can connect to it. We finished by demonstrating telnet working on a Juniper VCP appliance.

Written by: Tony Mackay