{"id":259785,"date":"2015-06-21T18:43:02","date_gmt":"2015-06-21T14:43:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=259785"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=259785","title":{"rendered":"Howto Qemu-kvm Debian 8"},"content":{"rendered":"<p>     \t\u0412 \u044d\u0442\u043e\u043c howto \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e, \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440 Qemu-KVM \u0432 debian 8. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/qemu.weilnetz.de\/icon\/alex\/logo1.svg\" alt=\"image\"\/><\/p>\n<p>  \u0411\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0432 qemu-kvm \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f username, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f spice, qxl \u0438 virtio.<br \/>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Debian 8 amd64, \u0441 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 tasksel \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438 \u0438 SSH \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0414\u043e\u0443\u0441\u0442\u043e\u043d\u043e\u0432\u0438\u043c.<\/p>\n<pre><code class=\"bash\">aptitude install -y firmware-linux bridge-utils etckeeper <\/code><\/pre>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043b\u0438 \u043d\u0430\u0448 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e:  <\/p>\n<pre><code class=\"bash\">egrep '(vmx|svm)' \/proc\/cpuinfo <\/code><\/pre>\n<p>  \u0412\u043a\u043b\u044e\u0447\u0438\u043c \u0444\u043e\u0440\u0432\u0430\u0440\u0434\u0438\u043d\u0433, <i>net.ipv4.ip_forward=1<\/i>  <\/p>\n<pre><code class=\"bash\">vim \/etc\/sysctl.conf <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043e\u0441\u0442 br0<br \/>  \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u0432\u0438\u0434 <i>\/etc\/network\/interfaces<\/i>  <\/p>\n<pre><code class=\"bash\"># The loopback network interface auto lo iface lo inet loopback  # The primary network interface #auto eth0 #allow-hotplug eth0 #iface eth0 inet dhcp  auto br0 iface br0 inet dhcp         bridge_ports eth0         bridge_stp off         bridge_fd 0         bridge_maxwait 0 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">\/etc\/init.d\/networking restart <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0435 \u00abbr0 8000.08608ee7dc58 no eth0\u00bb  <\/p>\n<pre><code class=\"bash\">brctl show  <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u043e\u0441\u0442, \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f vnetX \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b  <\/p>\n<pre><code class=\"bash\">tcpdump -i vnet0 -n <\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c kvm:  <\/p>\n<pre><code class=\"bash\">aptitude install qemu-kvm libvirt-bin <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0433\u0440\u0443\u043f\u043f\u044b kvm:  <\/p>\n<pre><code class=\"bash\">adduser username kvm adduser username libvirt <\/code><\/pre>\n<p>  \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043b\u044f spice \u0438 \u0441\u043c\u0435\u043d\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c:  <\/p>\n<pre><code class=\"bash\">vim \/etc\/libvirt\/qemu.conf <\/code><\/pre>\n<p>  <i>spice_listen = \u00ab0.0.0.0\u00bb<br \/>  user = \u00abusername\u00bb<br \/>  group = \u00abusername\u00bb<\/i><\/p>\n<p>  \u041f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443 \u0432\u0441\u0435\u0433\u043e \u0433\u043e\u0442\u043e\u0432\u043e \u043a \u0440\u0430\u0431\u043e\u0442\u0435. <br \/>  \u0411\u0435\u0437 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d \u0445\u043e\u0441\u0442-\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 ~150 mb ram<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c &#8212; \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445<\/b><\/p>\n<div class=\"spoiler_text\">GUI \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0440\u044f\u0434\u0430 \u0437\u0430\u0434\u0430\u0447 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 kvm. <br \/>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435, \u0437\u0430\u043f\u0443\u0441\u043a\/\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430, \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u043f\u043e\u0447\u0442\u0438 \ud83d\ude42 \u0432\u0441\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>  \u041d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c:  <\/p>\n<pre><code class=\"bash\">aptitude install ssh-askpass virt-manager virt-viewer spice-client-gtk <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c virt-manager.<br \/>  \u0424\u0430\u0439\u043b -&gt; \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 -&gt; \u0413\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440: QEMU\/KVM \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0445\u043e\u0441\u0442\u0443 \u043f\u043e\u0434 \u043d\u0430\u0448\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c username. \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 openssh-askpass.<br \/>  \u041f\u0440\u0430\u0432\u043a\u0430 -&gt; \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u2014 \u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435<br \/>  \u0422\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u043c\u0438 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e\u0437\u0434\u0430\u0442\u044c qemu-iso-storage \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0442\u0443\u0434\u0430 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u044b \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u043d\u0443\u0436\u0434. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"http:\/\/sourceforge.net\/projects\/gparted\/files\/gparted-live-stable\/\">sourceforge.net\/projects\/gparted\/files\/gparted-live-stable<\/a> <\/p>\n<p>  \u041a \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0432\u0438\u0432\u0435\u0440\u043e\u043c \u0441\u043e \u0432\u0441\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 spice.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0437\u043d\u0430\u0442\u044c URI \u0434\u043e\u043c\u0435\u043d\u0430\/\u0432\u0438\u0440\u0442.\u043c\u0430\u0448\u0438\u043d\u044b \u043d\u0430 kvm  <\/p>\n<pre><code class=\"bash\">virsh domdisplay corn <\/code><\/pre>\n<p>  \u041d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c:  <\/p>\n<pre><code class=\"bash\">remote-viewer spice:\/\/10.1.1.1:5905  <\/code><\/pre>\n<p>  \u0422\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u0440\u0443\u0433\u0438\u043c \u0432\u0438\u0432\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 spice-client-gtk:  <\/p>\n<pre><code class=\"bash\">spicy -h 10.1.1.1 -p 5905 <\/code><\/pre>\n<p>  \u0412 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0431\u0430\u0433.<br \/>  \u0412 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445, \u0433\u0434\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c spice-\u0441\u0435\u0440\u0432\u0435\u0440 \u0438\u043b\u0438 vnc-\u0441\u0435\u0440\u0432\u0435\u0440, \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u044b\u0431\u0440\u0430\u0442\u044c spice, \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0432 TLS. <br \/>  \u0421\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 TLS \u0432 qemu \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438, \u0441\u043e\u043e\u0432\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e.<br \/>  \u0415\u0441\u043b\u0438 TLS \u043f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0438\u0440\u0443\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0441 vnc-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u0447\u0442\u043e \u0431\u044b \u0432 <i>\/etc\/libvirt\/qemu\/<\/i> \u0441\u043e\u0437\u0434\u0430\u043b\u0441\u044f <i>corn.xml<\/i> \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u043d\u0435\u043c \u0441\u0435\u043a\u0446\u0438\u044e <i>&lt;graphics\u2026 \/&gt;<\/i> \u043d\u0430 spice \u0441 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u044b\u043c TLS.  <\/p>\n<pre><code class=\"bash\"> &lt;graphics type='spice' port='5909' autoport='no' listen='0.0.0.0'&gt;       &lt;listen type='address' address='0.0.0.0'\/&gt;  &lt;\/graphics&gt; <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c TLS \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0442\u0443\u0442 \u2014 <a href=\"http:\/\/habrahabr.ru\/post\/221693\/\">habrahabr.ru\/post\/221693<\/a>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 root <\/p>\n<p>  \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0443\u043b\u044b \u2014 \u0433\u0434\u0435 \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c <br \/>  \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 storage \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0442\u0443\u0442 \/etc\/libvirt\/storage\/<br \/>  \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0435\u0441\u0442\u044c default.xml \u2014 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432 \/var\/lib\/libvirt\/images<br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0432\u043e\u0435 qemu-test-storage:<br \/>  *-as \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435 \u0434\u0435\u0444\u043e\u043b\u0442\u0443, \u0442.\u0435. \u043f\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u043a\u0430\u043a \u0432 default.xml  <\/p>\n<pre><code class=\"bash\">virsh pool-define-as qemu-test-storage dir --target \/home\/robot\/qemu-test-storage\/ <\/code><\/pre>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0443\u043b \u043d\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d, \u0441\u0442\u0430\u0440\u0442\u0443\u0435\u043c:  <\/p>\n<pre><code class=\"bash\">virsh pool-start qemu-test-storage <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u043b \u0432 \u0430\u0432\u0442\u043e\u0441\u0442\u0430\u0440\u0442:  <\/p>\n<pre><code class=\"bash\">virsh pool-autostart qemu-test-storage <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u043f\u0443\u043b\u044b:  <\/p>\n<pre><code class=\"bash\">virsh pool-list --all <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u0434\u043e\u043c\u0435\u043d\u044b:  <\/p>\n<pre><code class=\"bash\">virsh list --all <\/code><\/pre>\n<p>  \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0434\u043e\u043c\u0435\u043d (\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443) \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432 \u0444\u0430\u0439\u043b\u0435 <i>corn.xml<\/i><br \/>  \u0421\u043e\u0437\u0434\u0430\u0442\u044c <i>xml<\/i> \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430) \u043f\u0440\u043e\u0449\u0435 \u0447\u0435\u0440\u0435\u0437 <i>virt-manager<\/i>, \u0447\u0435\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043e\u043f\u0446\u0438\u044e \u0432 virt-install.<br \/>  \u0412\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0440\u0443\u0446\u0438\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 <i>\/etc\/libvirt\/qemu\/ <\/i><br \/>  \u0412\u043e\u043e\u0431\u0449\u0435\u043c, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b.  <\/p>\n<pre><code class=\"bash\">virsh define \/home\/robot\/anyfolder\/corn.xml <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043c\u0435\u043d \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443:  <\/p>\n<pre><code class=\"bash\">virsh autostart corn <\/code><\/pre>\n<p>  \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0434\u043e\u043c\u0435\u043d\u0430:  <\/p>\n<pre><code class=\"bash\">virsh dumpxml corn <\/code><\/pre>\n<p>  \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u043e\u043c\u0435\u043d:  <\/p>\n<pre><code class=\"bash\">virsh edit corn <\/code><\/pre>\n<p>  \u0421\u0442\u0430\u0440\u0442\u0443\u0435\u043c \u0434\u043e\u043c\u0435\u043d, \u0441\u043c\u043e\u0442\u0440\u0438\u043c URI \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043b\u044e\u0431\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c.  <\/p>\n<pre><code class=\"bash\">virsh start corn virsh domdisplay corn <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c windows \u043d\u0430 VirtIO \u0440\u0430\u0437\u0434\u0435\u043b, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0449\u0438\u043a\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 viostor \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0430 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 virtio for windows.<br \/>  \u041d\u0430 linux-kvm.org \u043b\u0435\u0436\u0430\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u043d\u0430 fedoraproject.org \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u043e\u0431\u0440\u0430\u043d\u044b\u0435 virt-win.iso <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043c \u0442\u043e\u043c \u0434\u043e\u043c\u0435\u043d\u0430.<br \/>  \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f qemu-img \u2014 QEMU disk image utility. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e\u043c corn.qcow2<br \/>  \u041d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u2014 windows 7 \u043c\u0430\u043b\u043e 10GB, \u0447\u0442\u043e \u0431\u044b \u0440\u0430\u0437\u043e\u043c \u0432\u044b\u043a\u0430\u0447\u0430\u0442\u044c \u0432\u0441\u0435 \u0438\u0437 \u0446\u0435\u043d\u0442\u0440\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c.<br \/>  \u0411\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u00ab\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Windows 7 (KB2852386)\u00bb \u2014 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0445\u0443\u0434\u043e-\u0431\u0435\u0434\u043d\u043e (\u0447\u0438\u0442\u0430\u0439, \u043d\u0438\u043a\u0430\u043a) \u043e\u0447\u0438\u0449\u0430\u0442\u044c C:\\Windows\\winxsx \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u00ab\u043e\u0447\u0438\u0441\u0442\u043a\u0443 \u0434\u0438\u0441\u043a\u0430\u00bb \u0438 \u043c\u0435\u0436\u0434\u0443 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430\u043c\u0438, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043d\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439. <\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b:  <\/p>\n<pre><code class=\"bash\">cd  \/home\/username\/qemu-qcow2-storage\/ qemu-img info corn.qcow2 qemu-img check corn.qcow2 <\/code><\/pre>\n<p>  \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e:  <\/p>\n<pre><code class=\"bash\">qemu-img resize qemu-qcow2-storage\/corn.qcow2 +10GB <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e CD-ROM, \u00ab\u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0443\u0434\u0430 <a href=\"http:\/\/gparted.org\/download.php\">gparted<\/a>\u00bb \u0438 \u0432\u0441\u0435 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e. \u0420\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u2014 24.<br \/>  \u041f\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c libguestfs-tools \u0438\u043b\u0438 resize2fs<\/p>\n<p>  \u0414\u043b\u044f Windows 8.1 \u043d\u0443\u0436\u0435\u043d wddm \u0434\u0440\u0430\u0439\u0432\u0435\u0440, QXL \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, <a href=\"http:\/\/habrahabr.ru\/post\/211909\/\">\u043b\u0443\u0447\u0448\u0435 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0432\u0438\u0434\u0435\u043a\u0430\u0440\u0442\u0443 \u0445\u043e\u0441\u0442\u0430<\/a><br \/>  \u041f\u0440\u043e OEM-\u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f Windows \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0442\u0443\u0442 \u2014 <a href=\"http:\/\/habrahabr.ru\/post\/247597\/\">habrahabr.ru\/post\/247597<\/a> <\/p>\n<p>  \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e.     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/260791\/\"> http:\/\/habrahabr.ru\/post\/260791\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u0412 \u044d\u0442\u043e\u043c howto \u043c\u044b \u0441 \u0432\u0430\u043c\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e, \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440 Qemu-KVM \u0432 debian 8. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/qemu.weilnetz.de\/icon\/alex\/logo1.svg\" alt=\"image\"\/><\/p>\n<p>  \u0411\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0432 qemu-kvm \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f username, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f spice, qxl \u0438 virtio.<br \/>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Debian 8 amd64, \u0441 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 tasksel \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438 \u0438 SSH \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0414\u043e\u0443\u0441\u0442\u043e\u043d\u043e\u0432\u0438\u043c.<\/p>\n<pre><code class=\"bash\">aptitude install -y firmware-linux bridge-utils etckeeper <\/code><\/pre>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-259785","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/259785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=259785"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/259785\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=259785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=259785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}