VM Passwords
Passwords are sometimes needed for VM login, although for remote access SSH Keys are strongly encouraged due to their vastly increased security.
To add passwords to a Virtual Machine, the VM Template’s Context must include two fields:
USERNAME
- username of the configured userPASSWORD
- clear text password of the configured user. Not recommendedPASSWORD_BASE64
- base64 encoded reversible password of the configured user. Recommended for WindowsCRYPTED_PASSWORD_BASE64
- encrypted password of the configured user in base64 format. Recommended for Linux
Configure the Context fields in the VM Template’s Advance options under Context.
Adding a USERNAME field
In the User Inputs section, create two new fields. First, add a field with Name USERNAME
, the Input type: “Text”, and the default value of the user that will receive the context during instantiation. Click Add before moving on to the next field. The Default value
field is optional, but will need to be provided a value before deploying the VM.
Adding password fields
Next, create the password field. It is recommended to use CRYPTED_PASSWORD_BASE64
, however, it may be useful to employ the plaintext PASSWORD
when testing.
CRYPTED_PASSWORD_BASE64
is highly recommended as PASSWORD
stores plaintext password data. PASSWORD
may also have issues with some symbols or extended characters.
Windows cannot accept encrypted passwords but the PASSWORD_BASE64
will prevent symbols in passwords from causing problems.
Use the Type of “Password” for this field to prevent the value being shown in the UI and set the Name to either CRYPTED_PASSWORD_BASE64
(preferred) or PASSWORD
(low security and may have issues with symbols).
The CRYPTED_PASSWORD_BASE64
value is more secure because it does not expose the plaintext password value and base64 encoding prevents issues with passwords containing symbols and unusual characters.
Deploying the VM Template
When deploying the VM Template, since additional template context was added, there will be an extra step for User Inputs, this is where the password data is entered for the VM.
Creating passwords for Windows VM Templates
For Windows VMs create PASSWORD_BASE64
either on Windows with PowerShell:
or on Linux with bash and base64:
Creating passwords for Linux VM Templates
Create a CRYPTED_PASSWORD_BASE64
using the following command on any Linux or Unix system:
Example with interactive password entry:
The non-interactive form is:
The output of the command is a long string of characters that will be pasted into the CRYPTED_PASSWORD_BASE64
field.
On boot, the VM will configure the password for the user account specified at instantiation and these details can be used for console login.