This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
virt:xen_4.4_14.04 [2014/03/10 13:08] tschulz [Build libvirt] |
virt:xen_4.4_14.04 [2014/03/11 15:28] tschulz [Build libvirt] |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== Compile and Install Xen 4.4 from source ===== | ===== Compile and Install Xen 4.4 from source ===== | ||
- | <file> | + | <file bash> |
- | apt-get install bcc bin86 gawk bridge-utils iproute libcurl3 libcurl4-openssl-dev bzip2 module-init-tools transfig tgif texinfo texlive-latex-base texlive-latex-recommended texlive-fonts-extra texlive-fonts-recommended pciutils-dev mercurial make gcc libc6-dev zlib1g-dev python python-dev python-twisted libncurses5-dev patch libvncserver-dev libsdl-dev libjpeg62-dev iasl libbz2-dev e2fslibs-dev git-core uuid-dev ocaml ocaml-findlib libx11-dev bison flex xz-utils libyajl-dev install gettext | + | apt-get install bcc bin86 gawk bridge-utils iproute libcurl3 libcurl4-openssl-dev bzip2 module-init-tools transfig tgif texinfo texlive-latex-base texlive-latex-recommended texlive-fonts-extra texlive-fonts-recommended pciutils-dev mercurial make gcc libc6-dev zlib1g-dev python python-dev python-twisted libncurses5-dev patch libvncserver-dev libsdl-dev iasl libbz2-dev e2fslibs-dev git-core uuid-dev ocaml ocaml-findlib libx11-dev bison flex xz-utils libyajl-dev gettext libpixman-1-dev |
apt-get build-dep xen | apt-get build-dep xen | ||
- | apt-get install libpixman-dev? | + | cd /usr/src |
- | + | wget http://bits.xensource.com/oss-xen/release/4.4.0/xen-4.4.0.tar.gz | |
- | cd xen-4.4 | + | tar xvzf xen-4.4.0.tar.gz |
+ | cd xen-4.4.0 | ||
./configure --prefix=/usr | ./configure --prefix=/usr | ||
make dist | make dist | ||
make install | make install | ||
+ | |||
+ | </file> | ||
+ | |||
+ | ===== Enable Network Bridging ===== | ||
+ | <file network /etc/network/interfaces> | ||
+ | iface eth0 inet manual | ||
+ | |||
+ | auto xenbr0 | ||
+ | iface xenbr0 inet dhcp | ||
+ | bridge_ports eth0 | ||
+ | |||
+ | </file> | ||
+ | |||
+ | |||
+ | ===== Enable startup services and install virt-manager ===== | ||
+ | <file> | ||
+ | update-rc.d xencommons defaults | ||
+ | update-rc.d xendomains defaults | ||
+ | update-rc.d xen-watchdog defaults | ||
+ | |||
+ | apt-get install virt-manager | ||
+ | mkdir /var/log/libvirt/libxl/ | ||
+ | </file> | ||
+ | notes: for some reason libvirt-bin needs /var/log/libvirt/libxl/ created otherwise libvirtd will not start. You also need to add a new xen hypervisor connection to virt-manager the first time you start virt-manager. | ||
+ | |||
+ | ===== Update Grub Loader ===== | ||
+ | <file> | ||
+ | cd /boot/ | ||
+ | rm xen-4.4.gz xen-4.gz xen.gz | ||
+ | |||
+ | update-grub | ||
</file> | </file> | ||
+ | Notes: By default ubuntu will not boot xen so you either need to change the default boot entry or [[ubuntu:gub2|force grub boot menu to be displayed]] | ||
===== Build libvirt ===== | ===== Build libvirt ===== | ||
Line 26: | Line 59: | ||
</file> | </file> | ||
+ | ===== Basic xen vm config ===== | ||
+ | <file> | ||
+ | builder='hvm' | ||
+ | |||
+ | memory = 512 | ||
+ | name = "fbsd10" | ||
+ | vif = [ 'type=ioemu, bridge=xenbr0' ] | ||
+ | disk = [ 'file:/root/vm/freebsd10.raw,xvda,w', 'file:/root/vm/iso/freebsd10x64.iso,xvdc:cdrom,r' ] | ||
+ | device_model = '/usr/lib/xen-default/bin/qemu-dm' | ||
+ | boot="c" | ||
+ | |||
+ | sdl=0 | ||
+ | vnc=1 | ||
+ | vnclisten="127.0.0.1" | ||
+ | vncconsole=1 | ||
+ | stdvga=0 | ||
+ | serial='pty' | ||
+ | usbdevice='tablet' | ||
+ | |||
+ | on_poweroff = 'destroy' | ||
+ | on_reboot = 'restart' | ||
+ | on_crash = 'restart' | ||
+ | </file> | ||
+ | |||
+ | ===== Spice Enabled config ===== | ||
+ | |||
+ | <file xen> | ||
+ | # ===================================================================== | ||
+ | # Example HVM guest configuration | ||
+ | # ===================================================================== | ||
+ | # | ||
+ | # This is a fairly minimal example of what is required for an | ||
+ | # HVM guest. For a more complete guide see xl.cfg(5) | ||
+ | |||
+ | # This configures an HVM rather than PV guest | ||
+ | builder = "hvm" | ||
+ | |||
+ | # Guest name | ||
+ | name = "win7" | ||
+ | |||
+ | device_model_version ="qemu-xen" | ||
+ | device_model_override="/usr/lib/xen/bin/qemu-system-i386" | ||
+ | |||
+ | # 128-bit UUID for the domain as a hexadecimal number. | ||
+ | # Use "uuidgen" to generate one if required. | ||
+ | # The default behavior is to generate a new UUID each time the guest is | ||
+ | started. | ||
+ | #uuid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" | ||
+ | |||
+ | # Enable Microsoft Hyper-V compatibile paravirtualisation / | ||
+ | # enlightenment interfaces. Turning this on can improve Windows guest | ||
+ | # performance and is therefore recommended | ||
+ | #viridian = 1 | ||
+ | |||
+ | # Initial memory allocation (MB) | ||
+ | memory = 1024 | ||
+ | |||
+ | # Maximum memory (MB) | ||
+ | # If this is greater than `memory' then the slack will start ballooned | ||
+ | # (this assumes guest kernel support for ballooning) | ||
+ | #maxmem = 512 | ||
+ | |||
+ | # Number of VCPUS | ||
+ | vcpus = 2 | ||
+ | |||
+ | # Network devices | ||
+ | # A list of 'vifspec' entries as described in | ||
+ | # docs/misc/xl-network-configuration.markdown | ||
+ | vif = [ 'type=ioemu, mac=00:16:3E:*:*:*,bridge=br0'] | ||
+ | |||
+ | # Disk Devices | ||
+ | # A list of `diskspec' entries as described in | ||
+ | # docs/misc/xl-disk-configuration.txt | ||
+ | disk = [ '/root/win7.img,raw,hda,rw' ] | ||
+ | |||
+ | # Guest VGA console configuration, either SDL or VNC | ||
+ | sdl = 0 | ||
+ | #vnc = 1 | ||
+ | #vnclisten="0.0.0.0" | ||
+ | stdvga=0 | ||
+ | spice=1 | ||
+ | spicehost='10.10.*.*' | ||
+ | spiceport=6000 | ||
+ | spicedisable_ticketing=1 | ||
+ | stdvga=0 | ||
+ | #videoram=128 | ||
+ | #device_model_args=["-device","qxl-vga"] | ||
+ | |||
+ | #hap=1 | ||
+ | pae=1 | ||
+ | acpi=1 | ||
+ | apic=1 | ||
+ | nx=1 | ||
+ | xen_platform_pci=1 | ||
+ | usbdevice='tablet' | ||
+ | qxl=1 | ||
+ | audio=1 | ||
+ | soundhw='es1370' | ||
+ | </file> |