{"id":10061,"date":"2023-04-08T20:43:04","date_gmt":"2023-04-08T11:43:04","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=10061"},"modified":"2023-04-12T20:48:39","modified_gmt":"2023-04-12T11:48:39","slug":"virt-manager%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b%ef%bc%81%ef%bc%88ubuntu-desktop-22-04%ef%bc%89","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/10061","title":{"rendered":"virt-manager\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff01\uff08Ubuntu Desktop 22.04\uff09"},"content":{"rendered":"<p>Ubuntu Desktop 22.04\u306b\u3001virt-manager\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>virt-manager\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff01<\/h2>\n<p>Ubuntu\u306e\u516c\u5f0f\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u3001virt-manager\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo apt install virt-manager bridge-utils\r\n<\/pre>\n<p>\u30b5\u30fc\u30d3\u30b9\u304c\u8d77\u52d5\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo systemctl status libvirtd\r\n\u25cf libvirtd.service - Virtualization daemon\r\n     Loaded: loaded (\/lib\/systemd\/system\/libvirtd.service; enabled; vendor preset: enabled)\r\n     Active: active (running) since Sat 2023-04-08 20:16:17 JST; 20min ago\r\nTriggeredBy: \u25cf libvirtd-admin.socket\r\n             \u25cf libvirtd-ro.socket\r\n             \u25cf libvirtd.socket\r\n       Docs: man:libvirtd(8)\r\n             https:\/\/libvirt.org\r\n   Main PID: 6741 (libvirtd)\r\n      Tasks: 21 (limit: 32768)\r\n     Memory: 10.8M\r\n        CPU: 398ms\r\n     CGroup: \/system.slice\/libvirtd.service\r\n             \u251c\u25006741 \/usr\/sbin\/libvirtd\r\n             \u251c\u25006872 \/usr\/sbin\/dnsmasq --conf-file=\/var\/lib\/libvirt\/dnsmasq\/default.conf --leasefile-ro --dhcp-script=\/usr\/lib\/libvirt\/libvirt_leaseshelper\r\n             \u2514\u25006873 \/usr\/sbin\/dnsmasq --conf-file=\/var\/lib\/libvirt\/dnsmasq\/default.conf --leasefile-ro --dhcp-script=\/usr\/lib\/libvirt\/libvirt_leaseshelper\r\n...\r\n<\/pre>\n<p>\u81ea\u52d5\u8d77\u52d5\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u3082\u78ba\u8a8d\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo systemctl is-enabled libvirtd\r\nenabled\r\n<\/pre>\n<h2>\u5229\u7528\u3059\u308b\u30e6\u30fc\u30b6\u3092libvirt\u30b0\u30eb\u30fc\u30d7\u306b\u767b\u9332\u3059\u308b\uff01<\/h2>\n<p>virt-manager\u3092\u5229\u7528\u3059\u308b\u30e6\u30fc\u30b6\u3092libvirt\u30b0\u30eb\u30fc\u30d7\u306b\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,3]; title: ; notranslate\" title=\"\">\r\n$ sudo gpasswd -a usradmin libvirt\r\nAdding user usradmin to group libvirt\r\n$ grep libvirt \/etc\/group\r\nlibvirt:x:144:usradmin\r\nlibvirt-qemu:x:64055:libvirt-qemu\r\nlibvirt-dnsmasq:x:145:\r\n<\/pre>\n<h2>QEMU\u306e\u8a2d\u5b9a\u3092\u884c\u3046\uff01<\/h2>\n<p>QEMU\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002\u4ee5\u4e0b\u306e2\u884c\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo vi \/etc\/libvirt\/qemu.conf\r\nuser = &quot;usradmin&quot;\r\ngroup = &quot;usradmin&quot;\r\n<\/pre>\n<h2>\u4eee\u60f3\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b\uff01<\/h2>\n<p>\u4eee\u60f3\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u304c\u4f7f\u7528\u53ef\u80fd\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo virsh net-list --all\r\n Name      State    Autostart   Persistent\r\n--------------------------------------------\r\n default   active   yes         yes\r\n<\/pre>\n<p>\u30d6\u30ea\u30c3\u30b8\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\uff01<br \/>\n\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u4f5c\u6210\u3057\u305f\u3068\u304d\u306b\u3001\u30d6\u30ea\u30c3\u30b8\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u304c\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3001\u30d6\u30ea\u30c3\u30b8\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ sudo nmcli con add type bridge ifname vitbr0\r\nConnection 'bridge-vitbr0' (a1940c42-1a28-41ac-9694-5f4e55b9297e) successfully added.\r\n$ sudo nmcli con add type bridge-slave ifname enp2s0 master vitbr0\r\nConnection 'bridge-slave-enp2s0' (5d8c837a-33b2-4bce-b830-3e522916ace0) successfully added.\r\n$ sudo nmcli con up bridge-slave-enp2s0\r\nConnection successfully activated (D-Bus active path: \/org\/freedesktop\/NetworkManager\/ActiveConnection\/9)\r\n$ ip link | grep vitbr0\r\n2: enp2s0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel master vitbr0 state UP mode DEFAULT group default qlen 1000\r\n9: vitbr0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000\r\n$ sudo mkdir -p \/etc\/qemu\r\n$ sudo vi \/etc\/qemu\/bridge.conf\r\nallow vitbr0\r\n$ ls -l \/usr\/lib\/qemu\/qemu-bridge-helper\r\n-rwxr-xr-x 1 root root 308928 Mar  7 05:00 \/usr\/lib\/qemu\/qemu-bridge-helper\r\n$ sudo chmod u+s \/usr\/lib\/qemu\/qemu-bridge-helper\r\n$ ls -l \/usr\/lib\/qemu\/qemu-bridge-helper\r\n-rwsr-xr-x 1 root root 308928 Mar  7 05:00 \/usr\/lib\/qemu\/qemu-bridge-helper\r\n<\/pre>\n<h2>Virtual Machine Manager\u3092\u8d77\u52d5\u3059\u308b\uff01<\/h2>\n<p>Virtual Machine Manager\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/04\/virt-manager_01.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/04\/virt-manager_01.png\" alt=\"\" width=\"613\" height=\"456\" class=\"alignnone size-full wp-image-10067\" srcset=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/04\/virt-manager_01.png 613w, https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/04\/virt-manager_01-300x223.png 300w\" sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/a><\/p>\n<h2>Virtual Machine Manager\u306e\u63a5\u7d9a\u8a2d\u5b9a\u3092\u884c\u3046\uff01<\/h2>\n<p>File\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u300cAdd Connection\u300d\u3092\u9078\u629e\u3057\u3066\u3001Virtual Machine Manager\u304b\u3089\u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u3001\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002\u63a5\u7d9a\u65b9\u6cd5\u3068\u3057\u3066\u3001\u300cQEMU\/KVM user session\u300d\u3092\u9078\u3073\u3001\u300cConnect\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/04\/virt-manager_04.png\"><img loading=\"lazy\" decoding=\"async\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/04\/virt-manager_04.png\" alt=\"\" width=\"380\" height=\"298\" class=\"alignnone size-full wp-image-10073 lazyload\" data-srcset=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/04\/virt-manager_04.png 380w, https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/04\/virt-manager_04-300x235.png 300w\" data-sizes=\"auto, (max-width: 380px) 100vw, 380px\" \/><\/a><br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u308c\u3070\u63a5\u7d9a\u3067\u304d\u3066\u3044\u307e\u3059\u3002\u63a5\u7d9a\u3067\u304d\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u300cNot connected\u300d\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/04\/virt-manager_05.png\"><img loading=\"lazy\" decoding=\"async\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/04\/virt-manager_05.png\" alt=\"\" width=\"613\" height=\"456\" class=\"alignnone size-full wp-image-10077 lazyload\" data-srcset=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/04\/virt-manager_05.png 613w, https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2023\/04\/virt-manager_05-300x223.png 300w\" data-sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/a><\/p>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>virt-manager\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u5408\u308f\u305b\u3066\u3001\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u64cd\u4f5c\u3059\u308bGUI\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002\u4eca\u56de\u306f\u3001GUI\u304b\u3089\u306e\u63a5\u7d9a\u8a2d\u5b9a\u307e\u3067\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu Desktop 22.04\u306b\u3001virt-manager\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":642,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[215],"tags":[],"class_list":["post-10061","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-virt-manager"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/10061","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=10061"}],"version-history":[{"count":14,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/10061\/revisions"}],"predecessor-version":[{"id":10130,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/10061\/revisions\/10130"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/642"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=10061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=10061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=10061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}