Hi everyone!
I am new to the forums. I’m trying to use “virt-install” to create a rocky9 vm, but after the vm creation, I am not able to login as I dont have the default creds. Does anyone knows it?
Hi everyone!
I am new to the forums. I’m trying to use “virt-install” to create a rocky9 vm, but after the vm creation, I am not able to login as I dont have the default creds. Does anyone knows it?
Welcome to the forums!
It may seem confusing, but there are no “default creds” for the cloud images. You will need to provide cloud-init data to virt-install that sets up your user(s) or by specifying --cloud-init
by itself, where it will auto-generate a temporary root password for you.
Example config below which you can use with virt-install via --cloud-init user-data="/path/to/user-data.yaml"
. It may require you to make some experimentation and light reading of the cloud-init documentation to make it work. For below, the default user would be cloud-user
.
#cloud-config
password: somepassword
chpasswd: {expire: False}
ssh_pwauth: True
ssh_authorized_keys:
- ssh-rsa ...
You can directly specify users too.
#cloud-config
users:
- name: example
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- ssh-rsa ...
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.