Blog Code Forum

Xen

From Wiki.cyring.fr

(Difference between revisions)
Jump to: navigation, search
(SysLinux)
Line 1: Line 1:
 +
=== Installation ===
==== Initialization ====
==== Initialization ====
 +
ie. using our free partition number 3 formatted with a 6 GB Ext4 file system
===== Partitioning =====
===== Partitioning =====
<syntaxhighlight lang="bash" line start="1">
<syntaxhighlight lang="bash" line start="1">
Line 14: Line 16:
</syntaxhighlight>
</syntaxhighlight>
-
==== Installation ====
+
==== Requirements ====
-
===== Requirements =====
+
<syntaxhighlight lang="bash" line start="1">
<syntaxhighlight lang="bash" line start="1">
pacman -S abs
pacman -S abs
Line 24: Line 25:
wget https://aur.archlinux.org/packages/de/debootstrap/PKGBUILD
wget https://aur.archlinux.org/packages/de/debootstrap/PKGBUILD
makepkg -s
makepkg -s
-
pacman -U debootstrap-1.0.42-3.tar.xz
+
pacman -U debootstrap*
</syntaxhighlight>
</syntaxhighlight>
-
===== Debian =====
+
==== Debian ====
<syntaxhighlight lang="bash" line start="1">
<syntaxhighlight lang="bash" line start="1">
debootstrap --arch=amd64 wheezy /mnt http://ftp.fr.debian.org/debian
debootstrap --arch=amd64 wheezy /mnt http://ftp.fr.debian.org/debian
Line 35: Line 36:
</syntaxhighlight>
</syntaxhighlight>
-
==== Configuration ====
+
=== Configuration ===
-
===== File System =====
+
==== File System ====
<syntaxhighlight lang="bash" line start="1">
<syntaxhighlight lang="bash" line start="1">
nano /etc/fstab
nano /etc/fstab
Line 52: Line 53:
tmpfs                    /var/log tmpfs  size=64M                            0      0
tmpfs                    /var/log tmpfs  size=64M                            0      0
</pre>
</pre>
-
===== Network =====
+
==== Network ====
<syntaxhighlight lang="bash" line start="1">
<syntaxhighlight lang="bash" line start="1">
nano /etc/network/interfaces
nano /etc/network/interfaces
Line 86: Line 87:
127.0.0.1 XEN
127.0.0.1 XEN
</pre>
</pre>
-
===== Kernel =====
+
==== Kernel ====
<syntaxhighlight lang="bash" line start="1">
<syntaxhighlight lang="bash" line start="1">
nano /etc/modprobe.d/blacklist.conf
nano /etc/modprobe.d/blacklist.conf
Line 95: Line 96:
blacklist bluetooth
blacklist bluetooth
</pre>
</pre>
-
===== Packages =====
+
==== Packages ====
<syntaxhighlight lang="bash" line start="1">
<syntaxhighlight lang="bash" line start="1">
nano /etc/apt/sources.list
nano /etc/apt/sources.list
Line 105: Line 106:
aptitude update
aptitude update
</syntaxhighlight>
</syntaxhighlight>
-
===== Localization =====
+
==== Localization ====
<syntaxhighlight lang="bash" line start="1">
<syntaxhighlight lang="bash" line start="1">
aptitude install locales
aptitude install locales
Line 112: Line 113:
dpkg-reconfigure console-data
dpkg-reconfigure console-data
</syntaxhighlight>
</syntaxhighlight>
-
==== XEN ====
+
=== XEN ===
-
===== Deployment =====
+
==== Deployment ====
<syntaxhighlight lang="bash" line start="1">
<syntaxhighlight lang="bash" line start="1">
aptitude install xen-linux-system-amd64
aptitude install xen-linux-system-amd64

Revision as of 09:10, 21 October 2012

Contents

Installation

Initialization

ie. using our free partition number 3 formatted with a 6 GB Ext4 file system

