Created
April 17, 2014 04:14
-
-
Save yuuichi-fujioka/10952389 to your computer and use it in GitHub Desktop.
install apt-get package to qcow2 image
This file contains hidden or 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-get update | |
sudo chroot /mnt/ubuntu apt-get install foo -y | |
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