Skip to content

Instantly share code, notes, and snippets.



Created Aug 17, 2012
What would you like to do?
boot cloud images with libvirt
$ disk_dist_imgz=/archive/mirrors/uec/releases/precise/release-20120728/ubuntu-12.04-server-cloudimg-amd64-disk1.img
$ disk_dist_img=disk.img.dist
$ disk=disk.img
$ qemu-img convert "${disk_dist_imgz}" "${disk_dist_img}"
$ qemu-img create -f qcow2 -b "${disk_dist_img}" "$disk"
$ cat my-user-data
password: passw0rd
chpasswd: { expire: False }
ssh_pwauth: True
- ssh-rsa AAAAB3NzaC1yc2EAAA...w== smoser@brickies
# update the above user-data with the output of 'ssh-add -L'
# create a seed disk with 'make-seed-disk' for cloud-init (LP: #1036312)
$ make-seed-disk --disk-format=qcow2 seed.img my-user-data
# write-libvirt-xml from
$ ./write-libvirt-xml "$disk,seed.img" my-dom > libvirt.xml
$ virsh define libvirt.xml
$ virsh start my-dom
# serial output should go to 'my-dom-serial.log' including ip address for ssh
$ virsh vncdisplay my-dom

This comment has been minimized.

Copy link

@mdanetzky mdanetzky commented Aug 26, 2017 doesn't exist anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment