Unable login when creating VM from non-deprovisioned Linux VM image in DevTest Lab

242 views Asked by At

I tried to create a custom image from a VM without doing deprovisioned artifact. After new VM been created from the custom image. The VM is unable to login with original password. Is it a bug?

Here is the steps to reproduce the problem:

  1. Create a VM from Ubuntu Linux 18.04 LTS
  2. Create custom image from this VM without Run deprovision on virtual machine.
  3. Create a new VM from this new image.
  4. SSH to this VM with original login/password. It will failed to login.
1

There are 1 answers

0
Charles Xu On BEST ANSWER

When you create a VM from non-deprovisioned Linux VM image, it will remove the password file from the virtual machine. So you cannot log in the VM.

There are two suggestions for you:

  1. Use SSH keys when you are creating the source VM. By using SSH keys instead of passwords, the credentials on the machine will persist. This way, when a user wants to create a custom image and create new VMs from it, he/she can enter the SSH key and access the virtual machine. Hence this should allow you to continue using non-deprovisioned custom images.
  2. Run deprovision on the machine while creating a custom image. This will allow you to specify credentials which can then be entered while creating new virtual machines from the custom image.

For more details, see Accessing Linux virtual machines created from non-deprovisioned custom images.