Skip to content

Instantly share code, notes, and snippets.

Last active June 2, 2016 13:33
What would you like to do?
Bash script to automatically install and configure Xen 4.1 on Ubuntu Server 12.04 LTS
# Setup and configure Xen DomU
# Run as root/sudo on a fresh Ubuntu Server 12.04 LTS install. Reboot when complete.
# Update
apt-get update
apt-get upgrade
# Install Xen hypervisor
apt-get install xen-hypervisor-amd64
sed -i 's/GRUB_DEFAULT=.*\+/GRUB_DEFAULT="Xen 4.1-amd64"/' /etc/default/grub
sed -i 's/TOOLSTACK=.*\+/TOOLSTACK="xm"/' /etc/default/xen
# Setup bridge network interface
cat >> /etc/network/interfaces << EOL
#Xen Bridge
auto xenbr0
iface xenbr0 inet dhcp
bridge_ports eth0
# Limit Dom0 memory to 512M
echo 'GRUB_CMDLINE_XEN_DEFAULT="dom0_mem=512M"' >> /etc/default/grub
#Allow VNC connections from anywhere
sed -i "s/#(vnc-listen.*/(vnc-listen \'\')/" /etc/xen/xend-config.sxp
#Fix keymap issue
ln -s /usr/share/qemu-linaro/ /usr/share/qemu/
Copy link

Edit line 24 to set the amount of memory assigned to dom0.

Copy link

Thanks for the script! Was following another guide and stumbled across yours -- gonna save me a lot of time! ;_;

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