このセクションでは、AlmaLinuxの仮想マシン作成について紹介します。

ISOファイルの入手

以下場所より、AlmaLinuxのisoファイルをダウンロードします。

https://mirrors.almalinux.org/isos/x86_64/9.2.html

AlmaLinuxの仮想マシン作成

virshコマンドを使ってAlmaLinuxの仮想マシンを作成します。

# virt-install --name almalinux-mini --ram 2048 \
 --disk path=/var/lib/libvirt/images/almalinux-mini.img,size=40 \
 --vcpus 2 --os-type linux --os-variant almalinux9 \
 --network bridge=br0 --graphics none \
 --console pty,target_type=serial \
 --location '/tmp/iso/AlmaLinux-9-latest-x86_64-minimal.iso' \
 --extra-args 'console=ttyS0,115200n8'

2 を選択し、テキストモードでのインストールを行います。

================================================================================
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 a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 2

1 を選択し言語設定を行います。

================================================================================
Installation

1) [x] Language settings                 2) [x] Time settings
       (English (United States))                (America/New_York timezone)
3) [!] Installation source               4) [!] Software selection
       (Processing...)                          (Processing...)
5) [!] Installation Destination          6) [x] Kdump
       (Processing...)                          (Kdump is enabled)
7) [x] Network configuration             8) [!] Root password
       (Connected: ens2)                        (Root account is disabled)
9) [!] User creation
       (No user will be created)

Please make a selection from the above ['b' to begin installation, 'q' to quit,
'r' to refresh]: 1

言語は、36(日本)を選択します。

================================================================================
Language settings

Available languages
1) Afrikaans               24) Friulian               47) Norwegian Bokmå
3) Arabic                  26) Galician               49) Norwegian Nynorsk
4) Assamese                27) Gujarati               50) Odia
5) Asturian                28) Hebrew                 51) Punjabi
6) Belarusian              29) Hindi                  52) Polish
7) Bulgarian               30) Croatian               53) Portuguese
8) Bangla                  31) Hungarian              54) Romanian
9) Catalan                 32) Interlingua            55) Russian
10) Czech                  33) Indonesian             56) Sinhala
11) Welsh                  34) Icelandic              57) Slovak
12) Danish                 35) Italian                58) Albanian
13) German                 36) Japanese               59) Serbian
14) Greek                  37) Georgian               60) Swedish
15) English                38) Kazakh                 61) Tamil
16) Esperanto              39) Khmer                  62) Telugu
17) Spanish                40) Kannada                63) Thai
18) Estonian               41) Korean                 64) Turkish
19) Basque                 42) Lithuanian             65) Ukrainian
20) Persian                43) Latvian                66) Urdu
21) Finnish                44) Malayalam              67) Mandarin Chinese
22) Filipino               45) Marathi
23) French                 46) Burmese

Please select language support to install ['b' to return to language list, 'c'
to continue, 'q' to quit, 'r' to refresh]: 36

1 を選択します。

================================================================================
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, 'r' to refresh]: 1

2 を選択し、時刻設定を行います。

================================================================================
Installation

1) [x] Language settings                 2) [x] Time settings
       (Japanese (Japan))                       (America/New_York timezone)
3) [x] Installation source               4) [x] Software selection
       (Local media)                            (Minimal Install)
5) [!] Installation Destination          6) [x] Kdump
       (Automatic partitioning                  (Kdump is enabled)
       selected)
7) [x] Network configuration             8) [!] Root password
       (Connected: ens2)                        (Root account is disabled)
9) [!] User creation
       (No user will be created)

Please make a selection from the above ['b' to begin installation, 'q' to quit,
'r' to refresh]: 2

1 を選択し、タイムゾーンを変更します。

================================================================================
Time settings

Timezone: America/New_York

NTP servers: not configured

1) Change timezone
2) Configure NTP servers

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 1

2(アジア)を選択します。

================================================================================
Timezone settings

Available regions
1) Europe                  5) Antarctica              9) Indian
2) Asia                    6) Pacific                 10) Arctic
3) America                 7) Australia               11) US
4) Africa                  8) Atlantic                12) Etc

