カスタム検索
このエントリーをはてなブックマークに追加
tomo.gif (1144 ツバツイツト)line.gif (927 ツバツイツト)line.gif (927 ツバツイツト)line.gif (927 ツバツイツト)To previous pageTo home pageMailing to me

CentOS5でXenを動かしてみる

Modified: 6 May 2007


ドメイン0(ホストOS)の確認 (6 May 2007)
ゲストOSのインストール (6 May 2007)


 ドメイン0(ホストOS)の確認 

 CentOS5のインストール時に、Xenを有効にする設定で行えば、インストールされ、設定され、ドメイン0も起動しています。

ドメイン0の起動確認

# /usr/sbin/xm list
Name                                      ID Mem(MiB) VCPUs State   Time(s)
Domain-0                                   0      366     1 r-----    427.6
# 


Xenのカーネルかどうかを調べる

"grub.conf"を見れば、Xenのカーネルで起動することがわかります。

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-8.el5xen)
        root (hd0,0)
        kernel /xen.gz-2.6.18-8.el5 
        module /vmlinuz-2.6.18-8.el5xen ro root=/dev/VolGroup00/LogVol00
        module /initrd-2.6.18-8.el5xen.img

 ゲストOSのインストール 

ゲストOS用のリソースの割付

# /usr/sbin/virt-install --nographics
 What is the name of your virtual machine? centos5v1
 How much RAM should be allocated (in megabytes)? 128
 What would you like to use as the disk (path)? /var/lib/xen/images/centos5v1.img
 How large would you like the disk (/var/lib/xen/images/centos5v1.img) to be (in gigabytes)? 4
 What is the install location?  http://ftp.riken.jp/Linux/centos/5/os/i386/
 

Starting install...

日本語を選択します。

Welcome to CentOS                                                               
                                                                                
                   +---------+ Choose a Language +---------+                    
                   |                                       |                    
                   | What language would you like to use   |                    
                   | during the installation process?      |                    
                   |                                       |                    
                   |       Gujarati               ^        |                    
                   |       Hindi                  :        |                    
                   |       Hungarian              :        |                    
                   |       Icelandic              #        |                    
                   |       Indonesian             :        |                    
                   |       Italian                :        |                    
                   |       Japanese               :        |                    
                   |       Kannada                v        |                    
                   |                                       |                    
                   |                +----+                 |                    
                   |                | OK |                 |                    
                   |                +----+                 |                    
                   |                                       |                    
                   |                                       |                    
                   +---------------------------------------+                    
                                                                                
  <Tab>/<Alt-Tab> between elements  | <Space> selects | <F12> next screen      

IPアドレスをマニュアルで設定する指定にし、IPv6は、Enableにしません。


             +----------------+ Configure TCP/IP +----------------+             
             |                                                    |             
             | [*] Enable IPv4 support                            |             
             |        ( ) Dynamic IP configuration (DHCP)         |             
             |        (*) Manual configuration                    |             
             |                                                    |             
             | [ ] Enable IPv6 support                            |             
             |        (*) Automatic neighbor discovery (RFC 2461) |             
             |        ( ) Dynamic IP configuration (DHCP)         |             
             |        ( ) Manual configuration                    |             
             |                                                    |             
             |          +----+                  +------+          |             
             |          | OK |                  | Back |          |             
             |          +----+                  +------+          |             
             |                                                    |             
             |                                                    |             
             +----------------------------------------------------+             

ネットワークの設定をします。

                                                                                
         +--------------+ Manual TCP/IP Configuration +---------------+         
         |                                                            |         
         | Enter the IPv4 and/or the IPv6 address and prefix          |         
         | (address / prefix).  For IPv4, the dotted-quad netmask     |         
         | or the CIDR-style prefix are acceptable. The gateway and   |         
         | name server fields must be valid IPv4 or IPv6 addresses.   |         
         |                                                            |         
         | IPv4 address: 192.168.0.241___ / 255.255.255.0___          |         
         | Gateway:      192.168.0.193____________________________    |         
         | Name Server:  192.168.0.11_____________________________    |         
         |                                                            |         
         |            +----+                      +------+            |         
         |            | OK |                      | Back |            |         
         |            +----+                      +------+            |         
         |                                                            |         
         |                                                            |         
         +------------------------------------------------------------+         


