Blog Code Forum

Xen

From Wiki.cyring.fr

(Difference between revisions)
Jump to: navigation, search
(Installation)
Line 1: Line 1:
-
==== Partition ====
+
==== File System ====
-
<syntaxhighlight lang="bash">
+
===== Partition =====
-
# fdisk /dev/sda
+
<syntaxhighlight lang="bash" line start="1">
 +
fdisk /dev/sda
</syntaxhighlight>
</syntaxhighlight>
<pre>
<pre>
n 3 [enter] +6G
n 3 [enter] +6G
</pre>
</pre>
-
==== Format ====
+
===== Format =====
-
<syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash" line start="2">
-
# mkfs.ext4 -E discard -L DEBIAN /dev/sda3
+
mkfs.ext4 -E discard -L DEBIAN /dev/sda3
-
# mount /dev/disk/by-label/DEBIAN /mnt
+
mount /dev/disk/by-label/DEBIAN /mnt
</syntaxhighlight>
</syntaxhighlight>
==== Installing Debian ====
==== Installing Debian ====
-
<syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash" line start="1">
-
# pacman -S debootstrap
+
pacman -S debootstrap
-
# debootstrap --arch ARCH wheezy /mnt http://ftp.fr.debian.org/debian
+
debootstrap --arch=amd64 wheezy /mnt http://ftp.fr.debian.org/debian
-
# LANG=C chroot /mnt /bin/bash
+
LANG=C chroot /mnt /bin/bash
-
# export TERM=xterm-color
+
export TERM=xterm-color
-
# cd /dev
+
cd /dev
-
# MAKEDEV generic
+
MAKEDEV generic
</syntaxhighlight>
</syntaxhighlight>
-
 
==== Configuration ====
==== Configuration ====
-
===== File Systems =====
+
===== Mounted FS =====
-
<syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash" line start="1">
-
# nano /etc/fstab
+
nano /etc/fstab
</syntaxhighlight>
</syntaxhighlight>
<pre>
<pre>
Line 39: Line 39:
</pre>
</pre>
===== Network =====
===== Network =====
-
<syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash" line start="1">
-
# nano /etc/network/interfaces
+
nano /etc/network/interfaces
</syntaxhighlight>
</syntaxhighlight>
<pre>
<pre>
Line 58: Line 58:
     gateway 192.168.1.1
     gateway 192.168.1.1
</pre>
</pre>
-
<syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash" line start="2">
-
# nano /etc/resolv.conf
+
nano /etc/resolv.conf
</syntaxhighlight>
</syntaxhighlight>
<pre>
<pre>
nameserver 192.168.1.1
nameserver 192.168.1.1
</pre>
</pre>
-
<syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash" line start="3">
-
# echo XEN > /etc/hostname
+
echo XEN > /etc/hostname
-
# nano /etc/hosts
+
nano /etc/hosts
</syntaxhighlight>
</syntaxhighlight>
<pre>
<pre>
Line 73: Line 73:
</pre>
</pre>
===== Kernel =====
===== Kernel =====
-
<syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash" line start="1">
-
# nano /etc/modprobe.d/blacklist.conf
+
nano /etc/modprobe.d/blacklist.conf
</syntaxhighlight>
</syntaxhighlight>
<pre>
<pre>
Line 83: Line 83:
==== Packages ====
==== Packages ====
===== Debian =====
===== Debian =====
-
<syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash" line start="1">
-
# nano /etc/apt/sources.list
+
nano /etc/apt/sources.list
</syntaxhighlight>
</syntaxhighlight>
<pre>
<pre>
Line 90: Line 90:
</pre>
</pre>
===== Localization =====
===== Localization =====
-
<syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash" line start="1">
-
# aptitude update
+
aptitude update
-
# aptitude install locales
+
aptitude install locales
-
# dpkg-reconfigure locales
+
dpkg-reconfigure locales
-
# aptitude install console-data
+
aptitude install console-data
-
# dpkg-reconfigure console-data
+
dpkg-reconfigure console-data
-
# aptitude install xen-linux-system-amd64
+
aptitude install xen-linux-system-amd64
</syntaxhighlight>
</syntaxhighlight>
===== XEN =====
===== XEN =====
-
<syntaxhighlight lang="bash">
+
<syntaxhighlight lang="bash" line start="1">
-
# exit
+
exit
-
# ln -s /usr/lib/syslinux/mboot.c32 /boot/syslinux/mboot.c32
+
ln -s /usr/lib/syslinux/mboot.c32 /boot/syslinux/mboot.c32
-
# mkdir /boot/Debian
+
mkdir /boot/Debian
-
# cp /mnt/boot/xen-4.1-amd64.gz /boot/Debian/
+
cp /mnt/boot/xen-4.1-amd64.gz /boot/Debian/
-
# cp /mnt/boot/vmlinuz-3.2.0-3-amd64 /boot/Debian/
+
cp /mnt/boot/vmlinuz-3.2.0-3-amd64 /boot/Debian/
-
# cp /mnt/boot/initrd.img-3.2.0-3-amd64 /boot/Debian/
+
cp /mnt/boot/initrd.img-3.2.0-3-amd64 /boot/Debian/
-
# ln -s /boot/Debian/xen-4.1-amd64.gz /boot/Debian/xen.gz
+
ln -s /boot/Debian/xen-4.1-amd64.gz /boot/Debian/xen.gz
-
# ln -s /boot/Debian/vmlinuz-3.2.0-3-amd64 /boot/Debian/vmlinuz
+
ln -s /boot/Debian/vmlinuz-3.2.0-3-amd64 /boot/Debian/vmlinuz
-
# ln -s /boot/Debian/vmlinuz-3.2.0-3-amd64 /boot/Debian/initrd.img
+
ln -s /boot/Debian/vmlinuz-3.2.0-3-amd64 /boot/Debian/initrd.img
-
# nano /boot/syslinux/syslinux.cfg
+
nano /boot/syslinux/syslinux.cfg
</syntaxhighlight>
</syntaxhighlight>
==== Boot Manager ====
==== Boot Manager ====

Revision as of 13:57, 20 October 2012

Contents

File System

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

Installing Debian

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

Configuration

Mounted FS
  1. nano /etc/fstab
# /etc/fstab
#
# <file system> <dir>    <type> <options>                           <dump> <pass>
/dev/sda3       /        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

Debian
  1. nano /etc/apt/sources.list
deb http://ftp.fr.debian.org/debian wheezy main non-free
Localization
  1. aptitude update
  2. aptitude install locales
  3. dpkg-reconfigure locales
  4. aptitude install console-data
  5. dpkg-reconfigure console-data
  6. aptitude install xen-linux-system-amd64
XEN
  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
  10. nano /boot/syslinux/syslinux.cfg

Boot Manager

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 nmi_watchdog=0 vga=0 --- ../Debian/initrd.img
Personal tools