Please select the timezone. Use numbers or type names directly ['b' to go back
to region list, 'c' to continue, 'q' to quit, 'r' to refresh]: 2

73(東京)を選択します。

================================================================================
ーー(省略)ーー
14) Beirut                 42) Kuala_Lumpur           70) Tbilisi
15) Bishkek                43) Kuching                71) Tehran
16) Brunei                 44) Kuwait                 72) Thimphu
17) Chita                  45) Macau                  73) Tokyo
18) Choibalsan             46) Magadan                74) Tomsk
ーー(省略)ーー
Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 73

2 を選択し、NTPサーバーに関わる設定を行います。

================================================================================
Time settings

Timezone: America/New_York

NTP servers: not configured

1) Change timezone
2) Configure NTP servers

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 2

1 を選択し、時刻同期するNTPサーバーを指定します。

================================================================================
NTP configuration

NTP servers: not configured

1) Add NTP server

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 1


================================================================================
Add NTP server address

Enter an NTP server address and press ENTER: ntp.nict.jp

c でインストール初期画面に戻ります。

================================================================================
NTP configuration

NTP servers:
ntp.nict.jp (checking status)

1) Add NTP server
2) Remove NTP server

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: c

5 を選択し、ディスクのパーティションに関する設定を行います。

================================================================================
Installation

1) [x] Language settings                 2) [x] Time settings
       (Japanese (Japan))                       (America/New_York timezone)
3) [x] Installation source               4) [x] Software selection
       (Local media)                            (Minimal Install)
5) [!] Installation Destination          6) [x] Kdump
       (Automatic partitioning                  (Kdump is enabled)
       selected)
7) [x] Network configuration             8) [!] Root password
       (Connected: ens2)                        (Root account is disabled)
9) [!] User creation
       (No user will be created)

Please make a selection from the above ['b' to begin installation, 'q' to quit,
'r' to refresh]: 5

1 を選択します。

================================================================================
Installation Destination

1) [x] DISK: 40 GiB (vda)

1 disk selected; 40 GiB capacity; 40 GiB free

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 1

もう一度、1 を選択します。

================================================================================
Installation Destination

1) [ ] DISK: 40 GiB (vda)

No disks selected; please select at least one disk to install to.

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 1

c(continue) を選択します。

================================================================================
Installation Destination

1) [x] DISK: 40 GiB (vda)

1 disk selected; 40 GiB capacity; 40 GiB free

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: c

2(Use All Space)を選択し、続けて c(continue)を選択します。

================================================================================
Partitioning Options

1) [ ] Replace Existing Linux system(s)
2) [x] Use All Space
3) [ ] Use Free Space
4) [ ] Manually assign mount points

Installation requires partitioning of your hard drive. Select what space to use
for the install target or manually assign mount points.

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: c

2(LVM)を選択し、続けて c(continue)を選択します。 

================================================================================
Partition Scheme Options

1) [ ] Standard Partition
2) [x] LVM
3) [ ] LVM Thin Provisioning

Select a partition scheme configuration.

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: c
Saving storage configuration...
Checking storage configuration...

7 を選択し、ネットワークに関わる設定を行います。

================================================================================
Installation

1) [x] Language settings                 2) [x] Time settings
       (Japanese (Japan))                       (America/New_York timezone)
3) [x] Installation source               4) [x] Software selection
       (Local media)                            (Minimal Install)
5) [x] Installation Destination          6) [x] Kdump
       (Automatic partitioning                  (Kdump is enabled)
       selected)
7) [x] Network configuration             8) [!] Root password
       (Connected: ens2)                        (Root account is disabled)
9) [!] User creation
       (No user will be created)

Please make a selection from the above ['b' to begin installation, 'q' to quit,
'r' to refresh]: 7

1(ホスト名の設定)を選択し、仮想マシンのホスト名を指定します。

================================================================================
Network configuration

Wired (ens2) connected
 IPv4 Address: 192.168.1.13 Netmask: 255.255.255.0 Gateway: 192.168.1.1
 DNS: 192.168.1.1
 IPv6 Address: 2400:4151:442:8d00:27c6:1429:c5a7:be6b/64


