Linux԰̳'s Archiver

daist 2007-12-11 14:55

Debian װʹ Xen

Debian  װʹ Xen
b:

1.ʂ 64 bit xen ĭh
apt-get install xen-linux-system-2.6.18-4-xen-686 xen-tools xen-docs-3.0 libc6-xen file xen-hypervisor-3.0.3-1-i386-pae bridge-utils
2.װ
apt-get install xen-linux-system-2.6.18-4-xen-vserver-686
3.޸On /etc/xen/xend-config.sxp
   (network-script network-dummy)
Ğ (network-script 'network-bridge netdev=eth0')
PS: netdev=eth0 ՈʹÌHʹõľW·
ex: ĽMW· ʹõW滥B tO netdev=eth2

͸ijnetdev=eth0


4.Mϵy_J xen support

Shell> uname -a
Linux debian 2.6.18-4-xen-amd64 #1 SMP Wed Feb 21 20:46:15 UTC 2007 i686
GNU/Linux
5.
localesen_US.ISO-8859-1ͬʱԭеen_US.UTF-8ӵen_US.ISO-8859-1Ϊ Default Locale/etc/environmentΪLANG="en_US"locale-genܻ޸ʱ
reboot
-----------------------------
6./etc/xen-tools/xen-tools.conf
--hostname daist2 \
--fs ext3 --dir /srv \
--dhcp \
--cache no
--dist etch \ֺʱ󣬽޸ΪsargeԣҸ˾ͺˣҲ֪Ϊʲô
--mirror [url]http://ftp.sjtu.edu.cn/debian[/url] \
--debootstrap \
--kernel /boot/vmlinuz-2.6.18-4-xen-vserver-686 \
--initrd /boot/initrd.img-2.6.18-4-xen-vserver-686
7.ܻᷢ󣬹Եģڵڰ˲ǰ˲裬ܶ϶û
ԣܲڻҲûŶ
LC_ALL=C;export LC_ALL ; LC_CTYPE=C ; export LC_CTYPE;
8.guest os :
xen-create-image --hostname    daist2  --dir=/home/xen --ip=192.168.18.109 --gateway=192.168.18.1 --netmask=255.255.255.0   --force  --image=full
ĵһ⣬һԣһǺǣ˵أ
Բ鿼/var/log/xen-tools/daist2.logٰװ
General Infomation

--------------------
Hostname       :  daist2
Distribution   :  sarge
Fileystem Type :  ext3

Size Information
----------------
Image size     :  4Gb
Swap size      :  128Mb
Image type     :  full
Memory size    :  128Mb
Kernel path    :  /boot/vmlinuz-2.6.18-4-xen-vserver-686
Initrd path    :  /boot/initrd.img-2.6.18-4-xen-vserver-686

Networking Information
----------------------
IP Address 1   : 192.168.18.109
Netmask        : 255.255.255.0
Gateway        : 192.168.18.1


Creating swap image: /home/xen/domains/daist2/swap.img
Done

Creating disk image: /home/xen/domains/daist2/disk.img
Done

Creating ext3 filesystem on /home/xen/domains/daist2/disk.img
Done

Installing your system with debootstrap mirror [url]http://ftp.sjtu.edu.cn/debian/[/url]
Done

Running hooks
Done

No role script specified.  Skipping

Creating Xen configuration file
Done
All done


Logfile produced at:
         /var/log/xen-tools/daist2.log

--------------------------------------------------------------
9.鿴
vi  /var/log/xen-tools/daist2.log
General Infomation
--------------------
Hostname       :  daist2
Distribution   :  sarge
Fileystem Type :  ext3

Size Information
----------------
Image size     :  4Gb
Swap size      :  128Mb
Image type     :  full
Memory size    :  128Mb
Kernel path    :  /boot/vmlinuz-2.6.18-4-xen-vserver-686
Initrd path    :  /boot/initrd.img-2.6.18-4-xen-vserver-686

Networking Information
----------------------
IP Address 1   : 192.168.18.109
Netmask        : 255.255.255.0
Gateway        : 192.168.18.1

Creating swap image: /home/xen/domains/daist2/swap.img
128+0 records in
128+0 records out
134217728 bytes (134 MB) copied, 0.551814 seconds, 243 MB/s
Done
#пܴ˴˵ҲļǺǣͨMKDIRһ /home/xen/domains/daist2/
Creating disk image: /home/xen/domains/daist2/disk.img
1024+0 records in
1024+0 records out
4294967296 bytes (4.3 GB) copied, 82.3343 seconds, 52.2 MB/s
Done
Creating ext3 filesystem on /home/xen/domains/daist2/disk.img
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
524288 inodes, 1048576 blocks
52428 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1073741824
32 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables:  0/32^H^H^H^H^H 1/32^H^H^H^H^H 2/32^H^H^H^H^H 3/32^H^H^H^H^H 4/32^H^H^H^H^H 5/32^H^H^H^H^H 6/32^H^H^H^H^H 7/32^H^H^H^H^H 8/32^H^H^H^H^H 9/32^H^H^H^H^H10/32^H^H^H^H^H11/32^H^H^H^H^H12/32^H^H^H^H^H13/32^H^H^H^H^H14/32^H^H^H^H^H15/32^H^H^H^H^H16/32^H^H^H^H^H17/32^H^H^H^H^H18/32^H^H^H^H^H19/32^H^H^H^H^H20/32^H^H^H^H^H21/32^H^H^H^H^H22/32^H^H^H^H^H23/32^H^H^H^H^H24/32^H^H^H^H^H25/32^H^H^H^H^H26/32^H^H^H^H^H27/32^H^H^H^H^H28/32^H^H^H^H^H29/32^H^H^H^H^H30/32^H^H^H^H^H31/32^H^H^H^H^Hdone
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
Done
Setting up swapspace version 1, size = 134213 kB
no label, UUID=af4e8c6b-896b-46f0-8d4b-7e9112f7a23f
Installing your system with debootstrap mirror [url]http://ftp.sjtu.edu.cn/debian/[/url]
I: Retrieving Release
.......
I: Unpacking required packages...
I: Configuring required packages...
I: Installing base packages...
I: Base system installed successfully.
Done

