{"id":1793,"date":"2013-11-06T21:40:06","date_gmt":"2013-11-07T01:40:06","guid":{"rendered":"http:\/\/protofusion.org\/wordpress\/?p=1793"},"modified":"2014-03-11T11:06:41","modified_gmt":"2014-03-11T16:06:41","slug":"installing-webvirtmgr-on-arch-linux","status":"publish","type":"post","link":"http:\/\/protofusion.org\/wordpress\/2013\/11\/installing-webvirtmgr-on-arch-linux\/","title":{"rendered":"Installing WebVirtMgr on Arch Linux"},"content":{"rendered":"<p><a href=\"http:\/\/protofusion.org\/wordpress\/wp-content\/uploads\/2013\/11\/webvirtmgr.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1801\" alt=\"WebVirtMgr Overview Page\" src=\"http:\/\/protofusion.org\/wordpress\/wp-content\/uploads\/2013\/11\/webvirtmgr-500x313.png\" width=\"500\" height=\"313\" srcset=\"http:\/\/protofusion.org\/wordpress\/wp-content\/uploads\/2013\/11\/webvirtmgr-500x313.png 500w, http:\/\/protofusion.org\/wordpress\/wp-content\/uploads\/2013\/11\/webvirtmgr-300x188.png 300w, http:\/\/protofusion.org\/wordpress\/wp-content\/uploads\/2013\/11\/webvirtmgr.png 972w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p>WebVirtMgr is an awesome simple web interface for managing virtual machines on Linux. Unfortunately the installation process is not simple at all, and the documentation is a bit lacking. There are also a few issues which are documented only in the bugtracker and not the documentation, as well as some Arch-specific issues. I&#8217;ve compiled all of the fixes I&#8217;ve discovered below, so hopefully your install process won&#8217;t be as painful as mine.<\/p>\n<p><em>Updated 2\/19\/14 to reflect bugfixes and updates<\/em><br \/>\n<em>Updated 3\/11\/14 for code and package updates<\/em><\/p>\n<p><!--more--><\/p>\n<h2>Prereqs<\/h2>\n<p>First, make sure you have novnc installed, which is currently available from the AUR. Install it manually or use your favorite AUR helper.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">packer -S novnc gunicorn<\/pre>\n<p>The backend of this web interface runs on libvirtd, which must be installed, along with some optional dependencies:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">pacman -S libvirt urlgrabber qemu dnsmasq bridge-utils ebtables dmidecode python2-django<\/pre>\n<p>Next, edit the configuration file <em>\/etc\/conf.d\/libvirt<\/em> and add <em>&#8211;listen<\/em> to the args:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">LIBVIRTD_ARGS=&quot;-p \/var\/run\/libvirt.pid --listen&quot;<\/pre>\n<p>Now edit <em>\/etc\/libvirt\/libvirtd.conf<\/em>. Disable tls, enable tcp, set auth to sasl. Everything else should be commented out for simple configurations.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nauth_tcp = &quot;sasl&quot;\r\nlisten_tls = 0\r\nlisten_tcp = 1\r\n<\/pre>\n<p>Edit <em>\/etc\/libvirt\/qemu.conf<\/em> and make sure that vnc_listen is set to listen on all addresses.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nvnc_listen = 0.0.0.0\r\n<\/pre>\n<p><strong>You may want to enable additional VNC options which may solve VNC encryption problems I discuss below. Let me know if this works for you!<\/strong><\/p>\n<p>Now start the libvirtd service:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nsystemctl enable libvirtd\r\nsystemctl start libvirtd\r\n<\/pre>\n<h2>Installation<\/h2>\n<p>Clone the git repository to \/var\/www\/webvirtmgr and then change the owner to http<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">git clone git:\/\/github.com\/retspen\/webvirtmgr.git<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"> chown -R http:http \/var\/www\/webvirtmgr<\/pre>\n<p>Next, edit manage.py and change &#8220;python&#8221; in the first line to &#8220;python2&#8221;. Alternatively, use one of the <a href=\"https:\/\/wiki.archlinux.org\/index.php\/python#Dealing_with_version_problem_in_build_scripts\" target=\"_blank\">other official methods<\/a> of dealing with multiple versions of python on Arch Linux.<\/p>\n<p>Run manage.py to generate the database and create credentials.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">.\/manage.py syncdb<\/pre>\n<h2>Apache Config<\/h2>\n<p><strong>This section is incomplete, Apache now just needs to proxypass the gunicorn server from localhost:8000<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nPut configuration for proxypass here\r\n<\/pre>\n<p>Make sure you include this conf file in your main apache config by adding this line to <em>\/etc\/httpd\/conf\/httpd.conf<\/em><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">Include conf\/extra\/webvirtmgr.conf<\/pre>\n<p>Finally, restart apache so your changes take effect<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">systemctl restart httpd.service<\/pre>\n<h2>Gunicorn Server<\/h2>\n<p>WebVirtMgr is now served with <em>gunicorn<\/em>. The developer launches this service with supervisor to overcome limitations of initscript-based systems, but systemd fills this need nicely> I wrote a simple service file to handle webvirtmgr:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;Unit]\r\nDescription=WebVirtMgr Gunicorn Server\r\n\r\n&#x5B;Service]\r\nUser=http\r\nGroup=http\r\nExecStart=\/usr\/bin\/env python2 \/srv\/webvirtmgr\/manage.py run_gunicorn -c \/var\/www\/webvirtmgr\/conf\/gunicorn.conf.py\r\nType=simple\r\nRestart=on-failure\r\n\r\n&#x5B;Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n<p>Copy this file to \/usr\/lib\/systemd\/system\/webvirtmgr.service and start the service!<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nsystemctl enable webvirtmgr.service\r\nsystemctl start webvirtmgr.service\r\n<\/pre>\n<h2>Add Users<\/h2>\n<p>Adding users is currently done on the command line. Use this command to add the user &#8220;joe&#8221;:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">saslpasswd2 -a libvirt joe<\/pre>\n<h2>NoVNC Configuration<\/h2>\n<p>For easy remote control of your virtual machines, you probably want to use the <em>novnc<\/em> feature of WebVirtMgr.<\/p>\n<p>First, edit <em>\/var\/www\/webvirtmgr\/console\/webvirtmgr-novnc<\/em> and replace &#8220;python&#8221; on the first line with &#8220;python2&#8221; or use the alternative method(s) as mentioned above.<\/p>\n<p>Copy the service from conf\/initd\/webvirtmgr-novnc-arch to \/usr\/lib\/systemd\/system\/webvirtmgr-novnc.service (make sure to include the .service extension which is omitted in the repository).<\/p>\n<p>Next, create a systemd service file in <em>\/etc\/systemd\/system\/webvirtmgr-novnc.service<\/em><\/p>\n<p>Now enable and start the service you just created.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">systemctl enable webvirtmgr-novnc.service<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">systemctl start webvirtmgr-novnc.service<\/pre>\n<h2>NoVNC Encryption Fix<\/h2>\n<p><strong>This issue is now resolved, see the <a href=\"https:\/\/github.com\/retspen\/webvirtmgr\/issues\/58\" target=\"_blank\">github issue<\/a> for details.<\/strong><\/p>\n<p>NoVNC doesn&#8217;t work with SSL because encryption is automatically enabled, which fails for some reason. To disable encryption, edit templates\/console.html and force set encrypt to false.<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nrfb = new RFB({'target':       $D('noVNC_canvas'),\r\n               'encrypt': false,\r\n               'repeaterID':   WebUtil.getQueryVar('repeaterID', ''),\r\n<\/pre>\n<h2>Use the Interface<\/h2>\n<p>Navigate to the virtual host you configured and you should be greeted with a web interface! If you have any issues, feel free to leave a comment below.<\/p>\n<h2>Other Items<\/h2>\n<p>There were a few things I didn&#8217;t cover which are covered by WebVirtMgr&#8217;s actual documentation, such as <strong>configuring your firewall<\/strong> and <strong>verifying that libvirt is working properly<\/strong>. I strongly recommend you take a look at <a href=\"https:\/\/www.webvirtmgr.net\/docs\/\" target=\"_blank\">their documentation<\/a> (especially the last two sections).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WebVirtMgr is an awesome simple web interface for managing virtual machines on Linux. Unfortunately the installation process is not simple at all, and the documentation is a bit lacking. There are also a few issues which are documented only in<span class=\"ellipsis\">&hellip;<\/span><\/p>\n<div class=\"read-more\"><a href=\"http:\/\/protofusion.org\/wordpress\/2013\/11\/installing-webvirtmgr-on-arch-linux\/\">Read more &#8250;<\/a><\/div>\n<p><!-- end of .read-more --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kadence_starter_templates_imported_post":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[201,261,199,200,197],"class_list":["post-1793","post","type-post","status-publish","format-standard","hentry","category-linux","tag-arch-linux","tag-python","tag-virtual-machines","tag-vm","tag-webvirtmgr"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pNjAs-sV","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/posts\/1793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/comments?post=1793"}],"version-history":[{"count":23,"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/posts\/1793\/revisions"}],"predecessor-version":[{"id":1911,"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/posts\/1793\/revisions\/1911"}],"wp:attachment":[{"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/media?parent=1793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/categories?post=1793"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/protofusion.org\/wordpress\/wp-json\/wp\/v2\/tags?post=1793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}