パッケージのダウンロード

パッケージのダウンロードが始まります。

以下のメッセージのあとしばらく時間がかかります。


Running anaconda, the CentOS system installer - please wait...                 

日本語が表示できないそうです。

                                                                                    
                                                                            
             +--------------+ Language Unavailable +--------------+             
             |                                                    |             
             | ja_JP.UTF-8 display is unavailable in text mode.   |             
             | The installation will continue in English.         |             
             |                                                    |             
             |                      +----+                        |             
             |                      | OK |                        |             
             |                      +----+                        |             
             |                                                    |             
             |                                                    |             
             +----------------------------------------------------+             


インストールの開始

インストールの開始です。


               +------------------+ CentOS +-------------------+                
               |                                               |                
               | Welcome to CentOS!                            |                
               |                                               |                
               |                                               |                
               |                    +----+                     |                
               |                    | OK |                     |                
               |                    +----+                     |                
               |                                               |                
               |                                               |                
               +-----------------------------------------------+                

「HDDが消えます」と出ますが、もちろんゲストOSのHDDの内容のことですから、Yesで進みます。


                +-----------------+ Warning +-----------------+                 
                |                                             |                 
                | The partition table on device xvda was      |                 
                | unreadable. To create new partitions it     |                 
                | must be initialized, causing the loss of    |                 
                | ALL DATA on this drive.                     |                 
                |                                             |                 
                | This operation will override any previous   |                 
                | installation choices about which drives     |                 
                | to ignore.                                  |                 
                |                                             |                 
                | Would you like to initialize this drive,    |                 
                | erasing ALL DATA?                           |                 
                |                                             |                 
                |        +-----+               +----+         |                 
                |        | Yes |               | No |         |                 
                |        +-----+               +----+         |                 
                |                                             |                 
                |                                             |                 
                +---------------------------------------------+                 

デフォルトでいいので、OKで進みます。


   +-------------------------+ Partitioning Type +-------------------------+    
   |                                                                       |    
   |    Installation requires partitioning of your hard drive.  The        |    
   |    default layout is reasonable for most users.  You can either       |    
   |    choose to use this or create your own.                             |    
   |                                                                       |    
   | Remove all partitions on selected drives and create default layout.   |    
   | Remove linux partitions on selected drives and create default layout. |    
   | Use free space on selected drives and create default layout.          |    
   | Create custom layout.                                                 |    
   |                                                                       |    
   |       Which drive(s) do you want to use for this installation?        |    
   |                              [*] xvda ^                               |    
   |                                       #                               |    
   |                                                                       |    
   |                          +----+   +------+                            |    
   |                          | OK |   | Back |                            |    
   |                          +----+   +------+                            |    
   |                                                                       |    
   |                                                                       |    
   +-----------------------------------------------------------------------+    

「HDDが消えます」と再度出ますが、Yesで進みます。

                    +-------------+ Warning +-------------+                     
                    |                                     |                     
                    | You have chosen to remove all       |                     
                    | Linux partitions (and ALL DATA on   |                     
                    | them) on the following drives:      |                     
                    |                                     |                     
                    | /dev/xvda                           |                     
                    |                                     |                     
                    | Are you sure you want to do this?   |                     
                    |                                     |                     
                    |      +----+           +-----+       |                     
                    |      | No |           | Yes |       |                     
                    |      +----+           +-----+       |                     
                    |                                     |                     
                    |                                     |                     
                    +-------------------------------------+                     

Yesで一応内容を確認します。


                  +-------+ Review Partition Layout +-------+                   
                  |                                         |                   
                  | Review and modify partitioning layout?  |                   
                  |                                         |                   
                  |       +-----+             +----+        |                   
                  |       | Yes |             | No |        |                   
                  |       +-----+             +----+        |                   
                  |                                         |                   
                  |                                         |                   
                  +-----------------------------------------+                   

