I download qcow2 ubuntu 18.04 img from here: https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img
I want to add some packages into qcow2 image before use it as a base img to create vms on it.
This command to update repos give success:
> virt-customize -a ubuntu18.04-zsh.img --run-command 'apt update -y'
[ 0.0] Examining the guest ...
[ 4.7] Setting a random seed
virt-customize: warning: random seed could not be set for this type of
guest
[ 4.7] Running: apt update -y
[ 65.5] Finishing off
But when I try to install zsh, it fail to connect to internet:
> virt-customize -a ubuntu18.04-zsh.img --install zsh
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/z/zsh/zsh-common_5.4.2-3ubuntu3.1_all.deb Temporary failure resolving 'archive.ubuntu.com'
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/z/zsh/zsh_5.4.2-3ubuntu3.1_amd64.deb Temporary failure resolving 'archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
virt-customize: error:
export DEBIAN_FRONTEND=noninteractive
apt_opts='-q -y -o Dpkg::Options::=--force-confnew'
apt-get $apt_opts update
apt-get $apt_opts install 'zsh'
: command exited with an error
If reporting bugs, run virt-customize with debugging enabled and include
the complete output:
virt-customize -v -x [...]
There's no vm is running on ubuntu18.04-zsh.img. Is there a way to customize qcow2 img?