安装Virt工具
[root@controller ~]# yum install libguestfs-tools-c
安装完成后将qcow2镜像上传至root目录下,然后使用Virt工具修改Root密码文章源自玩技e族-https://www.playezu.com/844204.html
修改Root密码
[root@controller ~]# virt-customize --add CentOS-7-x86_64-2009.qcow2 --root-password password:000000 [ 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: Cannot access storage file '/root/CentOS-7-x86_64-2009.qcow2' (as uid:107, gid:107): Permission denied [code=38 int1=13] If reporting bugs, run virt-customize with debugging enabled and include the complete output: virt-customize -v -x [...]
如果出现以上提示权限不足等信息,可根据提示声明一个环境变量实现直接修改Root密码文章源自玩技e族-https://www.playezu.com/844204.html
[root@controller ~]# export LIBGUESTFS_BACKEND=direct
再次执行修改Root密码文章源自玩技e族-https://www.playezu.com/844204.html
文章源自玩技e族-https://www.playezu.com/844204.html文章源自玩技e族-https://www.playezu.com/844204.html
评论