virtualization

warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

Default Debian DomU

# configure domU
[ -z $DOMAIN_NAME ] && DOMAIN_NAME=lenny
[ -z $DOMAIN_MAC ] && DOMAIN_MAC=00:00:00:00:aa:bb
[ -z $DOMAIN_RAM ] && DOMAIN_RAM=512Mb
[ -z $DOMAIN_HDD ] && DOMAIN_HDD=4Gb
 
# create domU
xen-create-image --hostname=${DOMAIN_NAME} --dhcp --mac=${DOMAIN_MAC} \
--lvm=vg01 --dist=lenny --role=udev --size=${DOMAIN_HDD} --memory=${DOMAIN_RAM} --swap=${DOMAIN_RAM}
 
# rename vm config
mv /etc/xen/${DOMAIN_NAME}.cfg /etc/xen/${DOMAIN_NAME}
 
# post config domU
mount /dev/vg01/${DOMAIN_NAME}-disk /mnt/
sed -i 's|tty1|hvc0|g' /mnt/etc/inittab
chroot /mnt/ sh -c "echo root:terc

Magento domU

# set domU parameter
[ -z $DOMAIN_NAME ] && DOMAIN_NAME=magento
[ -z $DOMAIN_MAC ] && DOMAIN_MAC=00:EE:EE:EE:EE:EE
[ -z $DOMAIN_RAM ] && DOMAIN_RAM=4Gb
[ -z $DOMAIN_HDD ] && DOMAIN_HDD=16Gb
 
# create domU (Local)
http://www.panticz.de/DomU-Debian-Squeeze
 
# create domU (Hoster)
http://www.panticz.de/Hetzner
 
# install magento
http://www.panticz.de/install_magento
 
 
#
# OPTIONAL
#
# create separate www patition
lvcreate --name ${DOMAIN_NAME}-www --size 128G vg0
mkfs.ext3 /dev/vg0/${DOMAIN_NAME}-www
 
vi /etc/xen/${DOMAIN_NAME}
(add)
'phy:/dev/vg0/mrwww-www,sda3,w',
 
#

Asterisk DomU

http://www.panticz.de/DomU-Debian-Wheezy
 
# hide your ISDN card in dom0 and reboot dom0
# sed -i 's|tty0|tty0 pciback.hide=(04:02.0)|g' /boot/grub/menu.lst
# reboot
 
# in domU
passwd
 
# install lspci
apt-get install -y pciutils
 
# OPTIONAL: Diva Server 4BRI-8M 2.0 PCI
http://www.panticz.de/node/342
 
 
 
# apt-get install -y linux-headers-$(uname -r) dpkg-dev
 
 
 
 
apt-get source linux-image-$(uname -r)
 
#cd /usr/src/
#tar xzf linux_2.6.24.orig.tar.gz
#ln -s /usr/src/linux-2.6.24.2/ /usr/src/linux
ln -s /usr/src/linux-$(uname -r)/ /usr/src/linux
 
#mv /etc/apt/sources.li

Create Xen DomU Mailserver

# set domU parameter
[ -z $DOMAIN_NAME ] && DOMAIN_NAME=mx
[ -z $DOMAIN_MAC ] && DOMAIN_MAC=00:11:22:7E:7E:7E
[ -z $DOMAIN_RAM ] && DOMAIN_RAM=512Mb
[ -z $DOMAIN_HDD ] && DOMAIN_HDD=4Gb
 
# create domU
##http://www.panticz.de/Xen-domU-ubuntu-jaunty
http://www.panticz.de/DomU-Debian-Wheezy
 
# add to autostart (optional)
ln -s /etc/xen/${DOMAIN_NAME} /etc/xen/auto
 
# create lvm for home
lvcreate --name ${DOMAIN_NAME}-home --size 128G vg0
mkfs.ext4 /dev/vg0/${DOMAIN_NAME}-home
 
# configure domU
vi /etc/xen/${DOMAIN_NAME}
(add)
'phy:/dev/vg0/mx-home,sda3,w'
 
# post config dom

Fileserver (Samba and DHCP)

#!/bin/bash
 
# set domU name
DOMAIN_NAME=srv
 
# install vm
xen-create-image --hostname=$DOMAIN_NAME --dhcp --mac=00:11:cc:ab:cd:ef \
--lvm=vg01 --dist=jaunty --mirror=http://archive.ubuntu.com/ubuntu/ --size=4Gb --memory=1Gb --swap=1Gb
 
# rename config file
mv /etc/xen/${DOMAIN_NAME}.cfg /etc/xen/${DOMAIN_NAME}
 
# add to autostart
ln -s /etc/xen/${DOMAIN_NAME} /etc/xen/auto
 
# create lvm for home
lvcreate --name ${DOMAIN_NAME}-media --size 200G vg01
mkfs.ext3 /dev/vg01/${DOMAIN_NAME}-media
 
# configure domU
vi /etc/xen/${DOMAIN_NAME}
(add)
'phy:/dev/vg01/srv-media,xvda3,

QEMU / KQEMU

create image
qemu-img create -f qcow2 xp.img 8G

install windows
qemu -hda xp.img -cdrom xppro.iso -boot d -net nic

run windows
qemu -hda xp.img -cdrom ../download/iso/xppro.iso -boot d -net nic -usb -usbdevice table

# optional
# test # -kernel-kqemu

Links
http://wiki.ubuntuusers.de/QEMU
http://qemu-buch.de/d/Netzwerkoptionen/_Netzwerkdienste/_PXE

Virtualization

# detect virtualization
dmesg | egrep -i 'xen|front'

Instal KVM (Kernel-based Virtual Machine)

script:
https://installit.googlecode.com/hg/install.kvm.sh
 
 
# configure locale
wget -q http://www.panticz.de/sites/default/files/scripts/configure_locale.sh -O - | bash -
 
# install on ubuntu
sudo apt install -y qemu-kvm
# apt-get install -y qemu kvm ubuntu-vm-builder
 
# install on debian
apt-get install -y kvm
apt-get install -y libvirt-bin
apt-get install -y virtinst
 
/etc/init.d/libvirt-bin restart
 
# net
virsh net-start default
virsh net-autostart default
 
# vg
mkdir /etc/libvirt/storage
cat <<EOF> /etc/libvirt/storage/vg0.xml
<pool type='logical'>
  <name>vg0</n

PCI Delegation in Xen (Xen Pci Passthrough)

#
# Debian 7
#
# add xen-pciback to initrd
echo "xen-pciback" >> /etc/modules
update-initramfs -u
 
# hide device (module and pciid have to be adapted)
cat <<EOF> /etc/modprobe.d/xen-pciback.conf 
install e100 modprobe xen-pciback; modprobe --first-time --ignore-install e100
options xen-pciback hide=(00:0c.0)
EOF
 
# test
xm pci-list-assignable-devices
 
# Links
http://wiki.xen.org/wiki/Assign_Hardware_to_DomU_with_PCIBack_as_module
http://debianforum.de/forum/viewtopic.php?f=32&t=139776
http://nixnote.blogspot.de/2012/03/xen-part-9-pci-passthrough.html
http://wiki.xen.org/wik

XEN ENDIAN

# delegate nic for endian domain
http://www.panticz.de/xen_pci_delegation
 
DOMAIN_NAME=fw
#URL=http://dfn.dl.sourceforge.net/sourceforge/efw/EFW-COMMUNITY-2.2-rc3-200810071617.iso
URL=http://download.sourceforge.net/sourceforge/efw/EFW-COMMUNITY-2.2-200905211506.iso
URL=http://download.sourceforge.net/sourceforge/efw/EFW-COMMUNITY-2.5.1-201201261800.iso
# test # http://netcologne.dl.sourceforge.net/project/efw/Development/EFW-2.4-RESPIN/EFW-COMMUNITY-2.4-201005280528-RESPIN.iso
 
# download endian
wget ${URL} -P /tmp
 
# create lvm image
lvcreate --name fw-disk --size 8G vg1
#loset
Syndicate content