Host Name:


Current host name: localhost


1) Set host name
2) Configure device ens2

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 1
================================================================================
Enter a new value for 'Host Name' and press ENTER: pub-web

2(LANインターフェイスのデバイス設定)を選択します。

================================================================================
Network configuration

Wired (ens2) connected
 IPv4 Address: 192.168.1.13 Netmask: 255.255.255.0 Gateway: 192.168.1.1
 DNS: 192.168.1.1
 IPv6 Address: 2400:4151:442:8d00:27c6:1429:c5a7:be6b/64


Host Name: pub-web


Current host name: localhost


1) Set host name
2) Configure device ens2

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 2

1 を選択し、固定で割り当てるIPアドレスを指定します。

================================================================================
Device configuration

1) IPv4 address or "dhcp" for DHCP
   dhcp
2) IPv4 netmask
3) IPv4 gateway
4) IPv6 address[/prefix] or "auto" for automatic, "dhcp" for DHCP, "ignore" to
   turn off
   auto
5) IPv6 default gateway
6) Nameservers (comma separated)
7) [x] Connect automatically after reboot
8) [ ] Apply configuration in installer

Configuring device ens2.

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 1
================================================================================
Enter a new value for 'IPv4 address or "dhcp" for DHCP' and press ENTER: 192.168
.1.110

2 を選択し、サブネットマスクを指定します。

================================================================================
Device configuration

1) IPv4 address or "dhcp" for DHCP
   192.168.1.110
2) IPv4 netmask
3) IPv4 gateway
4) IPv6 address[/prefix] or "auto" for automatic, "dhcp" for DHCP, "ignore" to
   turn off
   auto
5) IPv6 default gateway
6) Nameservers (comma separated)
7) [x] Connect automatically after reboot
8) [ ] Apply configuration in installer

Configuring device ens2.

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 2
================================================================================
================================================================================
Enter a new value for 'IPv4 netmask' and press ENTER: 255.255.255.0

3 を選択し、デフォルトゲートウェイを指定します。

================================================================================
Device configuration

1) IPv4 address or "dhcp" for DHCP
   192.168.1.110
2) IPv4 netmask
   255.255.255.0
3) IPv4 gateway
4) IPv6 address[/prefix] or "auto" for automatic, "dhcp" for DHCP, "ignore" to
   turn off
   auto
5) IPv6 default gateway
6) Nameservers (comma separated)
7) [x] Connect automatically after reboot
8) [ ] Apply configuration in installer

Configuring device ens2.

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 3
================================================================================
Enter a new value for 'IPv4 gateway' and press ENTER: 192.168.1.1

6 を選択し、参照するネームサーバーを指定します。

================================================================================
Device configuration

1) IPv4 address or "dhcp" for DHCP
   192.168.1.110
2) IPv4 netmask
   255.255.255.0
3) IPv4 gateway
   192.168.1.1
4) IPv6 address[/prefix] or "auto" for automatic, "dhcp" for DHCP, "ignore" to
   turn off
   auto
5) IPv6 default gateway
6) Nameservers (comma separated)
7) [x] Connect automatically after reboot
8) [ ] Apply configuration in installer

Configuring device ens2.

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 6
================================================================================
Enter a new value for 'Nameservers (comma separated)' and press ENTER: 192.168.1.1

c(continue)を選択します。

================================================================================
Device configuration

1) IPv4 address or "dhcp" for DHCP
   192.168.1.110
2) IPv4 netmask
   255.255.255.0
3) IPv4 gateway
   192.168.1.1
4) IPv6 address[/prefix] or "auto" for automatic, "dhcp" for DHCP, "ignore" to
   turn off
   auto
5) IPv6 default gateway
6) Nameservers (comma separated)
   192.168.1.1
7) [x] Connect automatically after reboot
8) [ ] Apply configuration in installer

Configuring device ens2.

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: c

もう一度、c(continue)を選択し、インストール初期画面に戻ります。

================================================================================
Network configuration

Wired (ens2) connected
 IPv4 Address: 192.168.1.13 Netmask: 255.255.255.0 Gateway: 192.168.1.1
 DNS: 192.168.1.1
 IPv6 Address: 2400:4151:442:8d00:27c6:1429:c5a7:be6b/64


