====== XenGT on Ubuntu 12.04/14.04 ====== ===== Install Prerequisite Packages ===== apt-get update apt-get install libarchive-dev libghc-bzlib-dev libghc6-bzlib-dev zlib1g-dev mercurial gettext bcc iasl uuid-dev libncurses5-dev kpartx bc libperl-dev libgtk2.0-dev libc6-dev-i386 libaio-dev libsdl1.2-dev nfs-common libyajl-dev libx11-dev autoconf libtool xsltproc bison flex xutils-dev xserver-xorg-dev x11proto-gl-dev libx11-xcb-dev vncviewer libxcb-glx0 libxcb-glx0-dev libxcb-dri2-0-dev libxcb-xfixes0-dev bridge-utils python-dev bin86 git vim libssl-dev pciutils-dev tightvncserver ssh texinfo ===== Build and Install Kernel ===== git clone https://github.com/01org/XenGT-Preview-kernel.git cd XenGT-Preview-kernel/ cp config-3.17.0-dom0 .config make -j8 && make modules_install cp .config /boot/config-3.17.0-rc4-vgt+ mkinitramfs -o /boot/initrd.img-3.17.0-rc4-vgt+ 3.17.0-rc4-vgt+ cp arch/x86/boot/bzImage /boot/vmlinuz-3.17.0-rc4-vgt+ cp vgt.rules /etc/udev/rules.d chmod a+x vgt_mgr cp vgt_mgr /usr/bin ===== Build Xen/Qemu ===== git clone https://github.com/01org/XenGT-Preview-xen.git cd XenGT-Preview-xen/ git clone https://github.com/01org/XenGT-Preview-qemu.git git clone git://xenbits.xen.org/xen.git xen-vgt git clone git://git.qemu-project.org/qemu.git qemu-xen cd qemu-xen git checkout -b v1.3.0 v1.3.0 patch -p1 < ../XenGT-Preview-qemu/qemu-vgt.patch cd ../xen-vgt git checkout -b RELEASE-4.3.1 RELEASE-4.3.1 patch -p1 < ../xen-vgt.patch cp -r ../qemu-xen tools/ sed -i '/QEMU_UPSTREAM_URL/s:http\://xenbits.xen.org/git-http/qemu-upstream-4.3-testing.git:$(XEN_ROOT)/tools/qemu-xen:' Config.mk sed -i '/QEMU_UPSTREAM_URL/s:git\://xenbits.xen.org/qemu-upstream-4.3-testing.git:$(XEN_ROOT)/tools/qemu-xen:' Config.mk ./autogen.sh ./configure --prefix=/usr #XEN4.3 changes the default path to /usr/local make -j8 xen tools cp xen/xen.gz /boot/xen-vgt.gz make install-tools PYTHON_PREFIX_ARG= rm -f /etc/ld.so.conf.d/lib64.conf # the file may not exist on some Ubuntu distribution ldconfig ===== Add New Grub Entry ===== ==== Add to /etc/grub.d/40_custom, replace without output of command from above ==== menuentry 'Ubuntu GNU/Linux, with Xen vgt and Linux 3.17.0-rc4-vgt+' --class ubuntu --class gnu-linux --class gnu --class os --class xen $menuentry_id_option 'xen-gnulinux-3.17.0-rc4-vgt+-advanced-319fbd3c-e5ef-42b1-807e-16c87cc1a0c6' { insmod part_msdos insmod ext2 set root='hd0,msdos1' search --no-floppy --fs-uuid --set=root echo 'Loading Xen vgt ...' multiboot /boot/xen-vgt.gz placeholder dom0_mem=2048M loglvl=all guest_loglvl=all echo 'Loading Linux 3.17.0-rc4-vgt+ ...' module /boot/vmlinuz-3.17.0-rc4-vgt+ placeholder root=UUID= ro w rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM ignore_loglevel console=tty0 console=hvc0 consoleblank=0 log_buf_len=4M xen_vgt.hvm_boot_foreground=1 echo 'Loading initial ramdisk ...' module --nounzip /boot/initrd.img-3.17.0-rc4-vgt+ } ==== The following command should insert the UUID for your root partition ==== cat /etc/grub.d/40_custom | sed "s//`cat /etc/fstab | grep \" / \" |grep -v \"#\" | tr -s \" \" | cut -d \" \" -f1 | cut -d \"=\" -f2`/g" > /etc/grub.d/40_custom ==== Edit /etc/default/grub, this shows the boot menu for 10 secs ==== GRUB_DEFAULT=0 #GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=false GRUB_TIMEOUT=10 ===== Enable Xen Services ===== update-rc.d xencommons defaults ===== Configure Bridge ===== ==== Add to /etc/network/interfaces ==== auto xenbr0 iface xenbr0 inet dhcp bridge_ports eth0 ===== Example DomU Config ===== Kernel = “hvmloader” builder = ‘hvm’ memory = 2048 name = “vgtHVMDomain” vif = [ 'type=ioemu, bridge=xenbr0' ] disk = ['/path/to/system-10G.img,raw,hda,w'] #device_model = 'qemu-dm' device_model_version='qemu-xen' device_model_override='/usr/lib/xen/bin/qemu-system-i386' sdl=1 opengl=1 vnc=0 vncpasswd='' serial='pty' tsc_mode=0 stdvga = 0 usb=1 usbdevice='tablet' keymap='en-us' vgt=1 vgt_low_gm_sz=128 vgt_high_gm_sz=384 vgt_fence_sz=4 vgt_monitor_config_file=’/path/to/monitor.config’ #only valid for indirect display mode