{"id":3756,"date":"2020-10-02T18:44:55","date_gmt":"2020-10-02T09:44:55","guid":{"rendered":"\/blog\/?p=3756"},"modified":"2023-09-21T09:26:38","modified_gmt":"2023-09-21T00:26:38","slug":"centos7-kvm-%ed%99%98%ea%b2%bd-%ea%b5%ac%ec%b6%95","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=3756","title":{"rendered":"CentOS7 KVM \ud658\uacbd \uad6c\ucd95"},"content":{"rendered":"\n<pre class=\"wp-block-syntaxhighlighter-code\">IFACE_NAME=\"ens33\"\nIF_IP_ADDR=\"10.10.10.39\"\nIF_NETMASK=\"255.255.255.0\"\nIF_GATEWAY=\"10.10.10.254\"\n\n#######################################################\n# yum \ud328\ud0a4\uc9c0 \uc124\uce58\n#######################################################\nyum -y install qemu-kvm qemu-img\nyum -y install libvirt libvirt-client virt-install virt-top virt-viewer virt-manager\nyum -y install bridge-utils libguestfs-tools\nsystemctl daemon-reload\nsystemctl enable libvirtd\n\n#######################################################\n# Bridge \ub124\ud2b8\uc6cc\ud06c \uad6c\uc131\n#######################################################\nIFCONFIG_FILE=\/etc\/sysconfig\/network-scripts\/ifcfg-br0\necho \"TYPE=Bridge\" > ${IFCONFIG_FILE}\necho \"DEVICE=br0\" >> ${IFCONFIG_FILE}\necho \"NAME=br0\" >> ${IFCONFIG_FILE}\necho \"ONBOOT=yes\" >> ${IFCONFIG_FILE}\necho \"BOOTPROTO=none\" >> ${IFCONFIG_FILE}\necho \"NM_CONTROLLED=no\" >> ${IFCONFIG_FILE}\necho \"IPADDR=${IF_IP_ADDR}\" >> ${IFCONFIG_FILE}\necho \"NETMASK=${IF_NETMASK}\" >> ${IFCONFIG_FILE}\necho \"GATEWAY=${IF_GATEWAY}\" >> ${IFCONFIG_FILE}\necho \"DNS1=8.8.8.8\" >> ${IFCONFIG_FILE}\necho \"DNS2=8.8.4.4\" >> ${IFCONFIG_FILE}\n\nIFCONFIG_FILE=\/etc\/sysconfig\/network-scripts\/ifcfg-${IFACE_NAME}\necho \"DEVICE=${IFACE_NAME}\" > ${IFCONFIG_FILE}\necho \"NAME=${IFACE_NAME}\" >> ${IFCONFIG_FILE}\necho \"ONBOOT=yes\" >> ${IFCONFIG_FILE}\necho \"BRIDGE=br0\" >> ${IFCONFIG_FILE}\n\n#######################################################\n# virtio \uc708\ub3c4\uc6b0 \ub4dc\ub77c\uc774\ubc84 \ub2e4\uc6b4\ub85c\ub4dc\n#######################################################\nVERTIO_DRV_URL=\"https:\/\/fedorapeople.org\/groups\/virt\/virtio-win\/direct-downloads\/stable-virtio\"\nVERTIO_STABLE_VER=\"0.1.185\"\nmkdir -p \/usr\/share\/virtio-win\nrm -rf \/usr\/share\/virtio-win\/*\nwget -P \/usr\/share\/virtio-win --content-disposition \"${VERTIO_DRV_URL}\/virtio-win.iso\"\nwget -P \/usr\/share\/virtio-win --content-disposition \"${VERTIO_DRV_URL}\/virtio-win_amd64.vfd\"\nmv \/usr\/share\/virtio-win\/virtio-win-${VERTIO_STABLE_VER}.iso \/usr\/share\/virtio-win\/virtio-win.iso\nmv \/usr\/share\/virtio-win\/virtio-win-${VERTIO_STABLE_VER}_amd64.vfd \/usr\/share\/virtio-win\/virtio-win_amd64.vfd\nchown -R qemu:qemu \/usr\/share\/virtio-win<\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[39],"tags":[],"class_list":["post-3756","post","type-post","status-publish","format-standard","hentry","category-os_linux_unix_macos"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3756"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3756\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}