Skip to content

Instantly share code, notes, and snippets.

@corny
Last active June 23, 2017 12:20
Show Gist options
  • Select an option

  • Save corny/4997352 to your computer and use it in GitHub Desktop.

Select an option

Save corny/4997352 to your computer and use it in GitHub Desktop.
ubuntu-vm-builder for hetzner
hostname=THEHOSTNAME
distr=trusty
swapsize=2048
rootsize=8192
memory=2048
ubuntu-vm-builder kvm $distr \
--mirror http://mirror.hetzner.de/ubuntu/packages \
--dest /var/lib/libvirt/images/$hostname \
--arch amd64 \
--mem $memory \
--rootsize $rootsize \
--swapsize $swapsize \
--hostname $hostname \
--bridge=br0 \
--addpkg acpid \
--addpkg openssh-server \
--addpkg unattended-upgrades \
--addpkg vim \
--ssh-key /root/.ssh/authorized_keys
mv /var/lib/libvirt/images/$hostname/tmp*.qcow2 /var/lib/libvirt/images/$hostname.qcow2
# in /usr/lib/python2.7/dist-packages/VMBuilder/plugins/ubuntu/trusty.py
# das 'pass' austauschen durch disk_prefix = 'vd'
hostname=THEHOSTNAME
distr=trusty
swapsize=2048
rootsize=30720
memory=2048
ubuntu-vm-builder kvm $distr \
--mirror http://mirror.plutex.de/ubuntu \
--dest /var/lib/libvirt/images/$hostname \
--arch amd64 \
--mem $memory \
--rootsize $rootsize \
--swapsize $swapsize \
--hostname $hostname \
--bridge=br0 \
--addpkg acpid \
--addpkg openssh-server \
--addpkg unattended-upgrades \
--addpkg linux-image-generic \
--addpkg vim \
--ssh-key /root/.ssh/authorized_keys
mv /var/lib/libvirt/images/$hostname/tmp*.qcow2 /var/lib/libvirt/images/$hostname.qcow2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment