Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save winggundamth/b37fcd73726fa732c6dfb3faae214f8c to your computer and use it in GitHub Desktop.
Save winggundamth/b37fcd73726fa732c6dfb3faae214f8c to your computer and use it in GitHub Desktop.
Prepare OpenStack Ubuntu QCOW2 Image
sudo apt-get install qemu-utils
sudo modprobe nbd
sudo qemu-nbd --connect=/dev/nbd0 /full/path/to/qcow2/image/file
sudo mkdir /mnt/ubuntu
sudo mount /dev/nbd0p1 /mnt/ubuntu
sudo mount -t proc proc /mnt/ubuntu/proc/
sudo mkdir /mnt/ubuntu/run/resolvconf
sudo cp /etc/resolv.conf //mnt/ubuntu/run/resolvconf/
sudo chroot /mnt/ubuntu
apt-add-repository ppa:ansible/ansible
curl -sSL https://get.docker.com/ | sh
apt-get -y dist-upgrade
apt-get install -y git ansible
apt-get clean all
sudo umount /mnt/ubuntu/proc
sync
sudo umount /mnt/ubuntu
sudo qemu-nbd --disconnect /dev/nbd0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment