Skip to content

Instantly share code, notes, and snippets.

@rubenerd
Created December 1, 2014 00:55
Show Gist options
  • Save rubenerd/825376092d73ed96936a to your computer and use it in GitHub Desktop.
Save rubenerd/825376092d73ed96936a to your computer and use it in GitHub Desktop.
virt-install CentOS Xen
#!/bin/sh
## CentOS 6 Xen HVM install, with VNC access
## Works decently, but Packer.io more flexible
name='centos-6'
ram=1024
cpus=1
description="CentOS 6 x86_64 Xen HVM"
location="http://mirror.internode.on.net/pub/centos/6.6/os/x86_64/"
disksize=2
network='bridge=xenbr0'
kickstart='centos-6-kickstart.cfg'
virt-install
--connect xen:/// \
--hvm \
--name="${name}" \
--ram="${ram}" \
--vcpus="${cpus}" \
--description="${description}" \
--location="${location}" \
--os-type="linux" \
--disk "path=${name}.img,size=${disksize}" \
--network="${network}" \
--graphics vnc,listen=0.0.0.0 \
--noautoconsole \
--initrd-inject="${kickstart}" \
--extra-args="text ks file:/${kickstart}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment