KVMゲストインストール

ゲストOSインストール

ゲストOSにCentOSをインストールします。

# virt-install \
–connect=qemu:///system \
–name=guestvm1 \
–ram=2048 \
–disk path=/var/lib/libvirt/images/disk_vm1.img,size=60,format=qcow2 \
–vcpus=1 \
–os-type linux \
–os-variant=rhel7 \
–network bridge=br0 \
–nographics \
–extra-args=’console=tty0 console=ttyS0,115200n8 keymap=ja’ \
–location http://ftp.riken.jp/Linux/centos/7.8.2003/os/x86_64/

OSのインストールが始まるので以下の通りの操作を行います。

Starting installer, one moment… anaconda 21.48.22.158-1 for CentOS 7 started. * installation log files are stored in /tmp during the installation * shell is available on TTY2 * when reporting a bug add logs from /tmp as separate text/plain attachments ================================================================================ ================================================================================ VNC Text mode provides a limited set of installation options. It does not offer custom partitioning for full control over the disk layout. Would you like to use VNC mode instead? 1) Start VNC 2) Use text mode Please make your choice from above [‘q’ to quit | ‘c’ to continue | ‘r’ to refresh]: 2 ←”2″を選択 ================================================================================ ================================================================================ Language settings Available languages 1) Afrikaans 25) Hindi 48) Oriya 2) Amharic 26) Croatian 49) Punjabi 3) Arabic 27) Hungarian 50) Polish 4) Assamese 28) Interlingua 51) Portuguese 5) Asturian 29) Indonesian 52) Romanian 6) Belarusian 30) Icelandic 53) Russian 7) Bulgarian 31) Italian 54) Sinhala 8) Bengali 32) Japanese 55) Slovak 9) Bosnian 33) Georgian 56) Slovenian 10) Catalan 34) Kazakh 57) Albanian 11) Czech 35) Kannada 58) Serbian 12) Welsh 36) Korean 59) Swedish 13) Danish 37) Lithuanian 60) Tamil 14) German 38) Latvian 61) Telugu 15) Greek 39) Maithili 62) Tajik 16) English 40) Macedonian 63) Thai 17) Spanish 41) Malayalam 64) Turkish 18) Estonian 42) Marathi 65) Ukrainian 19) Basque 43) Malay 66) Urdu 20) Persian 44) Norwegian Bokmal 67) Vietnamese 21) Finnish 45) Nepali 68) Chinese 22) French 46) Dutch 69) Zulu Press ENTER to continue 23) Galician 47) Northern Sotho 24) Gujarati Please select language support to install. [b to return to language list, c to continue, q to quit]: 32 ←”32″を選択 ================================================================================ ================================================================================ Language settings Available locales 1) Japanese (Japan) Please select language support to install. [b to return to language list, c to continue, q to quit]: 1 ←”1″を選択 ================================================================================ ================================================================================ Installation 1) [x] Language settings 2) [!] Time settings (Japanese (Japan)) (Timezone is not set.) 3) [x] Installation source 4) [x] Software selection (http://ftp.riken.jp/Linux/cent (Minimal Install) os/7.8.2003/os/x86_64/) 6) [x] Kdump 5) [!] Installation Destination (Kdump is enabled) (No disks selected) 8) [!] Root password 7) [x] Network configuration (Password is not set.) (Wired (eth0) connected) 9) [!] User creation (No user will be created) Please make your choice from above [‘q’ to quit | ‘b’ to begin installation | ‘r’ to refresh]: 2 ←”2″を選択 ================================================================================ ================================================================================ Time settings Timezone: not set NTP servers:not configured 1) Set timezone 2) Configure NTP servers Please make your choice from above [‘q’ to quit | ‘c’ to continue | ‘r’ to refresh]: 1 ←”1″を選択 ================================================================================ ================================================================================ Timezone settings Available regions 1) Europe 6) Pacific 10) Arctic 2) Asia 7) Australia 11) US 3) America 8) Atlantic 12) Etc 4) Africa 9) Indian 5) Antarctica Please select the timezone. Use numbers or type names directly [b to region list, q to quit]: 2 ←”2″を選択 1) Aden 29) Hong_Kong 56) Pontianak 2) Almaty 30) Hovd 57) Pyongyang 3) Amman 31) Irkutsk 58) Qatar 4) Anadyr 32) Jakarta 59) Qostanay 5) Aqtau 33) Jayapura 60) Qyzylorda 6) Aqtobe 34) Jerusalem 61) Riyadh 7) Ashgabat 35) Kabul 62) Sakhalin 8) Atyrau 36) Kamchatka 63) Samarkand 9) Baghdad 37) Karachi 64) Seoul 10) Bahrain 38) Kathmandu 65) Shanghai 11) Baku 39) Khandyga 66) Singapore 12) Bangkok 40) Kolkata 67) Srednekolymsk 13) Barnaul 41) Krasnoyarsk 68) Taipei 14) Beirut 42) Kuala_Lumpur 69) Tashkent 15) Bishkek 43) Kuching 70) Tbilisi 16) Brunei 44) Kuwait 71) Tehran 17) Chita 45) Macau 72) Thimphu 18) Choibalsan 46) Magadan 73) Tokyo 19) Colombo 47) Makassar 74) Tomsk 20) Damascus 48) Manila 75) Ulaanbaatar 21) Dhaka 49) Muscat 76) Urumqi 22) Dili 50) Nicosia 77) Ust-Nera Press ENTER to continue 23) Dubai 51) Novokuznetsk 78) Vientiane 24) Dushanbe 52) Novosibirsk 79) Vladivostok 25) Famagusta 53) Omsk 80) Yakutsk 26) Gaza 54) Oral 81) Yangon 27) Hebron 55) Phnom_Penh 82) Yekaterinburg 28) Ho_Chi_Minh 83) Yerevan Please select the timezone. Use numbers or type names directly [b to region list, q to quit]: 73 ←”73″を選択 ================================================================================ ================================================================================ Installation 1) [x] Language settings 2) [x] Time settings (Japanese (Japan)) (Timezone is not set.) 3) [x] Installation source 4) [x] Software selection (http://ftp.riken.jp/Linux/cent (Minimal Install) os/7.7.1908/os/x86_64/) 6) [x] Kdump 5) [!] Installation Destination (Kdump is enabled) (No disks selected) 8) [!] Root password 7) [x] Network configuration (Password is not set.) (Wired (eth0) connected) 9) [!] User creation (No user will be created) Please make your choice from above [‘q’ to quit | ‘b’ to begin installation | ‘r’ to refresh]: 5 ←”5″を選択 ================================================================================ ================================================================================ Probing storage… Installation Destination [x] 1) : 80 GiB (vda) 1 disk selected; 80 GiB capacity; 80 GiB free … Please make your choice from above [‘q’ to quit | ‘c’ to continue | ‘r’ to refresh]: c ←”c”を選択 ================================================================================ ================================================================================ Autopartitioning Options [ ] 1) Replace Existing Linux system(s) [x] 2) Use All Space [ ] 3) Use Free Space Installation requires partitioning of your hard drive. Select what space to use for the install target. Please make your choice from above [‘q’ to quit | ‘c’ to continue | ‘r’ to refresh]: c ←”c”を選択 ================================================================================ ================================================================================ Partition Scheme Options [ ] 1) Standard Partition [ ] 2) Btrfs [x] 3) LVM [ ] 4) LVM Thin Provisioning Select a partition scheme configuration. Please make your choice from above [‘q’ to quit | ‘c’ to continue | ‘r’ to refresh]: c ←”c”を選択 Generating updated storage configuration Checking storage configuration… ================================================================================ ================================================================================ Installation 1) [x] Language settings 2) [x] Time settings (Japanese (Japan)) (Timezone is not set.) 3) [x] Installation source 4) [x] Software selection (http://ftp.riken.jp/Linux/cent (Minimal Install) os/7.7.1908/os/x86_64/) 6) [x] Kdump 5) [x] Installation Destination (Kdump is enabled) (Automatic partitioning 8) [!] Root password selected) (Password is not set.) 7) [x] Network configuration (Wired (eth0) connected) 9) [!] User creation (No user will be created) Please make your choice from above [‘q’ to quit | ‘b’ to begin installation | ‘r’ to refresh]: 8 ←”8″を選択 ================================================================================ ================================================================================ Please select new root password. You will have to type it twice. Password: ←任意のrootパスワードを入力 Password (confirm): ←確認用のrootパスワードを入力 ================================================================================ ================================================================================ Installation 1) [x] Language settings 2) [x] Time settings (Japanese (Japan)) (Timezone is not set.) 3) [x] Installation source 4) [x] Software selection (http://ftp.riken.jp/Linux/cent (Minimal Install) os/7.7.1908/os/x86_64/) 6) [x] Kdump 5) [x] Installation Destination (Kdump is enabled) (Automatic partitioning 8) [x] Root password selected) (Password is set.) 7) [x] Network configuration (Wired (eth0) connected) 9) [ ] User creation (No user will be created) Please make your choice from above [‘q’ to quit | ‘b’ to begin installation | ‘r’ to refresh]: b ←”b”を選択 ================================================================================ ================================================================================ Progress Setting up the installation environment ・ ・ ←しばらく待つ ・ Installing iwl5000-firmware (290/303) Installing iwl2000-firmware (291/303) Installing iwl2030-firmware (292/303) Installing iwl7260-firmware (293/303) Installing iwl1000-firmware (294/303) Installing iwl3160-firmware (295/303) Installing iwl135-firmware (296/303) Installing iwl6000-firmware (297/303) Installing iwl6000g2a-firmware (298/303) Installing ivtv-firmware (299/303) Installing iwl105-firmware (300/303) Installing rootfiles (301/303) Installing iwl5150-firmware (302/303) Installing iwl4965-firmware (303/303) Performing post-installation setup tasks Installing boot loader . Performing post-installation setup tasks . Configuring installed system . Writing network configuration . Creating users . Configuring addons . Generating initramfs . Running post-installation scripts . Use of this product is subject to the license agreement found at /usr/share/centos-release/EULA Installation complete. Press return to quit ←Enterを押す

CentOSが起動するのでログインします。

CentOS Linux 7 (Core)
Kernel 3.10.0-1127.el7.x86_64 on an x86_64

localhost login: root ←”root”を入力しEnterを押す
パスワード: ←rootパスワードを入力しEnterを押す
[root@localhost ~]#

ログインの確認ができたらログアウトします。

[root@localhost ~]# exit ←コンソールを抜ける
ログアウト

ゲストOSのコンソールを抜けるには、[CTRL]キーと”]”キーを押します。

CentOS Linux 7 (Core)
Kernel 3.10.0-1127.el7.x86_64 on an x86_64

localhost login: ←[CTRL]+”]”を押す
[root@localhost ~]#