I'm currently running
virt-sysprep -v -x -d LOCALVM --hostname LOCALVM --root-password password:123456
But it errores out saying
virt-sysprep: error: libguestfs error: guestfs_launch failed, see earlier
error messages
But if I run this with sudo
it works. How do I set my user to not need sudo to be able to run virt-sysprep without it?
referencing the manual
You do not need to run virt-sysprep as root. In fact we'd generally recommend that you don't. The time you might want to run it as root is when you need root in order to access the disk image, but even in this case it would be better to change the permissions on the disk image to be writable as the non-root user running virt-sysprep.
Method 1: Try
echo sudo -s >> /home(your username)/.bash_profile
. When starting up the terminal, you need to put in your password to use the terminal, however, you won't have to usesudo
to executevirt-sysprep
. Be careful with this, because with great power comes great responsability. Method 2: Open a new terminal and type insudo visudo
. At the end of the file, type this in:%yourusername% ALL=NOPASSWD: /usr/bin/virt-sysprep
. I'm guessingvirt-sysprep
is installed in/usr/bin/virt-sysprep
. If you're not sure, type this in the terminal:whereis virt-sysprep
. Replace the first directory with/usr/bin/virt-sysprep
.Needed to give ownership
sudo chown -R user /usr/bin/virt-sysprep