Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bash script to automatically install and configure Xen 4.1 on Ubuntu Server 12.04 LTS
#!/bin/bash
# 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
EOL
# Limit Dom0 memory to 512M
echo 'GRUB_CMDLINE_XEN_DEFAULT="dom0_mem=512M"' >> /etc/default/grub
update-grub
#Allow VNC connections from anywhere
sed -i "s/#(vnc-listen.*/(vnc-listen \'0.0.0.0\')/" /etc/xen/xend-config.sxp
#Fix keymap issue
ln -s /usr/share/qemu-linaro/ /usr/share/qemu/
@abythell

This comment has been minimized.

Copy link
Owner Author

@abythell abythell commented Mar 28, 2013

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

@pythoninthegrass

This comment has been minimized.

Copy link

@pythoninthegrass pythoninthegrass commented Dec 17, 2014

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