Partitioning
  1. fdisk /dev/sda
n 3 [enter] +6G
Formatting
  1. mkfs.ext4 -E discard -L DEBIAN /dev/sda3
  2. mount /dev/disk/by-label/DEBIAN /mnt

Requirements

  1. pacman -S abs
  2. pacman -S base-devel
  3. abs
  4. mkdir /tmp/debootstrap
  5. cd /tmp/debootstrap
  6. wget https://aur.archlinux.org/packages/de/debootstrap/PKGBUILD
  7. makepkg -s
  8. pacman -U debootstrap*

Debian

  1. debootstrap --arch=amd64 wheezy /mnt http://ftp.fr.debian.org/debian
  2. LANG=C chroot /mnt /bin/bash
  3. export TERM=xterm-color
  4. cd /dev
  5. MAKEDEV generic

Configuration

File System

  1. nano /etc/fstab
# /etc/fstab
#
# <file system>           <dir>    <type> <options>                           <dump> <pass>
/dev/disk/by-label/DEBIAN /        ext4   discard,noatime,nodiratime,defaults 0      1

proc                      /proc    proc   defaults                            0      0
devpts                    /dev/pts devpts defaults                            0      0
shm                       /dev/shm tmpfs  nodev,nosuid                        0      0
tmpfs                     /tmp     tmpfs  size=2048M                          0      0
tmpfs                     /var/log tmpfs  size=64M                            0      0

Network

  1. nano /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
    address 192.168.1.101
    network 192.168.1.0
    netmask 255.255.255.0
    gateway 192.168.1.1
iface br0 inet static
    bridge_ports none
    address 192.168.1.199
    broadcast 192.168.1.255
    netmask 255.255.255.0
    gateway 192.168.1.1
  1. nano /etc/resolv.conf
nameserver 192.168.1.1
  1. echo XEN > /etc/hostname
  2. nano /etc/hosts
127.0.0.1	localhost
127.0.0.1	XEN

Kernel

  1. nano /etc/modprobe.d/blacklist.conf
blacklist pcspkr
blacklist acpi_cpufreq
blacklist bluetooth

Packages

  1. nano /etc/apt/sources.list
deb http://ftp.fr.debian.org/debian wheezy main non-free
  1. aptitude update

Localization

  1. aptitude install locales
  2. dpkg-reconfigure locales
  3. aptitude install console-data
  4. dpkg-reconfigure console-data

XEN

Deployment

  1. aptitude install xen-linux-system-amd64

Boot Manager

Files
  1. exit
  2. ln -s /usr/lib/syslinux/mboot.c32 /boot/syslinux/mboot.c32
  3. mkdir /boot/Debian
  4. cp /mnt/boot/xen-4.1-amd64.gz /boot/Debian/
  5. cp /mnt/boot/vmlinuz-3.2.0-3-amd64 /boot/Debian/
  6. cp /mnt/boot/initrd.img-3.2.0-3-amd64 /boot/Debian/
  7. ln -s /boot/Debian/xen-4.1-amd64.gz /boot/Debian/xen.gz
  8. ln -s /boot/Debian/vmlinuz-3.2.0-3-amd64 /boot/Debian/vmlinuz
  9. ln -s /boot/Debian/vmlinuz-3.2.0-3-amd64 /boot/Debian/initrd.img
SysLinux
  1. nano /boot/syslinux/syslinux.cfg
LABEL debian
	MENU LABEL De^bian Linux
	LINUX ../Debian/vmlinuz
	APPEND root=/dev/sda3 ro quiet elevator=noop nmi_watchdog=0 vga=0
	INITRD ../Debian/initrd.img

LABEL xen
	MENU LABEL Debian ^Xen
	KERNEL mboot.c32
	APPEND ../Debian/xen.gz --- ../Debian/vmlinuz root=/dev/sda3 ro quiet elevator=noop --- ../Debian/initrd.img
  1. shutdown -r now
Personal tools