linux:kvm_install
差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
| linux:kvm_install [2021/02/24 10:59] – [Step 1: Check Virtualization Support in Ubuntu] kimi | linux:kvm_install [2022/08/23 13:34] (現在) – 外部編集 127.0.0.1 | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| ====== KVMのインストール ====== | ====== KVMのインストール ====== | ||
| - | [[https:// | + | |
| - | ===== Step 1: Check Virtualization Support in Ubuntu | + | ===== Step 1: 仮想化機能の有無の確認 |
| <code sh> | <code sh> | ||
| 行 14: | 行 14: | ||
| </ | </ | ||
| - | ===== Step 2: Install KVM on Ubuntu 20.04 LTS ===== | + | ===== Step 2: パッケージのインストール |
| <code sh> | <code sh> | ||
| - | $ sudo apt install | + | $ sudo apt install -y qemu |
| - | $ virsh | + | $ sudo apt install -y qemu-kvm |
| - | Welcome to virsh, the virtualization interactive terminal. | + | $ sudo apt install -y libvirt-daemon |
| - | + | $ sudo apt install -y libvirt-clients | |
| - | Type: ' | + | $ sudo apt install -y bridge-utils |
| - | ' | + | $ sudo apt install -y virt-manager |
| - | + | </ | |
| - | virsh # quit | + | <code sh> |
| - | $ | + | $ virsh list |
| + | | ||
| + | -------------------- | ||
| - | $ sudo apt install qemu-utils | ||
| $ qemu-img | $ qemu-img | ||
| qemu-img: Not enough arguments | qemu-img: Not enough arguments | ||
| Try ' | Try ' | ||
| - | $ | ||
| - | |||
| - | $ sudo apt install qemu-kvm | ||
| $ kvm | $ kvm | ||
| Unable to init server: Could not connect: Connection refused | Unable to init server: Could not connect: Connection refused | ||
| Could not access KVM kernel module: Permission denied | Could not access KVM kernel module: Permission denied | ||
| qemu-system-x86_64: | qemu-system-x86_64: | ||
| - | $ | ||
| - | |||
| - | $ sudo apt install virtinst | ||
| - | |||
| - | $ sudo virsh list | ||
| - | error: failed to connect to the hypervisor | ||
| - | error: Failed to connect socket to '/ | ||
| - | |||
| - | $ sudo apt install libvirt-bin | ||
| - | $ sudo apt install qemu | ||
| - | $ sudo apt install qemu-kvm | ||
| - | $ sudo apt install libvirt-bin | ||
| - | $ sudo apt install virt-manager | ||
| - | $ sudo virsh list | ||
| - | | ||
| - | -------------------- | ||
| - | |||
| - | $ sudo apt install bridge-utils | ||
| $ | $ | ||
| - | |||
| - | |||
| - | </ | ||
| - | |||
| - | <code sh> | ||
| $ sudo systemctl status libvirtd | $ sudo systemctl status libvirtd | ||
| - | [sudo] password for kimi: | ||
| - | ● libvirtd.service - Virtualization daemon | ||
| - | | ||
| - | | ||
| ● libvirtd.service - Virtualization daemon | ● libvirtd.service - Virtualization daemon | ||
| | | ||
| - | | + | |
| - | TriggeredBy: | + | TriggeredBy: |
| ● libvirtd-admin.socket | ● libvirtd-admin.socket | ||
| - | ● libvirtd.socket | + | ● libvirtd-ro.socket |
| Docs: man: | Docs: man: | ||
| | | ||
| - | Main PID: 982 (libvirtd) | + | Main PID: 7856 (libvirtd) |
| Tasks: 19 (limit: 32768) | Tasks: 19 (limit: 32768) | ||
| - | | + | |
| | | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | Feb 23 07:16:20 sstw dnsmasq[1099]: compile time options: IPv6 GNU-getopt DBus > | + | Feb 24 02:09:56 sstw dnsmasq[8267]: compile time options: IPv6 GNU-getopt DBus > |
| - | Feb 23 07:16:20 sstw dnsmasq-dhcp[1099]: DHCP, IP range 192.168.122.2 -- 192.16> | + | Feb 24 02:09:56 sstw dnsmasq-dhcp[8267]: DHCP, IP range 192.168.122.2 -- 192.16> |
| - | Feb 23 07:16:20 sstw dnsmasq-dhcp[1099]: DHCP, sockets bound exclusively to int> | + | Feb 24 02:09:56 sstw dnsmasq-dhcp[8267]: DHCP, sockets bound exclusively to int> |
| - | Feb 23 07:16:20 sstw dnsmasq[1099]: reading / | + | Feb 24 02:09:56 sstw dnsmasq[8267]: reading / |
| - | Feb 23 07:16:20 sstw dnsmasq[1099]: using nameserver 127.0.0.53# | + | Feb 24 02:09:56 sstw dnsmasq[8267]: using nameserver 127.0.0.53# |
| - | Feb 23 07:16:20 sstw dnsmasq[1099]: read /etc/hosts - 7 addresses | + | Feb 24 02:09:56 sstw dnsmasq[8267]: read /etc/hosts - 7 addresses |
| - | Feb 23 07:16:20 sstw dnsmasq[1099]: read / | + | Feb 24 02:09:56 sstw dnsmasq[8267]: read / |
| - | Feb 23 07:16:20 sstw dnsmasq-dhcp[1099]: read / | + | Feb 24 02:09:56 sstw dnsmasq-dhcp[8267]: read / |
| - | Feb 23 07:16:20 sstw dnsmasq[1099]: reading / | + | Feb 24 02:09:56 sstw dnsmasq[8267]: reading / |
| - | Feb 23 07:16:20 sstw dnsmasq[1099]: using nameserver 127.0.0.53# | + | Feb 24 02:09:56 sstw dnsmasq[8267]: using nameserver 127.0.0.53# |
| $ | $ | ||
| $ lsmod | grep -i kvm | $ lsmod | grep -i kvm | ||
| 行 100: | 行 71: | ||
| $ | $ | ||
| </ | </ | ||
| - | + | ===== Step 3: ブリッジの作成 | |
| - | ===== Step 3: Creating a Virtual Machine in Ubuntu | + | <code sh> |
| - | + | $ cat / | |
| + | # This is the network config written by ' | ||
| + | network: | ||
| + | ethernets: | ||
| + | enp3s0: | ||
| + | addresses: | ||
| + | - 192.168.10.4/ | ||
| + | gateway4: 192.168.10.254 | ||
| + | nameservers: | ||
| + | addresses: | ||
| + | - 192.168.10.1 | ||
| + | search: | ||
| + | - ee.ous.ac.jp | ||
| + | version: 2 | ||
| + | $ | ||
| + | </ | ||
| <code sh> | <code sh> | ||
| - | $ qemu-img create | + | $ sudo cp 00-installer-config.yaml 00-installer-config.yaml.org |
| - | Formatting 'ssp0.qcow2', fmt=qcow2 size=161061273600 cluster_size=65536 lazy_refcounts=off refcount_bits=16 | + | $ cat / |
| + | # This is the network config written by 'subiquity' | ||
| + | # Added br0 and moved entries from enp3s0 to br0 | ||
| + | network: | ||
| + | ethernets: | ||
| + | enp3s0: | ||
| + | dhcp4: no | ||
| + | dhcp6: no | ||
| + | version: 2 | ||
| + | bridges: | ||
| + | br0: | ||
| + | interfaces: | ||
| + | - enp3s0 | ||
| + | addresses: | ||
| + | - 192.168.10.4/ | ||
| + | gateway4: 192.168.10.254 | ||
| + | nameservers: | ||
| + | addresses: | ||
| + | - 192.168.10.1 | ||
| + | search: | ||
| + | - ee.ous.ac.jp | ||
| $ | $ | ||
| </ | </ | ||
| <code sh> | <code sh> | ||
| - | ~$ virt-install | + | $ sudo netplan apply |
| + | $ sudo networkctl status | ||
| + | ● State: routable | ||
| + | | ||
| + | 192.168.10.4 on br0 | ||
| + | fe80:: | ||
| + | | ||
| + | DNS: 192.168.10.1 | ||
| + | Search Domains: ee.ous.ac.jp | ||
| + | |||
| + | Feb 24 04:06:09 sstw systemd[1]: systemd-networkd.service: | ||
| + | Feb 24 04:06:09 sstw systemd[1]: Starting Network Service... | ||
| + | Feb 24 04:06:09 sstw systemd-networkd[8895]: | ||
| + | Feb 24 04:06:09 sstw systemd-networkd[8895]: | ||
| + | Feb 24 04:06:09 sstw systemd-networkd[8895]: | ||
| + | Feb 24 04:06:09 sstw systemd[1]: Started Network Service. | ||
| + | Feb 24 04:06:09 sstw systemd-networkd[8895]: | ||
| + | Feb 24 04:06:09 sstw systemd-networkd[8895]: | ||
| + | Feb 24 04:06:09 sstw systemd-networkd[8895]: | ||
| + | Feb 24 04:06:10 sstw systemd-networkd[8895]: | ||
| + | $ ip a | ||
| + | 1: lo: < | ||
| + | link/ | ||
| + | inet 127.0.0.1/8 scope host lo | ||
| + | | ||
| + | inet6 ::1/128 scope host | ||
| + | | ||
| + | 2: enp3s0: < | ||
| + | link/ether 2c: | ||
| + | 3: wlo1: < | ||
| + | link/ether 8c: | ||
| + | 4: virbr0: <NO-CARRIER, | ||
| + | link/ether 52: | ||
| + | inet 192.168.122.1/ | ||
| + | | ||
| + | 5: virbr0-nic: < | ||
| + | link/ether 52: | ||
| + | 6: br0: < | ||
| + | link/ether 2c: | ||
| + | inet 192.168.10.4/ | ||
| + | | ||
| + | inet6 fe80:: | ||
| + | | ||
| + | $ sudo networkctl status br0 | ||
| + | ● 6: br0 | ||
| + | Link File: / | ||
| + | Network File: / | ||
| + | Type: bridge | ||
| + | | ||
| + | Driver: bridge | ||
| + | HW Address: 2c: | ||
| + | MTU: 1500 (min: 68, max: 65535) | ||
| + | | ||
| + | Hello Time: 2s | ||
| + | Max Age: 20s | ||
| + | | ||
| + | Priority: 32768 | ||
| + | STP: no | ||
| + | Multicast IGMP Version: | ||
| + | Queue Length (Tx/Rx): 1/1 | ||
| + | | ||
| + | fe80:: | ||
| + | | ||
| + | DNS: 192.168.10.1 | ||
| + | Search Domains: ee.ous.ac.jp | ||
| + | |||
| + | Feb 24 04:06:09 sstw systemd-udevd[8897]: | ||
| + | Feb 24 04:06:09 sstw systemd-networkd[8895]: | ||
| + | Feb 24 04:06:09 sstw systemd-networkd[8895]: | ||
| + | Feb 24 04:06:09 sstw systemd-networkd[8895]: | ||
| + | Feb 24 04:06:09 sstw systemd-networkd[8895]: | ||
| + | Feb 24 04:06:10 sstw systemd-networkd[8895]: | ||
| + | $ | ||
| - | Starting install... | ||
| - | Domain installation still in progress. You can reconnect to | ||
| - | the console to complete the installation process. | ||
| - | $ | ||
| </ | </ | ||
| - | |||
| - | - Finderから「サーバへ接続」 | ||
| - | - vnc:/ / < | ||
linux/kvm_install.1614131993.txt.gz · 最終更新: (外部編集)