How to troubleshoot Azure IaaS VMs using the Azure Serial Console

When you troubleshoot issues on an Azure virtual machine (VM), you can connect to the VM by using the remote tools such as the serial console for Azure Virtual Machines, Run command, and many more. The Serial Console in the Azure portal provides access to a text-based console for Azure virtual machines (VMs) and virtual machine scale set instances. It is a great tool to troubleshoot Azure IaaS VMs if you lost access to the machine using RDP, SSH, or PowerShell remoting.

The Azure Serial Console works with Windows and Linux virtual machines. For Linux VMs, the serial connection connects to the ttys0 serial port of the VM or virtual machine scale set instance, providing access to it independent of the network or operating system state. For Windows VMs, the serial connection connects to the COM1 serial port of the VM or virtual machine scale set instance, providing access to it independent of the network or operating system state.

Prerequisites

To use the serial console, you have the following prerequisites.

To find more information check out Microsoft Docs.

Enable Serial Console functionality for Windows Server

In this blog post, I will quickly show you how you can enable the serial console for a Windows Server, if you want to do it for a Linux VM, check out the following link.

Newer Windows Server images on Azure have Special Administration Console (SAC) enabled by default. SAC is supported on server versions of Windows but isn't available on client versions (for example, Windows 10, Windows 8, or Windows 7).

Enable EMS Run Command

For older Windows Server images (created before February 2018), you can automatically enable the serial console through the Azure portal's run command feature. In the Azure portal, select Run command, then select the command named EnableEMS from the list.

There is also an option to enable EMS manually.

Access the VM using the Azure serial console

To access the serial console, you simply go to the virtual machine in the Azure portal, and under Support + troubleshooting, you can find the serial console.

Azure Serial Console

Now you can follow these steps:

  1. Enter "cmd" to create a new channel for the CMD instance

  2. Type "ch -si 1" to connect to the instance.

  3. Press Enter

  4. Enter your credentials to log in to the VM

  5. Now you can run CMD commands, and if you need PowerShell, you can also just start PowerShell by typing "PowerShell".

Azure Serial Console PowerShell Session

Conclusion

The Azure Serial Console is a great way to troubleshoot network or access configurations for Azure virtual machines. You can learn more about the Azure serial console here:

I hope this blog post was helpful. If you have any questions or comments, feel free to leave a comment.


Source:Paper.li

Recent Posts

See All

Build simple fuzzer - part 1

First of all, we are learning here and this fuzzer is in no way going to be a proper tool used against real targets (at least not initially). This is why we are going to code it in python. For real to

Build simple fuzzer - part 2

In the previous part of this mini-series we’ve implemented a very simple fuzzer. As the main idea behind it is being an exercise therefore I don’t think it is capable of finding bugs in complex target