Article ID: 88023
Article Type: Troubleshooting
Last Modified:
SSH access to the Ubuntu VM on Azure is unavailable following the restore operation.
After restoring the Ubuntu VM to Azure, the VM booted successfully on Azure, but a network issue impeded SSH access.
The SSH access to the Ubuntu VM on Azure is unavailable after restore because the source Ubuntu VM was configured using a static IP.
To access the Azure VM through SSH, perform the following steps:
Enable serial console access on the source VM using the following steps:
Run the following commands:
sudo systemctl enable serial-getty@ttyS0.service
sudo systemctl start serial-getty@ttyS0.service
systemctl status serial-getty@ttyS0.service
If the Serial Console is not already configured, edit /etc/default/grub and add the following:
GRUB_CMDLINE_LINUX="console=ttyS0,115200n8 earlyprintk=ttyS0"
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
Update GRUB to sudo update-grub.
Start and enable the serial service:
sudo systemctl start --now serial-getty@ttyS0.service
Perform an incremental backup from the backup software or console.
Log on to the Azure Serial Console. From the Azure portal, navigate to the restored VM, and then use the Serial Console to log on to the guest OS.
Modify the Netplan configuration to enable DHCP
Inside the VM (using the Serial Console), create the 01-netcfg.yaml file if it doesn't already exist, and add the eth0 dhcp configuration to the file instead
Open the Netplan configuration file:
sudo nano /etc/netplan/50-cloud-init.yaml
Either update or create the following content:
network:
version: 2
ethernets:
eth0:
dhcp4: true
Run the following command to apply the changes:
sudo netplan apply
Run the following command to verify if the SSH service is running:
sudo systemctl status sshd
Run the following command to start the SSH service:
sudo systemctl start sshd