Running hooks
Running hook 15-disable-hwclock
hook 15-disable-hwclock: done.
Running hook 20-setup-apt
Hit [url]http://ftp.sjtu.edu.cn[/url] sarge/main Packages
Get:1 [url]http://ftp.sjtu.edu.cn[/url] sarge/main Release [98B]
Get:2 [url]http://ftp.sjtu.edu.cn[/url] sarge/contrib Packages [74.0kB]
Get:3 [url]http://ftp.sjtu.edu.cn[/url] sarge/contrib Release [101B]
Get:4 [url]http://ftp.sjtu.edu.cn[/url] sarge/non-free Packages [76.6kB]

Get:22 [url]http://security.debian.org[/url] stable/updates/non-free Sources [20B]
Get:23 [url]http://security.debian.org[/url] stable/updates/non-free Release [103B]
Fetched 1791kB in 2m4s (14.4kB/s)
Reading Package Lists...
hook 20-setup-apt: done.
Running hook 25-disable-tls
hook 25-disable-tls: done.
Running hook 30-fix-inittab
hook 30-fix-inittab: done.
Running hook 35-setup-users
hook 35-setup-users: done.
Running hook 40-setup-networking
hook 40-setup-networking: done.
Running hook 50-setup-hostname
hook 50-setup-hostname: done.
Running hook 55-create-dev
hook 55-create-dev: done.
Running hook 60-copy-host-files
Reading Package Lists...
Building Dependency Tree...
The following NEW packages will be installed:
  sudo
0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
Need to get 161kB of archives.
After unpacking 397kB of additional disk space will be used.
Get:1 [url]http://ftp.sjtu.edu.cn[/url] sarge/main sudo 1.6.8p7-1.4 [161kB]
Fetched 161kB in 0s (726kB/s)
Selecting previously deselected package sudo.
(Reading database ... 7623 files and directories currently installed.)
Unpacking sudo (from .../sudo_1.6.8p7-1.4_i386.deb) ...
Setting up sudo (1.6.8p7-1.4) ...
hook 60-copy-host-files: done.
Running hook 65-copy-user-files
hook 65-copy-user-files: done.
Running hook 70-install-ssh
Reading Package Lists...
Building Dependency Tree...
Suggested packages:
  ssh-askpass xbase-clients
The following NEW packages will be installed:
  ssh
0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
Need to get 689kB of archives.
After unpacking 1696kB of additional disk space will be used.
Get:1 [url]http://ftp.sjtu.edu.cn[/url] sarge/main ssh 1:3.8.1p1-8.sarge.6 [689kB]
Preconfiguring packages ...
Fetched 689kB in 0s (2926kB/s)
Selecting previously deselected package ssh.
(Reading database ... 7648 files and directories currently installed.)
Unpacking ssh (from .../ssh_1%3a3.8.1p1-8.sarge.6_i386.deb) ...
Setting up ssh (3.8.1p1-8.sarge.6) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Restarting OpenBSD Secure Shell server: sshd.

Stopping OpenBSD Secure Shell server: sshd.
hook 70-install-ssh: done.
Running hook 80-install-modules
Reading Package Lists...
Building Dependency Tree...
The following NEW packages will be installed:
  module-init-tools
0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
Need to get 73.1kB of archives.
After unpacking 299kB of additional disk space will be used.
Get:1 [url]http://ftp.sjtu.edu.cn[/url] sarge/main module-init-tools 3.2-pre1-2 [73.1kB]
Fetched 73.1kB in 0s (870kB/s)
Selecting previously deselected package module-init-tools.
(Reading database ... 7691 files and directories currently installed.)
Unpacking module-init-tools (from .../module-init-tools_3.2-pre1-2_i386.deb) ...Setting up module-init-tools (3.2-pre1-2) ...
hook 80-install-modules: done.
Running hook 90-make-fstab
hook 90-make-fstab: done.
Running hook 99-clean-image
hook 99-clean-image: done.
Done

No role script specified.  Skipping

Creating Xen configuration file
Done
All done
-------------------------------------------
10.OKǿ
11.IJ/etc/xen/ԶӦļļΪhostname.cfgӾtestvm01.cfgԸҪиĴļ
12.rebootµĺаɣҽԭϵͳΪһֱˣʹ࣡
13. guest OS
Shell> xm create daist2

4.2 ^ цõ guest OS
Shell> xm list

4.3 P]цõ guest OS
ʽһ
Shell> xm shutdown etch.example.com

ʽ
Shell> xm destroy etch.example.com

һͬһPCµ poweroff
늻ԴДֱԴ˼

4.4 guest OS
Shell> xm console etch.example.com

4.5 guest OS
ctrl + ]

ҳ: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.