| 1 | [[PageOutline]] |
| 2 | {{{ |
| 3 | #!html |
| 4 | <h1 style="text-align: center; color: blue">Xen 4.0.1_rc6 on Debian 6.0 Squeeze</h1> |
| 5 | }}} |
| 6 | |
| 7 | = 【Step 1: 安裝 Xen Hypervisor和 Xen-patched Kernel】 = |
| 8 | * 在 Debian Squeeze Testing 版本上快速安裝 Xen-4.0.1 Hypervisor & Xen patched kernel - 2.6.32-5 |
| 9 | {{{ |
| 10 | $ sudo apt-get update |
| 11 | $ sudo apt-get install xen-linux-system-2.6.32-5-xen-amd64 |
| 12 | }}} |
| 13 | ---- |
| 14 | = 【Step 2: 編輯 Xend 設定檔 & 開機選單】 = |
| 15 | * 編輯 xend 的設定檔 /etc/xen/xend-config.sxp |
| 16 | {{{ |
| 17 | $ sudo su |
| 18 | # echo HWCLOCKACCESS=no >>/etc/default/rcS |
| 19 | # echo loop max_loop=100 >> /etc/modules |
| 20 | # echo blktap >> /etc/modules |
| 21 | [CTRL+D] |
| 22 | $ sudo vim /etc/xen/xend-config.sxp |
| 23 | }}} |
| 24 | {{{ |
| 25 | #!sh |
| 26 | 60 (xend-http-server yes) |
| 27 | 61 (xend-unix-server yes) |
| 28 | 62 (xend-tcp-xmlrpc-server yes) |
| 29 | 64 (xend-relocation-server yes) |
| 30 | 68 (xend-unix-path /var/lib/xend/xend-socket) |
| 31 | |
| 32 | 74 (xen-tcp-xmlrpc-server-port 8006) |
| 33 | 84 (xend-port 8000) |
| 34 | 88 (xend-relocation-port 8002) |
| 35 | 107 (xend-address localhost) |
| 36 | 125 (xend-relocation-hosts-allow '') |
| 37 | |
| 38 | 149 (network-script 'network-bridge netdev=eth1') |
| 39 | }}} |
| 40 | * 編輯 boot menu |
| 41 | {{{ |
| 42 | $ sudo vim /boot/grub/grub.cfg |
| 43 | menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-xen-amd64' --class debian --class gnu-linux --class gnu --class os { |
| 44 | insmod part_msdos |
| 45 | insmod ext2 |
| 46 | set root='(hd0,msdos1)' |
| 47 | search --no-floppy --fs-uuid --set 5b161b4b-e438-4827-8227-4396d26acfe0 |
| 48 | echo 'Loading Linux 2.6.32-5-xen-amd64 ...' |
| 49 | multiboot (hd0,1)/boot/xen-4.0-amd64.gz |
| 50 | module /boot/vmlinuz-2.6.32-5-xen-amd64 root=UUID=5b161b4b-e438-4827-8227-4396d26acfe0 ro quiet |
| 51 | echo 'Loading initial ramdisk ...' |
| 52 | module /boot/initrd.img-2.6.32-5-xen-amd64 |
| 53 | } |
| 54 | }}} |
| 55 | * 重開機 |
| 56 | {{{ |
| 57 | $ sync ; sudo reboot |
| 58 | }}} |
| 59 | = 【Step 3: 安裝 Xen image 製作工具】 = |
| 60 | * 安裝 xen-tools |
| 61 | {{{ |
| 62 | $ sudo apt-get install xen-tools |
| 63 | }}} |
| 64 | * 編輯 xen-tools 的設定檔 |
| 65 | {{{ |
| 66 | $ sudo vim /etc/xen-tools/xen-tools.conf |
| 67 | }}} |
| 68 | {{{ |
| 69 | #!sh |
| 70 | 45 dir = /home |
| 71 | 83 install-method = debootstrap |
| 72 | 128 size = 2Gb # Disk image size. |
| 73 | 129 memory = 128Mb # Memory size |
| 74 | 130 swap = 128Mb # Swap size |
| 75 | 132 fs = ext3 # use the EXT3 filesystem for the disk image. |
| 76 | 133 dist = lucid # Default distribution to install. |
| 77 | 134 image = sparse # Specify sparse vs. full disk images. |
| 78 | |
| 79 | |
| 80 | 163 gateway = 192.168.1.254 |
| 81 | 164 netmask = 255.255.255.0 |
| 82 | 165 broadcast = 192.168.1.255 |
| 83 | |
| 84 | 233 passwd = 1 |
| 85 | 261 mirror = http://archive.ubuntu.com/ubuntu |
| 86 | 313 serial_device = hvc0 |
| 87 | 331 output = /home/domains |
| 88 | }}} |
| 89 | = 【Step 4: Xen Information Check】 = |
| 90 | $ sudo xm info |
| 91 | {{{ |
| 92 | host : VMserver |
| 93 | release : 2.6.32-5-xen-amd64 |
| 94 | version : #1 SMP Thu Aug 12 15:17:50 UTC 2010 |
| 95 | machine : x86_64 |
| 96 | nr_cpus : 4 |
| 97 | nr_nodes : 1 |
| 98 | cores_per_socket : 4 |
| 99 | threads_per_core : 1 |
| 100 | cpu_mhz : 2826 |
| 101 | hw_caps : bfebfbff:20100800:00000000:00000940:0408e3fd:00000000:00000001:00000000 |
| 102 | virt_caps : hvm hvm_directio |
| 103 | total_memory : 8025 |
| 104 | free_memory : 1509 |
| 105 | node_to_cpu : node0:0-3 |
| 106 | node_to_memory : node0:1509 |
| 107 | node_to_dma32_mem : node0:813 |
| 108 | max_node_id : 0 |
| 109 | xen_major : 4 |
| 110 | xen_minor : 0 |
| 111 | xen_extra : .1-rc6 |
| 112 | xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 |
| 113 | xen_scheduler : credit |
| 114 | xen_pagesize : 4096 |
| 115 | platform_params : virt_start=0xffff800000000000 |
| 116 | xen_changeset : unavailable |
| 117 | xen_commandline : |
| 118 | cc_compiler : gcc version 4.4.5 20100816 (prerelease) (Debian 4.4.4-9) |
| 119 | cc_compile_by : waldi |
| 120 | cc_compile_domain : debian.org |
| 121 | cc_compile_date : Tue Aug 17 21:17:33 UTC 2010 |
| 122 | xend_config_format : 4 |
| 123 | }}} |