0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Ubuntu22.04 + KVM + Cockpit

Posted at

構築手順

LVMを構築してる場合

$ sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
$ sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

仮想化対応CPUか確認

$ egrep -c '(vmx|svm)' /proc/cpuinfo

KVMの構築

$ apt install -y qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients bridge-utils

libvirtの構築

$ sudo systemctl enable --now libvirtd
$ sudo systemctl start libvirtd
$ sudo systemctl status libvirtd

一般ユーザーでkvmを操作できるようにする

$ sudo usermod -aG kvm $USER
$ sudo usermod -aG libvirt $USER

cockpitのセットアップ

sudo apt install cockpit -y
sudo systemctl status cockpit
sudo systemctl start cockpit
sudo systemctl status cockpit

アクセス

https://{IPアドレス}:9090/

netplanからNetworkManagerに変更

$ sudo vim /etc/netplan/00-installer-config.yaml 

以下のように変更する(version以外をコメントアウトし、renderer: NetworkManagerを追加)

# This is the network config written by 'subiquity'
network:
  #  ethernets:
  #  enp1s0:
  #    dhcp4: true
  renderer: NetworkManager
  version: 2

ネットワークの設定を適用

$ sudo netplan generate
$ sudo systemctl restart NetworkManager

bridgeネットワークの作成

WebGUIから設定。ブリッジの作成時、ネットワークの疎通が取れなくなる。そのため、DHCPがない環境において、ホストのネットワークにブリッジを参加させる構成の場合は、一度ブリッジに対してホストネットワークのIPを割り当ててから、ブリッジを作成しなければならない。

仮想マシンプラグインの設定

$ sudo apt install cockpit-machines
参考文献

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?