SSH Access to the Ubuntu VM on Azure Fails After Restore

Article ID: 88023

Article Type: Troubleshooting

Last Modified:

SSH access to the Ubuntu VM on Azure is unavailable following the restore operation.

Symptoms

After restoring the Ubuntu VM to Azure, the VM booted successfully on Azure, but a network issue impeded SSH access.

Causes

The SSH access to the Ubuntu VM on Azure is unavailable after restore because the source Ubuntu VM was configured using a static IP.

Resolution

To access the Azure VM through SSH, perform the following steps:

  1. Enable serial console access on the source VM using the following steps:

    1. Run the following commands:

       sudo systemctl enable serial-getty@ttyS0.service  
      
       sudo systemctl start serial-getty@ttyS0.service  
      
       systemctl status serial-getty@ttyS0.service
      
    2. 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" 
      
    3. Update GRUB to sudo update-grub.

    4. Start and enable the serial service:

       sudo systemctl start --now serial-getty@ttyS0.service  
      
  2. Perform an incremental backup from the backup software or console.

  3. 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.

  4. Modify the Netplan configuration to enable DHCP

    1. 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

    2. Open the Netplan configuration file:

       sudo nano /etc/netplan/50-cloud-init.yaml
      
    3. Either update or create the following content:

       network: 
       version: 2
       ethernets:
       eth0:
       dhcp4: true 
      
    4. Run the following command to apply the changes:

       sudo netplan apply
      
  5. Run the following command to verify if the SSH service is running:

     sudo systemctl status sshd
    
  6. Run the following command to start the SSH service:

    sudo systemctl start sshd
    
1 Commvault Way, Tinton Falls, NJ 07724 Sitemap | Legal Notices | Trademarks | Privacy Policy
Copyright © Commvault | All Rights Reserved.