確認できたら、OKですすみます。


   +----------------------------+ Partitioning +----------------------------+   
   |                                                                        |   
   |      Device        Start    End     Size       Type     Mount Point    |   
   | VG VolGroup00                        8064M  VolGroup                 ^ |   
   | LV LogVol01                           288M  swap                     # |   
   | LV LogVol00                          7776M  ext3        /            : |   
   | /dev/xvda                                                            : |   
   |   xvda1                 1      13     101M  ext3        /boot        : |   
   |   xvda2                14    1044    8087M  physical v               : |   
   |                                                                      : |   
   |                                                                      : |   
   |                                                                      : |   
   |                                                                      v |   
   |                                                                        |   
   |    +-----+   +------+   +--------+   +------+   +----+   +------+      |   
   |    | New |   | Edit |   | Delete |   | RAID |   | OK |   | Back |      |   
   |    +-----+   +------+   +--------+   +------+   +----+   +------+      |   
   |                                                                        |   
   |                                                                        |   
   +------------------------------------------------------------------------+   

メモリーが少ないそうですが、OKで進みます。


              +------------------+ Low Memory +------------------+              
              |                                                  |              
              | As you don't have much memory in this machine,   |              
              | we need to turn on swap space immediately. To    |              
              | do this we'll have to write your new partition   |              
              | table to the disk immediately. Is that OK?       |              
              |                                                  |              
              |         +-----+                  +----+          |              
              |         | Yes |                  | No |          |              
              |         +-----+                  +----+          |              
              |                                                  |              
              |                                                  |              
              +--------------------------------------------------+              

ブートローダーはデフォルトのGRUBのままOKで進みます。


              +----------+ Boot Loader Configuration +-----------+              
              |                                                  |              
              | Which boot loader would you like to use?         |              
              |                                                  |              
              |             (*) Use GRUB Boot Loader             |              
              |                ( ) No Boot Loader                |              
              |                                                  |              
              |         +----+                 +------+          |              
              |         | OK |                 | Back |          |              
              |         +----+                 +------+          |              
              |                                                  |              
              |                                                  |              
              +--------------------------------------------------+              

デフォルトのままOKで進みます。

      +------------------+ Boot Loader Configuration +------------------+       
      |                                                                 |       
      | A few systems will need to pass special options to the kernel   |       
      | at boot time for the system to function properly. If you need   |       
      | to pass boot options to the kernel, enter them now. If you      |       
      | don't need any or aren't sure, leave this blank.                |       
      |                                                                 |       
      |        console=xvc0____________________________________         |       
      |                                                                 |       
      |         [ ] Force use of LBA32 (not normally required)          |       
      |                                                                 |       
      |             +----+                        +------+              |       
      |             | OK |                        | Back |              |       
      |             +----+                        +------+              |       
      |                                                                 |       
      |                                                                 |       
      +-----------------------------------------------------------------+       

パスワードなしで進みます。


           +-------------+ Boot Loader Configuration +-------------+            
           |                                                       |            
           | A boot loader password prevents users from passing    |            
           | arbitrary options to the kernel.  For highest         |            
           | security, we recommend setting a password, but this   |            
           | is not necessary for more casual users.               |            
           |                                                       |            
           |                [ ] Use a GRUB Password                |            
           |                                                       |            
           |    Boot Loader Password: ________________________     |            
           |    Confirm:              ________________________     |            
           |                                                       |            
           |          +----+                    +------+           |            
           |          | OK |                    | Back |           |            
           |          +----+                    +------+           |            
           |                                                       |            
           |                                                       |            
           +-------------------------------------------------------+            

