Linux – Setting a root password in an OVA and making it configurable

linuxUbuntuvirtual-machinesvirtualizationvmware-esxi

I have this VM and it is always created with a default root password say "RootPassword55".
Now, I'd like to configure it so that the user will have to provide a new password on initial login.

I'm looking to configure this via OVF files but I couldn't get it to work.

I have this OVA. I extract this and I get an OVF and a vmdk file. The OVF refers to the vmdk. I added the password set properties (details below) in this OVF, and import it from virtual box but it doesn't seem to work.

I tried setting a property under the ProductSection element in the ovf but it doesn't seem to be picked up. I found quite a few links that say this is the right way to do it. Here's one of them – http://sflanders.net/2014/06/26/power-ovf-properties/. Scroll all the way down to password.

This is what I tried setting in the ProductSection.

<Property ovf:key="rootpw" ovf:password="TRUE" ovf:type="string" ovf:value="HelloUser" ovf:userConfigurable="TRUE">
     <Label>Root Password</Label>
     <Description>To set the root password</Description>
  </Property>

What I understand is, this property defaults to the password HelloUser if the user doesn't set a password while booting the VM. Also, it should ask the user to set a root password. But when I load the VM it still works with the previous default of RootPassword55 and seemingly, totally ignores my custom ovf properties.
I'm not sure where this "RootPassword55" is coming from. It's not in the ovf so it's probably in the vmdk file.
What am I doing wrong and how can I fix this?
Thanks.

Best Answer

One possible reason is that your password doesn't meet pam requirements, i.e. it's too simple. In that case changing the password will fail silently.