{"id":15286,"date":"2026-10-11T06:05:33","date_gmt":"2026-10-11T06:05:33","guid":{"rendered":"https:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/?p=15286"},"modified":"2026-10-11T07:41:03","modified_gmt":"2026-10-11T07:41:03","slug":"%e4%bd%9c%e6%a5%ad%e3%83%a1%e3%83%a2-20261011-libvirt-%e3%82%92%e5%88%a9%e7%94%a8%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/?p=15286","title":{"rendered":"(\u4f5c\u696d\u30e1\u30e2 20261011) libvirt \u3092\u5229\u7528\u3059\u308b"},"content":{"rendered":"<p><a href=\"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/wp-content\/uploads\/2026\/10\/20261011a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/wp-content\/uploads\/2026\/10\/20261011a-150x150.png\" alt=\"\" width=\"150\" height=\"150\" class=\"aligncenter size-thumbnail wp-image-15290\" \/><\/a><\/p>\n<p>virtualbox \u3092 RedHat \u3067\u5229\u7528\u3059\u308b\u306b\u306f\uff0c\u8272\u3005\u3068\u8a2d\u5b9a\u3092\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u4eee\u60f3\u5316\u30c4\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p>https:\/\/docs.redhat.com\/ja\/documentation\/Red_Hat_Enterprise_Linux\/7\/html-single\/Virtualization_Deployment_and_Administration_Guide\/index.html#chap-Installing_the_virtualization_packages<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u63a8\u5968\u3055\u308c\u308b\u4eee\u60f3\u5316\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u3059\u3079\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>yum install virt-install libvirt-python virt-manager virt-install libvirt-client<\/p>\n<p>\u518d\u8d77\u52d5\u3057\u305f\u65b9\u304c\u3088\u3044\u304b\u3082<\/p>\n<p>KVM\u3067\u30b2\u30b9\u30c8OS\u3092\u30d6\u30ea\u30c3\u30b8\u63a5\u7d9a\u3059\u308b<\/p>\n<p>https:\/\/qiita.com\/yoshiyasu1111\/items\/8d07a4fd55116fba07f7<\/p>\n<p>\u30b2\u30b9\u30c8\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u624b\u52d5\u3067\u8a2d\u5b9a\u3057\u3066\u3082\u3001\u3059\u3050\u306bDHCP\u304b\u3089\u3082\u3089\u3046\u3088\u3046\u306b\u5909\u66f4\u3055\u308c\u308b\u30c8\u30e9\u30d6\u30eb\u306b\u906d\u9047\u3002\u30d6\u30ea\u30c3\u30b8\u306e\u554f\u984c\u304b\u3068\u601d\u3063\u305f\u304c\u3001\u30b2\u30b9\u30c8\u306e\u8a2d\u5b9a\u306e\u554f\u984c\u3060\u3063\u305f\u3002Netplan\u306b\u3088\u308bDHCP\u306e\u5b8c\u5168\u7121\u52b9\u5316\u624b\u9806<\/p>\n<p>ls \/etc\/netplan\/<br \/>\n\u4f8b\uff1a01-network-manager-all.yaml \u3084 50-cloud-init.yaml \u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u540d\u304c\u8868\u793a\u3055\u308c\u307e\u3059<\/p>\n<p>\u305d\u308c\u3089\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<br \/>\ndhcp4: true\uff08\u307e\u305f\u306f yes\uff09\u306b\u306a\u3063\u3066\u3044\u308b\u90e8\u5206\u3092 false \u306b\u5909\u66f4\u3059\u308b\u306e\u304c\u3001DHCP\u3092\u30aa\u30d5\u306b\u3059\u308b\u6838\u5fc3\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u4e0a\u8a18\u306e\u30c8\u30e9\u30d6\u30eb\u306f ubntu26 \u3060\u3051\u306e\u8a71\u304b\u3082\u3057\u308c\u306a\u3044\u3002<br \/>\n\u5f8c\u306e\u8a71\u3060\u304c\u3001ubuntu24\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u5909\u63db\u3057\u305f\u6642\u306b\u306f\u3001netplan\u306e\u5909\u66f4\u306f\u3057\u306a\u304f\u3066\u3082\u3088\u304b\u3063\u305f\u3002<\/p>\n<p>\u65e2\u5b58\u306evirtualbox\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u79fb\u884c\u3059\u308b\u3002 \u5148\u306b\u3001virtualbox\u306e\u62e1\u5f35\u6a5f\u80fd\u306e\u30c9\u30e9\u30a4\u30d0\u30fc\u3092\u524a\u9664\u3057\u305f\u3002<\/p>\n<p>ubuntu\u4e0a\u3067VirtualBox\u306eguest additions\u3092\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"t3xy94PlL3\"><p><a href=\"https:\/\/wp2.trojanbear.net\/2270.html\">ubuntu\u4e0a\u3067VirtualBox\u306eguest additions\u3092\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;ubuntu\u4e0a\u3067VirtualBox\u306eguest additions\u3092\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5&#8221; &#8212; \u3068\u308d\u30c6\u30af\" src=\"https:\/\/wp2.trojanbear.net\/2270.html\/embed#?secret=nZvIaskyP4#?secret=t3xy94PlL3\" data-secret=\"t3xy94PlL3\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>virtualbox \u306e\u30a4\u30e1\u30fc\u30b8\u30c7\u30a3\u30b9\u30af\u3092\u5909\u63db\u3057\u305f\u3002<br \/>\nqemu-img convert -f vdi -O qcow2 source.vdi destination.qcow2<\/p>\n<p>\u3053\u306e\u5f8c\u3067\u540c\u3058\u3088\u3046\u306b windows \u306e\u30c7\u30a3\u30b9\u30af\u30a4\u30e1\u30fc\u30b8\u3092\u5909\u63db\u3057\u3066\u5229\u7528\u3057\u3088\u3046\u3068\u3057\u305f\u3089\u3001\u30cf\u30fc\u30c9\u304c\u5909\u66f4\u3055\u308c\u305f\u3068\u5224\u65ad\u3055\u308c\u3066\u30e9\u30a4\u30bb\u30f3\u30b9\u8a8d\u8a3c\u304c\u5207\u308c\u305f\u3002\u3053\u308c\u306f\u6ce8\u610f\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u3053\u306e\u5f8c\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u969b\u306b\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u6a29\u9650\u3067\u82e6\u52b4\u3057\u305f\u3002\/var\/lib\/libvirt\/images\/ \u4ee5\u5916\u306e\u5834\u6240\u306b \u30c7\u30a3\u30b9\u30af\u30a4\u30e1\u30fc\u30b8\u3092\u7f6e\u3053\u3046\u3068\u3057\u305f\u304c\u3001\u8d77\u52d5\u306e\u5ea6\u306b\u6bce\u56de\u4e0b\u8a18\u306e\u3088\u3046\u306b\u30a2\u30af\u30bb\u30b9\u6a29\u9650\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u751f\u3058\u308b\u3002<\/p>\n<p>chmod +x \/run\/media\/\u30e6\u30fc\u30b6\u30fc\u540d<br \/>\nchown -R qemu:qemu \/run\/media\/\u30e6\u30fc\u30b6\u30fc\u540d\/backup\/virtual-machine\/ubuntu24web<\/p>\n<p>\u7d50\u5c40\u3001\u30c7\u30a3\u30b9\u30af\u30a4\u30e1\u30fc\u30b8\u3092 \/var\/lib\/libvirt\/images\/ \u306b\u7f6e\u304f\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n<p>\u3053\u306eredhat\u306f\u304a\u307e\u304b\u305b\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u304c\u3001\/home\u306e\u9818\u57df\u304c\u5e83\u3059\u304e\u3066\u4eee\u60f3\u306e\u30c7\u30a3\u30b9\u30af\u30a4\u30e1\u30fc\u30b8\u3092\u7f6e\u304f\u30b9\u30da\u30fc\u30b9\u304c\u5341\u5206\u3067\u306f\u306a\u304b\u3063\u305f\u3002\u305d\u308c\u3067\/var\/lib\/libvirt\/images \u306e\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u3092 \/home \u306b\u4f5c\u6210\u3057\u305f\u3002\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30b3\u30de\u30f3\u30c9\u3067\u3042\u308b\u3002<\/p>\n<p>ln -s \/var\/lib\/libvirt\/images\/ \/home\/\u30e6\u30fc\u30b6\u30fc\u540d\/libvirt\/images\/<\/p>\n<p>\u305d\u308c\u306b\u5f53\u305f\u3063\u3066\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30af\u30bb\u30b9\u6a29\u3092\u518d\u73fe\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3068\u601d\u3046\u306e\u3067\u3001\u5148\u306b\u8abf\u3079\u3066\u304a\u3044\u305f\u3002<\/p>\n<p>\u30d5\u30a9\u30eb\u30c0\u30fc\u306f\u4e0b\u8a18\u3002<\/p>\n<p>root@localhost:\/var\/lib\/libvirt# ls -l<br \/>\n\u5408\u8a08 0<br \/>\ndrwx&#8211;x&#8211;x. 2 root root   6  6\u6708 12 09:00 boot<br \/>\ndrwxr-xr-x. 2 root root 116  9\u6708 14 01:52 dnsmasq<br \/>\ndrwx&#8211;x&#8211;x. 2 root root   6  6\u6708 12 09:00 filesystems<br \/>\ndrwx&#8211;x&#8211;x. 2 root root  54  9\u6708 23 02:49 images<br \/>\ndrwx&#8212;&#8212;. 2 root root   6  6\u6708 12 09:00 network<br \/>\ndrwxr-x&#8211;x. 9 qemu qemu 104 10\u6708 10 19:37 qemu<br \/>\ndrwx&#8211;x&#8211;x. 2 root root   6  6\u6708 12 09:00 swtpm<\/p>\n<p>\u30c7\u30a3\u30b9\u30af\u30a4\u30e1\u30fc\u30b8\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u4e0b\u8a18\u3002<\/p>\n<p>root@localhost:\/var\/lib\/libvirt# cd .\/images\/<br \/>\nroot@localhost:\/var\/lib\/libvirt\/images# ls -l<br \/>\n\u5408\u8a08 37017028<br \/>\n-rw&#8212;&#8212;-. 1 qemu qemu 23829020672 10\u6708 10 19:36 xxx.qcow2<\/p>\n<pre><code style=\"color: midnightblue; font-size: 12px; white-space: pre-wrap;\"><\/code><\/pre>\n<pre><code style=\"color: midnightblue; font-size: 12px; white-space: pre-wrap;\"><\/code><\/pre>\n<pre><code style=\"color: midnightblue; font-size: 12px; white-space: pre-wrap;\"><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>virtualbox \u3092 RedHat \u3067\u5229\u7528\u3059\u308b\u306b\u306f\uff0c\u8272\u3005\u3068\u8a2d\u5b9a\u3092\u3057\u306a\u3051\u308c\u3070\u306a &#8230; <a class=\"more-link\" href=\"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/?p=15286\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-15286","post","type-post","status-publish","format-standard","hentry","category-column"],"_links":{"self":[{"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/15286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15286"}],"version-history":[{"count":6,"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/15286\/revisions"}],"predecessor-version":[{"id":15293,"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/15286\/revisions\/15293"}],"wp:attachment":[{"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15286"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}