Skip to content

Instantly share code, notes, and snippets.

@elleryq
Created August 19, 2015 09:11
Show Gist options
  • Save elleryq/824c866af0aabac39588 to your computer and use it in GitHub Desktop.
Save elleryq/824c866af0aabac39588 to your computer and use it in GitHub Desktop.
Create KVM domain with the image built by packer
#!/bin/bash
# Suppose that you had an image built by packer
# How to use it in KVM?
# Just use virt-install
virt-install --connect qemu:///system \
-n xmppdb \
-r 1024 \
--import \
--disk path=./packer-kvm.img,format=qcow2,size=10 \
--vnc \
--noautoconsole \
--os-type linux \
--os-variant ubuntuTrusty \
--network bridge=br0
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment