仮想マシンの作成
・仮想マシン作成
virt-install \
--name rocky98 \
--memory 4096 \
--vcpus 2 \
--cpu host-model \
--disk path=/var/lib/libvirt/images/rocky98.qcow2,size=40,format=qcow2 \
--location /var/lib/libvirt/os/Rocky-9.8-x86_64-minimal.iso \
--network network=default \
--graphics none \
--console pty,target_type=serial \
--extra-args "console=ttyS0,115200 inst.text"
- 「2」を入力しテキストモードでインストール
Starting installer, one moment...
anaconda 34.25.7.14-1.el9.rocky.0.6 for Rocky Linux Minimal 9.8 started.
* installation log files are stored in /tmp during the installation
* shell is available on TTY2
* if the graphical installation interface fails to start, try again with the
inst.text bootoption to start text installation
* when reporting a bug add logs from /tmp as separate text/plain attachments
================================================================================
================================================================================
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 F1
refresh]: 2
- 「11」の言語設定で「39」のjapaneseするる
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: enp1s0) (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
4) Assamese 33) Croatian 62) Oromo
5) Asturian 34) Hungarian 63) Odia
6) Belarusian 35) Interlingua 64) Punjabi
7) Bulgarian 36) Indonesian 65) Polish
8) Bangla 37) Icelandic 66) Portuguese
9) Tibetan 38) Italian 67) Romanian
10) Bosnian 39) Japanese 68) Russian
11) Catalan 40) Georgian 69) Sinhala
12) Czech 41) Kabyle 70) Slovak
13) Welsh 42) Kazakh 71) Slovenian
14) Danish 43) Khmer 72) Albanian
15) German 44) Kannada 73) Serbian
16) Greek 45) Korean 74) Swedish
17) English 46) Cornish 75) Tamil
18) Esperanto 47) Lithuanian 76) Telugu
19) Spanish 48) Latvian 77) Tajik
20) Estonian 49) Maithili 78) Thai
21) Basque 50) Macedonian 79) Turkish
22) Persian 51) Malayalam 80) Ukrainian
23) Finnish 52) Marathi 81) Urdu
24) Filipino 53) Malay 82) Uzbek
25) French 54) Burmese 83) Vietnamese
Press ENTER to continue:
26) Friulian 55) Norwegian Bokmål 84) Mandarin Chinese
27) Western Frisian 56) Low German 85) Zulu
28) Irish 57) Nepali
29) Galician 58) Dutch
Please select language support to install ['b' to return to language list, 'c'
to continue, 'q' to quit, 'r' to refresh]: 39
================================================================================
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
- 「5」を選択してOSインストール先のディスクを選択する
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: enp1s0) (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
Probing storage...
================================================================================
================================================================================
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
================================================================================
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
================================================================================
================================================================================
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]: 1
================================================================================
Partition Scheme Options
1) [x] Standard Partition
2) [ ] 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...
================================================================================
- 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: enp1s0) (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]:
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):
================================================================================
Question
The password you have provided is weak: The password fails the dictionary check
- it is based on a dictionary word
Would you like to use it anyway?
Please respond 'yes' or 'no': yes
================================================================================
- 「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) [!] Root password
(Connected: enp1s0) (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]: b
- ctrl + ]で仮想マシンからログアウトすることができる
Rocky Linux 9.8 (Blue Onyx)
Kernel 5.14.0-687.10.1.el9_8.0.1.x86_64 on x86_64
localhost login: root
パスワード:
[root@localhost ~]#
[root@localhost ~]#
root@Latitude-5300:/var/lib/libvirt/os#
root@Latitude-5300:/var/lib/libvirt/os#
root@Latitude-5300:/var/lib/libvirt/os#
- ctrl + ]で仮想マシンからログアウトすることができる
Rocky Linux 9.8 (Blue Onyx)
Kernel 5.14.0-687.10.1.el9_8.0.1.x86_64 on x86_64
localhost login: root
パスワード:
[root@localhost ~]#
[root@localhost ~]#
root@Latitude-5300:/var/lib/libvirt/os#
root@Latitude-5300:/var/lib/libvirt/os#
root@Latitude-5300:/var/lib/libvirt/os#
関連コマンド
- 仮想マシン一覧確認
virsh list --all
- 仮想マシン削除
virsh undefine <VM名>
virsh destroy <VM名>
- 仮想マシン起動
virsh start <VM名>
- 仮想マシン停止
virsh shutdown <VM名>
- 仮想マシン強制停止
virsh destroy <VM名>
- 仮想マシン再起動
virsh reboot <VM名>
- 仮想マシン一時停止
virsh suspend <VM名>
- 仮想マシン再開
virsh resume <VM名>
- 仮想マシンのNIC確認
virsh domiflist <VM名>