Host Name: pub-web


Current host name: localhost


1) Set host name
2) Configure device ens2

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: c

8 を選択し、rootユーザーのパスワードを設定します。

================================================================================
Installation

1) [x] Language settings                 2) [x] Time settings
       (Japanese (Japan))                       (America/New_York timezone)
3) [x] Installation source               4) [x] Software selection
       (Local media)                            (Minimal Install)
5) [x] Installation Destination          6) [x] Kdump
       (Automatic partitioning                  (Kdump is enabled)
       selected)
7) [x] Network configuration             8) [!] Root password
       (Connected: ens2)                        (Root account is disabled)
9) [!] User creation
       (No user will be created)

Please make a selection from the above ['b' to begin installation, 'q' to quit,
'r' to refresh]: 8
================================================================================
Root password

Please select new root password. You will have to type it twice.

Password: 
Password (confirm): 

9 を選択し、root ユーザー以外のユーザーの作成を行います。

================================================================================
Installation

1) [x] Language settings                 2) [x] Time settings
       (Japanese (Japan))                       (America/New_York timezone)
3) [x] Installation source               4) [x] Software selection
       (Local media)                            (Minimal Install)
5) [x] Installation Destination          6) [x] Kdump
       (Automatic partitioning                  (Kdump is enabled)
       selected)
7) [x] Network configuration             8) [x] Root password
       (Connected: ens2)                        (Root password is set)
9) [ ] User creation
       (No user will be created)

Please make a selection from the above ['b' to begin installation, 'q' to quit,
'r' to refresh]: 9

1 を選択します。

================================================================================
User creation

1) [ ] Create user

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 1

2 を選択し、追加するユーザー名を指定します。

================================================================================
User creation

1) [x] Create user
2) Full name
3) User name
4) [x] Use password
5) Password
6) [ ] Administrator
7) Groups

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 2


================================================================================
Enter a new value for 'Full name' and press ENTER: user

5 を選択し、追加するユーザーのパスワードを指定します。

================================================================================
User creation

1) [x] Create user
2) Full name
   user
3) User name
   user
4) [x] Use password
5) Password
6) [ ] Administrator
7) Groups

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: 5


================================================================================
Password: 
Password (confirm): 

c(continue)を選択し、インストール初期画面に戻ります。

================================================================================
User creation

1) [x] Create user
2) Full name
   user
3) User name
   user
4) [x] Use password
5) Password
   Password set.
6) [ ] Administrator
7) Groups

Please make a selection from the above ['c' to continue, 'q' to quit, 'r' to
refresh]: c

全ての設定が完了したら、b(インストール開始)を選択します。

================================================================================
Installation

1) [x] Language settings                 2) [x] Time settings
       (Japanese (Japan))                       (America/New_York timezone)
3) [x] Installation source               4) [x] Software selection
       (Local media)                            (Minimal Install)
5) [x] Installation Destination          6) [x] Kdump
       (Automatic partitioning                  (Kdump is enabled)
       selected)
7) [x] Network configuration             8) [x] Root password
       (Connected: ens2)                        (Root password is set)
9) [x] User creation
       (User yuji will be created)

Please make a selection from the above ['b' to begin installation, 'q' to quit,
'r' to refresh]: b

あとは自動的にインストールが行われます。インストールが完了したら、仮想マシンにログインするプロンプトが表示されます。
以上で、AlmaLinuxの仮想マシン作成は終わりです。

ーー(省略)ーー

Installation complete

Use of this product is subject to the license agreement found at:
/usr/share/almalinux-release/EULA

Installation complete. Press ENTER to quit: 


ーー(省略)ーー
[  OK  ] Started OpenSSH server daemon.
[  OK  ] Reached target Multi-User System.
         Starting Record Runlevel Change in UTMP...
[  OK  ] Finished Record Runlevel Change in UTMP.

AlmaLinux 9.2 (Turquoise Kodkod)
Kernel 5.14.0-284.11.1.el9_2.x86_64 on an x86_64

pub-web login: