This shows you the differences between two versions of the page.
xenvirtualmachines [2007/11/24 22:23] 127.0.0.1 external edit |
xenvirtualmachines [2020/02/13 22:55] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
- | ====== Xen Virtual Machines ====== | ||
- | < | ||
- | ====== Xen Server dom0 ====== | ||
- | You should create a partition a bit larger than the amount of ram allocated to domU guests. | ||
- | |||
- | < | ||
- | lvcreate --size 4.1g --name xen vg01 | ||
- | mkdir / | ||
- | </ | ||
- | And add to /etc/fstab | ||
- | |||
- | < | ||
- | / | ||
- | </ | ||
- | and mount | ||
- | |||
- | < | ||
- | mount / | ||
- | </ | ||
- | ====== Xen Client domU using debootstrap ====== | ||
- | Below ' | ||
- | |||
- | < | ||
- | lvcreate --size 1g -i 2 --name vm01-slash vg01 | ||
- | lvcreate --size 2g -i 2 --name vm01-swap vg01 | ||
- | lvcreate --size 2g -i 2 --name vm01-usr vg01 | ||
- | lvcreate --size 2g -i 2 --name vm01-var vg01 | ||
- | |||
- | mkfs.ext3 / | ||
- | mkswap / | ||
- | mkfs.reiserfs / | ||
- | mkfs.reiserfs / | ||
- | |||
- | mount / | ||
- | mkdir /mnt/usr /mnt/var | ||
- | mount / | ||
- | mount / | ||
- | |||
- | debootstrap --arch amd64 --include=reiserfsprogs, | ||
- | |||
- | cd /mnt | ||
- | cp /etc/hosts etc/ | ||
- | sed -i ' | ||
- | echo vm01 > etc/ | ||
- | cp / | ||
- | </ | ||
- | < | ||
- | |||
- | < | ||
- | # This file describes the network interfaces available on your system | ||
- | # and how to activate them. For more information, | ||
- | |||
- | # The loopback network interface | ||
- | auto lo | ||
- | iface lo inet loopback | ||
- | |||
- | # The primary network interface | ||
- | auto eth0 | ||
- | iface eth0 inet static | ||
- | address 1.2.3.4 | ||
- | netmask 255.255.255.0 | ||
- | gateway 1.2.3.1 | ||
- | </ | ||
- | < | ||
- | |||
- | < | ||
- | # /etc/fstab: static file system information. | ||
- | # | ||
- | # & | ||
- | proc /proc | ||
- | / | ||
- | /dev/sda3 /usr reiserfs defaults | ||
- | /dev/sda4 /var reiserfs noatime | ||
- | /dev/sda2 none swap sw 0 0 | ||
- | / | ||
- | </ | ||
- | < | ||
- | |||
- | < | ||
- | title | ||
- | root (hd0,0) | ||
- | kernel | ||
- | initrd | ||
- | |||
- | title | ||
- | root (hd0,0) | ||
- | kernel | ||
- | initrd | ||
- | </ | ||
- | < | ||
- | |||
- | < | ||
- | # Debian 5.0 | ||
- | memory = 1024 | ||
- | name = & | ||
- | bootloader = & | ||
- | disk = [ ' | ||
- | # Default bridged network interface | ||
- | vif = [ ' | ||
- | vcpus = 2 | ||
- | # Single-user mode | ||
- | #extra = & | ||
- | </ | ||
- | < | ||
- | umount /mnt/usr /mnt/var /mnt | ||
- | cd / | ||
- | ln -s ../vm01.cfg . | ||
- | xm create -c vm01.cfg | ||
- | </ | ||
- | After boot you need to: | ||
- | |||
- | < | ||
- | ====== Xen Client domU using netboot ====== | ||
- | This creates the LV with equal-sized stripes over a 2 drive Volume Group (Creates a raid0 LV for write performance). | ||
- | |||
- | < | ||
- | # lvcreate --size 10g -i 2 --name ubuntu14 vg01 | ||
- | Using default stripesize 64.00 KiB | ||
- | Logical volume & | ||
- | </ | ||
- | < | ||
- | mkdir / | ||
- | cd / | ||
- | wget -c http:// | ||
- | wget -c http:// | ||
- | </ | ||
- | < | ||
- | |||
- | < | ||
- | name = & | ||
- | |||
- | memory = 1024 | ||
- | vcpus = 4 | ||
- | |||
- | disk = [ ' | ||
- | vif = [ ' | ||
- | |||
- | kernel = & | ||
- | ramdisk = & | ||
- | extra = & | ||
- | </ | ||
- | Start the installer: | ||
- | |||
- | < | ||
- | xm create -c ubuntu14.cfg | ||
- | </ | ||
- | After the install, revise the cfg file to comment out the local kernel/ | ||
- | |||
- | < | ||
- | ... | ||
- | #kernel = & | ||
- | #ramdisk = & | ||
- | #extra = & | ||
- | bootloader = & | ||
- | </ | ||