デフォルトのままOKで進みます。


     +-------------------+ Boot Loader Configuration +-------------------+      
     |                                                                   |      
     | The boot manager CentOS uses can boot other operating systems     |      
     | as well. You need to tell me what partitions you would like to    |      
     | be able to boot and what label you want to use for each of them.  |      
     |                                                                   |      
     | Default  Boot label                Device                         |      
     |    *     CentOS                    /dev/VolGroup00/LogVol00   ^   |      
     |                                                               :   |      
     |                                                               :   |      
     |                                                               #   |      
     |                                                               v   |      
     |                                                                   |      
     |        +----+              +------+              +------+         |      
     |        | OK |              | Edit |              | Back |         |      
     |        +----+              +------+              +------+         |      
     |                                                                   |      
     |                                                                   |      
     +-------------------------------------------------------------------+      

デフォルトのままOKで進みます。


              +----------+ Boot Loader Configuration +----------+               
              |                                                 |               
              | Where do you want to install the boot loader?   |               
              |                                                 |               
              | /dev/xvda        Master Boot Record (MBR)       |               
              | /dev/xvda1       First sector of boot partition |               
              |                                                 |               
              |         +----+                +------+          |               
              |         | OK |                | Back |          |               
              |         +----+                +------+          |               
              |                                                 |               
              |                                                 |               
              +-------------------------------------------------+               

確認してOKで進みます。


     +-----------------+ Network Configuration for eth0 +-----------------+     
     |                                                                    |     
     | Description: Xen Virtual Ethernet                                  |     
     | Hardware Address: 00:16:3E:28:45:51                                |     
     |                                                                    |     
     | [ ] Use dynamic IP configuration (DHCP)                            |     
     | [*] Enable IPv4 support                                            |     
     | [ ] Enable IPv6 support                                            |     
     | [*] Activate on boot                                               |     
     |                                                                    |     
     |                        Address                    Prefix (Netmask) |     
     | IPv4: 192.168.0.47_____________________________ / 255.255.255.0___ |     
     | IPv6: _________________________________________ / ________________ |     
     |                                                                    |     
     |             +----+                          +------+               |     
     |             | OK |                          | Back |               |     
     |             +----+                          +------+               |     
     |                                                                    |     
     |                                                                    |     
     +--------------------------------------------------------------------+     

確認して進みます。


          +------------+ Miscellaneous Network Settings +------------+          
          |                                                          |          
          | Gateway:       192.168.0.1______________________________ |          
          | Primary DNS:   61.205.121.85____________________________ |          
          | Secondary DNS: _________________________________________ |          
          |                                                          |          
          |           +----+                     +------+            |          
          |           | OK |                     | Back |            |          
          |           +----+                     +------+            |          
          |                                                          |          
          |                                                          |          
          +----------------------------------------------------------+          

デフォルトのままOKで進みます。


     +--------------------+ Hostname Configuration +---------------------+      
     |                                                                   |      
     | If your system is part of a larger network where hostnames are    |      
     | assigned by DHCP, select automatically via DHCP. Otherwise,       |      
     | select manually and enter in a hostname for your system. If you   |      
     | do not, your system will be known as 'localhost.'                 |      
     |                                                                   |      
     |        ( ) automatically via DHCP                                 |      
     |        (*) manually               centosi47.co-recipe.com_        |      
     |                                                                   |      
     |             +----+                          +------+              |      
     |             | OK |                          | Back |              |      
     |             +----+                          +------+              |      
     |                                                                   |      
     |                                                                   |      
     +-------------------------------------------------------------------+      

UTCのチェックをはずし、Asia/TokyoにしてOKで進みます。

                                                                                
                    +-------+ Time Zone Selection +-------+                     
                    |                                     |                     
                    | What time zone are you located in?  |                     
                    |                                     |                     
                    | [ ] System clock uses UTC           |                     
                    |                                     |                     
                    |  Asia/Tashkent                   ^  |                     
                    |  Asia/Tbilisi                    :  |                     
                    |  Asia/Tehran                     #  |                     
                    |  Asia/Thimphu                    :  |                     
                    |  Asia/Tokyo                      v  |                     
                    |                                     |                     
                    |      +----+          +------+       |                     
                    |      | OK |          | Back |       |                     
                    |      +----+          +------+       |                     
                    |                                     |                     
                    |                                     |                     
                    +-------------------------------------+                     

