===== howo add diskspace to paravirt-domUs ===== dom0> dd if=/dev/zero of=/mnt/storage/xen/diskfile bs=128M count=1 # xm block-attach [BackDomain] dom0> xm block-attach 82 tap:aio:/mnt/storage/xen/diskfile sdd w 0 dom0> ssh sles10 domU> cat /proc/partitions |tail -1 # now new space comes up 8 48 131072 sdd domU> mkfs.ext3 /dev/sdd # and is usable ===== howto setup linux in paravirt-domUs == * see software-links on top of this site * domU with redhat/fedora: virt-manager, virt-install (part of redhat, fedora, centos) * domU with debian: debootstrap (part of knoppix, grml, debian) * domU fedora/redhat/suse paravirtualized install: boot xenified vmlinuz+initrd + install via network or cd/dvd * domU all OSs: install fully irtualized in HVM-xen or qemu/vmware, later upgrade with paravirt. kernel ===== howto setup other os in paravirt-domUs == * FreeBSD: no luck in fedora7 with xen3.1 * OpenSolaris: no luck yet on xen3.1.1 to boot up the available opensolaris-cds in a HVM-domU ===== howto set up tty-stuff for para-domU == * vanilla 2.6.23: pass "console=hvc0" with the extra-parameter to the domU if you see nothing after booting * better solution/all else: pass "console=/dev/xvc0" to the domU * for interaction, login to the domU: passing "xencons=tty" is a dirty/fast way, more clean is to use /dev/xvc0 - but might also need eidts of /etc/securetty and /etc/inittab to make logins possible ===== filesystems/software for xen ===== * pure blocks below multiple dom0-hosts: iSCSI (redhat and suse supported), ata over ethernet (aoe), san-luns, network block devices (nbd), enbd * over that something that lets multiple dom0 access the data on it without interfering: ocfs2+evms (suse supported), gfs(2)-clvm (redhat supported), drbd ===== running a windows-xp installation both on bare metal and under xen ===== * this is from xen 3.0.4 times, stuff is easier now with xen >3.1 * install windows-xp on the bare metal and run it later under xen (didnt work the other way around here), use FAT32 filesystem for easy handling * after booting setup-cd hit F5 until a menu appears and select 'standart pc'. Otherwise xen has problems running the installation later on (didnt shut down here properly, this setting is also required to be able to setup wixp under xen in the first place) * after installation create 2 new hardware-profiles: 'profile bare metal' for starting the installation on hardware, 'profile xen' for xen * on first start under xen new hardware gets discovered. * easy backups of the wixp-installation from linux: mount /dev/sda2 /mnt/tmp cat /dev/zero >/mnt/tmp/fillfile # if this stops with comment 'maximum filesize reached' create an other file like this with a different name # at some point the filesystem is filled up (out of space) and you are done here rm /mnt/tmp/fillfile* # delete the files, the zeros remain and make gzips job of compressing easy gzip -3 /mnt/lv_public/xen_sda2_wixpbackup.gz # do the actual backup. * the xen-configfile for the vm: import os, re arch = os.uname()[4] if re.search('64', arch): arch_libdir = 'lib64' else: arch_libdir = 'lib' kernel = "/usr/lib/xen/boot/hvmloader" builder='hvm' memory = 1024 name = "HVMwixp" vcpus=2 vif = [ 'type=ioemu, bridge=xenbr0' ] disk = [ 'phy:/dev/sda,hda,w', 'file:/mnt/lv_public/cdrom.iso,hdc:cdrom,r' ] on_poweroff = 'destroy' on_reboot = 'restart' on_crash = 'preserve' device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm' boot="dcan" sdl=1 vnc=0 vnclisten="10.0.1.1" vncconsole=1 vncpasswd='' stdvga=0 serial='pty' soundhw='sb16' usb=1 usbdevice='tablet' keymap='de' ===== mounting ===== === mount partitions of a domU with partitiontable from dom0 === method 1: apt-get install multipath-tools # or whatever you distro uses. contains the kpartx-tool kpartx -av /path/to/domu_imagefile # creates a devnode for every partition under /dev/mapper mount /dev/mapper/loop4p1 /mnt/tmp # mounts the first partition method 2: lomount -diskimage /mnt/storage/xen/xm64_gfs1 -partition 1 /mnt/tmp # does the same thing method 3: fdisk -l -u /dev/vg1/lv1 mount -o loop,offset=460615680 /dev/vg1/lv1p2 /mnt # or do a 'losetup -o ...' bevore ===== xennotes + examples ===== == restrict outgoing traffic of a domU == vif = [ 'brigde=bridge0, rate=10MB/s' ] # limit outgoing traffic to 10MB/second == rebuild domU-initrd with block-support == * %%mkinitrd --with=xennet --preload=xenblk /boot/initrd_xen_2.6.18-1.2849 2.6.18-1.2849.fc6xen%% == compute mac predictable from hostname == * MACADDR="aa:00:$(echo $VHOSTNAME | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4/')" == let a PV-domU see that its partitions growed == * xm block-detach / xm block-attach # unchecked == growing sparse-files == * dd if=/dev/zero of=domUimagefile bs=1 count=0 seek=9G # grow sparsefile to 9GB * perl -e 'truncate("domUimagefile", 9.*1024.*1024.*1024.)' # grow sparsefile to 9GB == xen-vm-config options for windows in a hvm for better input-handling == * usb=1 * usbdevice='tablet' == xen-vm-config options to enable the qemu-menu == * monitor='yes' # its disabled by default because the user can read all files on dom0 that way * call it by pressing ctrl-alt-2 == xen support for framebuffer of domU (starting with xen 3.0.4), notes by Mark Williamson == you can run X within the guest directly. upgrade to 3.0.4, edit Config.mk to change XENFB_TOOLS to =y and do a make-install tools. This'll give you the dom0 components for accessing the framebuffer. compile a domU kernel with framebuffer support in (it's selectable in the kernel menuconfig). If you want to be able to run virtual terminals on the framebuffer, you'd also need to select the generic Linux options for the framebuffer console. I'd recommend you do this. domU: /etc/inittab S0:2345:respawn:/sbin/mingetty ttyS0 domU: /etc/securetty or /etc/securettys (whichever you have) domU configfile: "xencons=ttyS0 console=ttyS0 video=xenfb" domU configfile: "vfb=['type=sdl']" to get a local display of the domain's framebuffer or vfb=['type=vnc'] or "vfb=['type=vnc,vnclisten=ipaddr']" == several stuff == 00:16:3e:xx:xx:xx IEEE range assigned to XenSource Inc core2duo board multiplicatorfree: asus P5B Deluxe, P5B Deluxe/WiFi-AP and P5W DH Deluxe starting with BIOS 1405 running Windows in HVM, get audio out of it with a sound server like pulseaudio. An example debian-interfaces config entry for a bridge: auto xbr0 iface xbr0 inet dhcp bridge_fd 0 bridge_maxwait 0 bridge_helo 0 bridge_ports eth0 Manual creation of a simple bridge with enslaved eth0: brctl addbr xbr0 ifconfig eth0 0.0.0.0 up brctl addif xbr0 eth0 ifconfig xbr0 10.0.0.1 netmask 255.255.255.0 Advanced manual bridge: brctl addbr xbr0 brctl setfd xbr0 0 brctl sethello xbr0 0 brctl stp xbr0 off ifconfig eth0 0.0.0.0 up brctl addif xbr0 eth0 ifconfig xbr0 10.0.0.1 netmask 255.255.255.0