{"id":8236,"date":"2018-03-06T16:30:59","date_gmt":"2018-03-06T13:30:59","guid":{"rendered":"http:\/\/trueconf.com\/blog\/?p=8236"},"modified":"2025-11-25T14:06:39","modified_gmt":"2025-11-25T11:06:39","slug":"configure-xen-hypervisor-ubuntu-server-14-4-05","status":"publish","type":"post","link":"https:\/\/trueconf.com/blog\/knowledge-base\/configure-xen-hypervisor-ubuntu-server-14-4-05","title":{"rendered":"How to configure Xen hypervisor on Ubuntu Server 14.4.05?"},"content":{"rendered":"<p class=\"primary-medium-text ui-mb-sm-1\"><a href=\"https:\/\/trueconf.com\/products\/server\/video-conferencing-server.html\" target=\"_blank\" rel=\"noopener\">TrueConf Server<\/a> can be run on a virtual machine. However, it is complex and inadvisable to implement for inexperienced users, as enabling a virtual machine to operate correctly can be quite difficult at times.<\/p>\n<p>This manual will teach you how to configure\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Xen\" target=\"_blank\" rel=\"noopener\">Xen<\/a> <a href=\"https:\/\/en.wikipedia.org\/wiki\/Hypervisor\" target=\"_blank\" rel=\"noopener\">hypervisor<\/a> on Ubuntu Server 14.04.05 Server x86-64.<\/p>\n<div class=\"accent-note accent-note--line ui-mb-sm-1\">\n<p class=\"primary-medium-text\">This article is for informational purposes only and does not necessarily guarantee full server operation after taking all the steps. TrueConf Technical Support <b>does not advise<\/b> users on configuring virtual machines and running TrueConf Server on them. A virtual machine is an external system, which does not depend on TrueConf application. Its configuration and support are entirely user\u2019s responsibility.<\/p>\n<\/div>\n<h2 id=\"install_xen\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Step 1: Install Xen and configure the bootloader<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1\">First you need to update system packages:<\/p>\n<pre class=\"lang:default decode:true\">$ sudo apt-get update &amp;&amp; sudo apt-get upgrade<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">After that, install Xen:<\/p>\n<pre class=\"wrap:true lang:default decode:true \">$ sudo apt-get install xen-hypervisor-amd64 xen-utils xenwatch xen-tools xen-utils-common xenstore-utils<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">Use the following commands to configure default Xen boot:<\/p>\n<pre class=\"lang:default decode:true\">$ sudo mv \/etc\/grub.d\/10_linux \/etc\/grub.d\/20_linux\r\n$ sudo mv \/etc\/grub.d\/20_linux_xen \/etc\/grub.d\/10_linux_xen\r\n$ sudo update-grub<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">Restart the OS and Xen. Next time the system is booting, \u00a0Xen will start automatically:<\/p>\n<p><a href=\"\/blog\/wp-content\/uploads-com\/2018\/03\/1-3.png\" data-rel=\"lightbox-gallery-W7WX1byo\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" class=\"size-full wp-image-8237 aligncenter\" src=\"\/blog\/wp-content\/uploads-com\/2018\/03\/1-3.png\" alt=\"\" width=\"644\" height=\"54\" loading=\"lazy\" title=\"\" srcset=\"https:\/\/trueconf.com/blog\/wp-content\/uploads\/2018\/03\/1-3.png 644w, https:\/\/trueconf.com/blog\/wp-content\/uploads\/2018\/03\/1-3-290x24.png 290w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/a><\/p>\n<h2 id=\"install_libvirtd\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Step 2. Install and configure libvirtd<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1\">Install <b>libvirtd:<\/b><\/p>\n<pre class=\"wrap:true lang:default decode:true\">$ sudo apt-get install python-libvirt libvirt-bin libvirt0 python-imaging python-numpy virtinst virt-viewer virt-manager<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">After that, configure <b>libvirtd<\/b> for Xen default operation. To do this, edit the <b>\/etc\/libvirt\/libvirt.conf<\/b> file. In this file, uncomment (remove the # symbol at the beginning) the line starting with <b>&#8220;#uri_default&#8221;<\/b> and replace it with the following line: <b>uri_default = &#8220;xen:\/\/\/system&#8221;<\/b>.<\/p>\n<p>Next, add exceptions to the <a href=\"https:\/\/en.wikipedia.org\/wiki\/AppArmor\" target=\"_blank\" rel=\"noopener\">apparmor<\/a>\u00a0protection tool:<\/p>\n<pre class=\"lang:default decode:true\">$ sudo ln -s \/etc\/apparmor.d\/usr.sbin.libvirtd \/etc\/apparmor.d\/disable\/\r\n$ sudo apparmor_parser -R \/etc\/apparmor.d\/usr.sbin.libvirtd\r\n$ sudo \/etc\/init.d\/apparmor restart<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">After that, check if the current record is in the <b>libvirtd <\/b>group:<\/p>\n<pre class=\"lang:default decode:true \">$ cat \/etc\/group | grep libvirtd<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">Here is a typical command output if the group contains\u00a0<b>111<\/b>\u00a0group and\u00a0<b>andrey<\/b>\u00a0as a user:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">libvirtd:!:111:andrey<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">If the current user is not in the group, add him\/her using a separate command:<\/p>\n<pre class=\"lang:default decode:true \">$ sudo adduser `id -un` libvirtd<\/pre>\n<pre class=\"lang:default highlight:0 decode:true \">Adding user 'andrey' to group 'libvirtd' ...\r\nAdding user andrey to group libvirtd\r\nDone.<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">After that, it is mandatory to re-enter the system and verify if Xen starts successfully.<\/p>\n<h2 id=\"create_bridge\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Step 3: Create a Network Bridge<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1\">Next, create a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Bridging_(networking)\" target=\"_blank\" rel=\"noopener\">network bridge<\/a>. To do this, you might need to edit<b> \/etc\/network\/interfaces<\/b> file.<\/p>\n<p class=\"primary-medium-text ui-mb-sm-1\">In this file there is a line setting the main network interface. It can be found after the \u00a0<b>&#8220;# The primary network interface&#8221; <\/b>line-comment. If the network interface is set to <b>eth0<\/b> (the line reads <b>&#8220;auto eth0&#8221;<\/b>), it must be replaced with <b>br0<\/b>, and four new lines must be added to the end of the file:<\/p>\n<pre class=\"lang:default highlight:0 decode:true \">bridge_ports\u00a0eth0\r\nbridge_stp\u00a0off\r\nbridge_maxwait 0\r\nbridge_fd\u00a00<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">The picture below shows an example of this type of editing. However, instead of changing the line <b>&#8220;auto eth0&#8221;<\/b>, we commented it (added <b>#<\/b> in the beginning to make it being ignored) and added a new line after it (with an additional comment before it).<\/p>\n<p><a href=\"\/blog\/wp-content\/uploads-com\/2018\/03\/2-2.png\" data-rel=\"lightbox-gallery-W7WX1byo\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" class=\"size-full wp-image-8238 aligncenter\" src=\"\/blog\/wp-content\/uploads-com\/2018\/03\/2-2.png\" alt=\"\" width=\"623\" height=\"306\" loading=\"lazy\" title=\"\" srcset=\"https:\/\/trueconf.com/blog\/wp-content\/uploads\/2018\/03\/2-2.png 623w, https:\/\/trueconf.com/blog\/wp-content\/uploads\/2018\/03\/2-2-290x142.png 290w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><\/a><\/p>\n<p class=\"primary-medium-text ui-mb-sm-1\">After that, restart the network or the entire operating system (highly recommended):<\/p>\n<pre class=\"lang:default decode:true\">$ sudo \/etc\/init.d\/networking restart\r\n$ sudo shutdown \u2013r now<\/pre>\n<h2 id=\"tune_gateway\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Step 4. Configure the network gateway<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1\">To configure the gateway, edit <b>\/etc\/sysctl.conf<\/b> file. Find and uncomment the following line:<\/p>\n<pre class=\"lang:default highlight:0 decode:true\">net.ipv4.ip_forward=1<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">After that, enter the command to apply changes and restart the OS again:<\/p>\n<pre class=\"lang:default decode:true\">$ sudo sysctl -f\r\n$ sudo shutdown \u2013r now<\/pre>\n<h2 id=\"validate\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Step 5: Check virtualization capabilities<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1\">After the system is rebooted, create the first virtual machine:<\/p>\n<pre class=\"lang:default decode:true \">$ sudo apt-cache search virt-instal\r\n$ sudo apt-cache search virt-viewer<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">To install Windows 2012 (which will be installed in this example) or any other system not ported to Xen, <a href=\"http:\/\/www.intel.com\/technology\/virtualization\/index.htm\" target=\"_blank\" rel=\"noopener\">Intel\u00ae Virtualization Technology (VT)<\/a> or Pacifica (AMD) virtualization technology support is required. Xen should also support hardware virtualization. To check it, use the following command:<\/p>\n<pre class=\"wrap:true lang:default decode:true\">$ xm info | grep caps\r\n<\/pre>\n<pre class=\"lang:default highlight:0 decode:true\">hw_caps : 178bfbff:ebd3fbff:00000000:00000010:00002001:00000000:0000001f\r\nxen_caps : xen-4.4-x86_32p hvm-4.4-x86_32 hvm-4.4-x86_32p<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">Based on <b>hvm-4.4-x86_32<\/b> output, Xen has successfully detected a processor that supports Intel VT or AMD-V technologies.<\/p>\n<p>If this command displays another message but you are sure that the processor has architectural virtualization extensions, check the BIOS settings and use VT support if you haven\u2019t done it yet.<\/p>\n<p>Your motherboard BIOS may artificially disable virtualization. In this case, update or fix the BIOS.<\/p>\n<h2 id=\"create_machine\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Step 6. Create a virtual machine<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1\">Just in case, check which virtual machines are running now.<\/p>\n<pre class=\"lang:default decode:true \">andrey@ubuntu:~$ sudo virsh -c xen:\/\/\/system list<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">The output is empty, as it should be if no virtual machine is running. Next, create a Xen disk image:<\/p>\n<pre class=\"lang:default decode:true \">andrey@ubuntu:# mkdir -p \/root\/xenimages\r\nandrey@ubuntu:# cd \/root\/xenimages\r\nandrey@ubuntu:# dd if=\/dev\/zero of=WS2012.img bs=1M count=4096<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">Create Windows 2012 ISO image, which will be used during the installation. In our case, we\u2019ve placed it in the <b>\/root\/xenimages<\/b> directory.<\/p>\n<p>Create the <b>\/etc\/xen\/win2012 <\/b>configuration file and fill it in using the following example:<\/p>\n<pre class=\"lang:default highlight:0 decode:true\">kernel = \"\/usr\/lib\/xen\/boot\/hvmloader\"\r\nbuilder='hvm'\r\nmemory = 2048\r\nname = \"win2012\"\r\nvcpus=1\r\npae=0\r\nacpi=0\r\napic=0\r\ncpus = \"\"\r\nvif = [ 'bridge=br0' ]\r\ndisk = [ 'file:\/root\/xenimages\/WS2012.img,ioemu:hda,w' ]\r\non_poweroff = 'destroy'\r\non_reboot \u00a0\u00a0= 'destroy'\r\non_crash \u00a0\u00a0\u00a0= 'destroy'\r\ndevice_model = '\/usr\/lib\/xen\/bin\/qemu-dm'\r\ncdrom='\/root\/xenimages\/en_windows2012.iso'\r\nboot='d'\r\nsdl=0\r\nvnc=1\r\nvncviewer=0\r\nstdvga=0\r\nserial='pty'\r\nne2000=0<\/pre>\n<p class=\"primary-medium-text ui-mb-sm-1\">Please note that <b>boot = &#8216;d&#8217;<\/b> parameter is required for installation. Subsequently, it must be replaced with <b>boot = &#8216;c&#8217;<\/b>. Guest domain will be accessed through VNC. The use of SDL is not presupposed.<\/p>\n<p>After creating <b>\/etc\/xen\/win2012 <\/b>configuration file, start the installation and try connecting to the domain using VNC. To do this, run <b>vncviewer <\/b>immediately after creating the domain:<\/p>\n<pre class=\"lang:default decode:true\">$ xl create \/etc\/xen\/win2012<\/pre>\n<pre class=\"lang:default highlight:0 decode:true\">Using config file \"\/etc\/xen\/win2012\". \r\n\r\nStarted domain Win2012\r\n\r\nvncviewer:0<\/pre>\n<h2 id=\"install_TCS\" class=\"h4--main h4--thick black-text ui-mb-xs-3 ui-mt-md-1\">Step 7. Install TrueConf Server<\/h2>\n<p class=\"primary-medium-text ui-mb-sm-1\">Once virtual machine has been successfully configured, just install TrueConf Server and get started. With <a href=\"https:\/\/trueconf.com\/blog\/knowledge-base\/get-video-conferencing-system-15-minutes.html\" target=\"_blank\" rel=\"noopener\">our guide<\/a>, it takes only 15 minutes<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TrueConf Server can be run on a virtual machine. However, it is complex and inadvisable to implement for inexperienced users, as enabling a virtual machine to operate correctly can be quite difficult at times. This manual will teach you how to configure\u00a0Xen hypervisor on Ubuntu Server 14.04.05 Server x86-64. This article is for informational purposes [&hellip;]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[260],"tags":[191],"class_list":["post-8236","post","type-post","status-publish","format-standard","hentry","category-knowledge-base","tag-deployment","wpautop"],"_links":{"self":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts\/8236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/comments?post=8236"}],"version-history":[{"count":23,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts\/8236\/revisions"}],"predecessor-version":[{"id":40753,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/posts\/8236\/revisions\/40753"}],"wp:attachment":[{"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/media?parent=8236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/categories?post=8236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trueconf.com/blog\/wp-json\/wp\/v2\/tags?post=8236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}