Blog
Please use this link to install virt-customize in linux (RHEL 8)
Setting the root password for qcow2 image,
$ virt-customize -a overcloud-full.qcow2 --root-password password:test
[ 0.0] Examining the guest ... libvirt: XML-RPC error : Cannot recv data: Connection reset by peer virt-customize: error: libguestfs error: could not connect to libvirt (URI = qemu:///session): Cannot recv data: Connection reset by peer [code=38 int1=104] If reporting bugs, run virt-customize with debugging enabled and include the complete output: virt-customize -v -x [...]
Checking the status of libvirtd daemon,
$ systemctl status libvirtd
● libvirtd.service - Virtualization daemon Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled) Active: inactive (dead) Docs: man:libvirtd(8) https://libvirt.org
Starting libvirtd and enabling default,
$ sudo systemctl enable libvirtd $ sudo systemctl start libvirtd
Now set the qcow2 image root password,
$ virt-customize -a overcloud-full.qcow2 --root-password password:test
[ 0.0] Examining the guest ... libvirt: XML-RPC error : Cannot recv data: Connection reset by peer virt-customize: error: libguestfs error: could not connect to libvirt (URI = qemu:///session): Cannot recv data: Connection reset by peer [code=38 int1=104] If reporting bugs, run virt-customize with debugging enabled and include the complete output: virt-customize -v -x [...]
need to export LIBGUESTFS_BACKEND and $LIBVIRT_DEFAULT_URI if not set
$ export LIBGUESTFS_BACKEND=direct $ echo $LIBVIRT_DEFAULT_URI $ export LIBVIRT_DEFAULT_URI=qemu:///system $ echo $LIBVIRT_DEFAULT_URI qemu:///system
trying again,
$ virt-customize -a overcloud-full.qcow2 --root-password password:test [ 0.0] Examining the guest ... [ 12.5] Setting a random seed [ 12.5] Setting the machine ID in /etc/machine-id [ 12.5] Setting passwords [ 15.2] Finishing off
virt-customize -a $1.qcow2 --run-command 'yum install -y wget'
virt-customize -a $1.qcow2 --run-command 'yum remove wget'
Updating qcow2 image using guestfish,
$ guestfish -a overcloud-full.qcow2 Welcome to guestfish, the guest filesystem shell for editing virtual machine filesystems and disk images. Type: ‘help’ for help on commands ‘man’ to read the manual ‘quit’ to quit the shell ><fs> run ><fs> mount /dev/sda / ><fs> vi /etc/default/grub ------------------ save the changes ><fs> exit« Previous Next »
Blog
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page