맛집 여행 캠핑 일상 생활

[Rocky] 클라우드 이미지 root 패스워드 변경 방법 본문

LINUX

[Rocky] 클라우드 이미지 root 패스워드 변경 방법

영은파더♥ 2024. 7. 5. 14:04

오라클 클라우드 vm 에 kvm 으로 클라우드 이미지를 올리고 로그인을 하려니 root 비밀번호 초기화가 필요하더군요~

virt-customize 명령어로 초기화를 해야하는데 유틸이 없어서 설치합니다.

# yum -y install libguestfs-tools-c

# virt-customize -a rocky9.aarch64.qcow2 --root-password password:1234
[   0.0] Examining the guest ...
[  51.0] Setting a random seed
[  51.4] Setting passwords
[  69.0] SELinux relabelling
[ 247.3] Finishing off

시간이 엄청걸리네요~

혹시 작동중이라면 아래처럼 에러가 납니다.

 virt-customize -a rocky9.aarch64.qcow2 --root-password password:1234
[   0.0] Examining the guest ...
virt-customize: error: libguestfs error: could not create appliance through
libvirt.

Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct

Original error from libvirt: Requested operation is not valid: Setting
different SELinux label on /var/lib/libvirt/images/rocky9.aarch64.qcow2
which is already in use [code=55 int1=-1]

If reporting bugs, run virt-customize with debugging enabled and include
the complete output:

  virt-customize -v -x [...]

# virsh shutdown KVM명

일단 작동을 중지시키고 비밀번호를 초기화하시면 됩니다.

 

Trackback : | Comments :