パスワードを設定してOKで進みます。


                +--------------+ Root Password +---------------+                
                |                                              |                
                | Pick a root password. You must type it       |                
                | twice to ensure you know what it is and      |                
                | didn't make a mistake in typing. Remember    |                
                | that the root password is a critical part    |                
                | of system security!                          |                
                |                                              |                
                | Password:           ********________________ |                
                | Password (confirm): ********________________ |                
                |                                              |                
                |        +----+               +------+         |                
                |        | OK |               | Back |         |                
                |        +----+               +------+         |                
                |                                              |                
                |                                              |                
                +----------------------------------------------+                

Serverのみを選択してOKで進みます。


      +----------------------+ Package selection +----------------------+       
      |                                                                 |       
      | The default installation of CentOS includes a set of software   |       
      | applicable for general internet usage. What additional tasks    |       
      | would you like your system to include support for?              |       
      |                                                                 |       
      |                    [ ] Desktop - Gnome    ^                     |       
      |                    [ ] Desktop - KDE      #                     |       
      |                    [*] Server             :                     |       
      |                    [ ] Server - GUI       v                     |       
      |                                                                 |       
      |                [ ] Customize software selection                 |       
      |                                                                 |       
      |             +----+                        +------+              |       
      |             | OK |                        | Back |              |       
      |             +----+                        +------+              |       
      |                                                                 |       
      |                                                                 |       
      +-----------------------------------------------------------------+       

この後、すごーーーく時間がかかり、固まったように感じますが、がまんして、じっーーーと待ちましょう。


                 +---------+ Installation to begin +----------+                 
                 |                                            |                 
                 | A complete log of your installation will   |                 
                 | be in /root/install.log after rebooting    |                 
                 | your system. You may want to keep this     |                 
                 | file for later reference.                  |                 
                 |                                            |                 
                 |       +----+              +------+         |                 
                 |       | OK |              | Back |         |                 
                 |       +----+              +------+         |                 
                 |                                            |                 
                 |                                            |                 
                 +--------------------------------------------+                 
                                                                                

パッケージがインストールされるので、終わるまで待ちます。


         +------------------+ Package Installation +------------------+         
         |                                                            |         
         |  Name   : glibc-common-2.5-12-i386                         |         
         |  Size   : 64166k                                           |         
         |  Summary: Common binaries and locale data for glibc        |         
         |                                                            |         
         |                                                            |         
         |  Status:                                                   |         
         |                                                            |         
         |                             0%                             |         
         |                                                            |         
         |                          Packages      Bytes        Time   |         
         |   Total    :                  473       802M     0:29:48   |         
         |   Completed:                   12        15M     0:00:35   |         
         |   Remaining:                  461       787M     0:29:13   |         
         |                                                            |         
         |                             1%                             |         
         |                                                            |         
         +------------------------------------------------------------+         

終了すると以下の画面になります。

Welcome to CentOS                                                               
                                                                                
                                                                                
                                                                                
                                                                                
          +----------------------+ Complete +-----------------------+           
          |                                                         |           
          | Congratulations, your CentOS installation is complete.  |           
          |                                                         |           
          | Remove any media used during the installation process   |           
          | and press <Enter> to reboot your system.                |           
          |                                                         |           
          |                                                         |           
          |                       +--------+                        |           
          |                       | Reboot |                        |           
          |                       +--------+                        |           
          |                                                         |           
          |                                                         |           
          +---------------------------------------------------------+           
                                                                                
                                                                                
                                                                                
                                                                                
                               <Enter> to reboot                               

<Enter>で再起動します。

再起動するのは、ゲストOSだけで、本体は再起動しません。


To previous pageTo home pageMailing to meJump to Top of pageline.gif (927 ツバツイツト)line.gif (927 ツバツイツト)tomo.gif (1144 ツバツイツト)
カスタム検索



このエントリーをはてなブックマークに追加