Description of problem: See: http://wiki.debian.org/HowTo/ChangeHostname You have to also edit /etc/hosts. Currently (just editing /etc/hostname) results in strange warning messages when using sudo: sudo: unable to resolve host [new hostname] Version-Release number of selected component (if applicable): libguestfs 1.21.31 How reproducible: 100% Steps to Reproduce: 1. Take a Debian/Ubuntu guest and use virt-sysprep --hostname ...
This has been fixed with https://github.com/libguestfs/libguestfs/commit/ab2df2e6598d421067d600f89a3d225162424d9b which is in libguestfs >= 1.25.35.