Forked from yuuichi-fujioka/install package to qcow image.sh
Last active
January 28, 2017 18:15
-
-
Save winggundamth/b37fcd73726fa732c6dfb3faae214f8c to your computer and use it in GitHub Desktop.
Prepare OpenStack Ubuntu QCOW2 Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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