Azure – Regain access to a Virtual Machine

It can append that you make mistakes and change the Azure VM IP configuration by inadvertence.
The solution is to use Azure Serial Console :

Select the serial console

You will need to create a new channel to acces DOS command line on the server. For this use this command :


This will create a Channel (example : Cmd0001)

Connect to the channel using this command :

ch -sn

Bam, you are on a command line interface from the server. Here you can start the usuals commands you know like “ipconfig”.

From here, we will change the IP address of the server to come back to the DHCP automatic IP :

netsh interface ip set address “Ethernet 2” dhcp

Don’t forget the DNS if you changed it :

netsh interface ip set dns "Ethernet 2" dhcp

Restart and that’s it! You should be able to connect to your VM again.

Leave a Reply

Your email address will not be published. Required fields are marked *