{"id":151,"date":"2013-01-01T10:50:36","date_gmt":"2013-01-01T06:50:36","guid":{"rendered":"http:\/\/blog.mgvmi-hipl.ru\/?p=151"},"modified":"2013-01-01T10:50:36","modified_gmt":"2013-01-01T06:50:36","slug":"virtual-box-%d1%83%d1%81%d1%82%d0%b0%d0%bd%d0%be%d0%b2%d0%ba%d0%b0-centos-6-2","status":"publish","type":"post","link":"https:\/\/blog.5flor.ru\/?p=151","title":{"rendered":"Virtual Box \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Centos 6.2"},"content":{"rendered":"<p>This article will show you how to install VirtualBox 4.1 on a fresh installation of CentOS 6.2 Linux. In the tutorial below VirtualBox is installed immediately after having installed CentOS 6.2 (desktop setup) and rebooting it after having applied all the latest OS updates.<\/p>\n<p>The following steps will need to be done with the root account.<\/p>\n<p>&nbsp;<\/p>\n<h2><a name=\"Installation\"><\/a>Installation<\/h2>\n<p>Change to the <strong>\/etc\/yum.repos.d\/<\/strong> directory and download the VirtualBox repo file into your yum repository. With this you&#8217;ll be able to install VirtualBox through yum and updates for VirtualBox will also be included whenever you run the <strong>yum update<\/strong> command:<\/p>\n<pre><strong>[root@Linux ]# cd \/etc\/yum.repos.d\/<\/strong>\r\n<strong>[root@Linux ]# wget http:\/\/download.virtualbox.org\/virtualbox\/rpm\/rhel\/virtualbox.repo<\/strong><\/pre>\n<p>Take a look at the contents of the downloaded repo file to confirm that gpgcheck is enabled <strong>(gpgcheck=1)<\/strong> and to verify the location of the gpg key:<\/p>\n<pre><strong>[root@Linux ]# cat virtualbox.repo<\/strong>\r\n[virtualbox]\r\nname=RHEL\/CentOS-$releasever \/ $basearch - VirtualBox\r\nbaseurl=http:\/\/download.virtualbox.org\/virtualbox\/rpm\/rhel\/$releasever\/$basearch\r\nenabled=1\r\ngpgcheck=1\r\ngpgkey=http:\/\/download.virtualbox.org\/virtualbox\/debian\/oracle_vbox.asc<\/pre>\n<p>The following steps are optional: Verify the fingerprint of the gpg key in order confirm that the key downloaded belongs to virtualbox.org. In the command below the character surrounded by a dashes before the pipe is an uppercase letter &#171;O&#187; (not zero):<\/p>\n<pre><strong>[root@Linux ]# wget -q http:\/\/download.virtualbox.org\/virtualbox\/debian\/oracle_vbox.asc -O- | gpg --quiet --with-fingerprint<\/strong>\r\npub  1024D\/98AB5139 2010-05-18 Oracle Corporation (VirtualBox archive signing key) &lt;info@virtualbox.org&gt;\r\n      Key fingerprint = 7B0F AB3A 13B9 0743 5925  D9C9 5442 2A4B 98AB 5139\r\nsub  2048g\/281DDC4B 2010-05-18<\/pre>\n<p>Go to <a href=\"http:\/\/pgp.mit.edu\/\">http:\/\/pgp.mit.edu\/<\/a> and in the search string enter virtualbox.org, and checkmark &#171;Show PGP fingerprints for keys&#187;. Confirm that the key fingerprint matches the one above for the addresses info@virtualbox.org:<\/p>\n<pre>Type bits\/keyID     Date       User ID\r\n\r\npub  1024D\/98AB5139 2010-05-18 Oracle Corporation (VirtualBox archive signing key) &lt;info@virtualbox.org&gt;\r\n\t Fingerprint=7B0F AB3A 13B9 0743 5925  D9C9 5442 2A4B 98AB 5139 \r\n\r\npub  1024D\/6DFBCBAE 2008-07-14 Sun Microsystems, Inc. (xVM VirtualBox archive signing key) &lt;info@virtualbox.org&gt;\r\n\t Fingerprint=AF45 1228 01DA D613 29EF  9570 DCF9 F87B 6DFB CBAE<\/pre>\n<p>As you can see there are two keys found for info@virtualbox.org with the most recent key being the one that matches. Also notice that the key ID (98AB5139) shown in the output from pgp.mit.edu matches the key ID shown in the previous command.<\/p>\n<p>Another optional step is to review the information of the VirtualBox package before proceeding with the installation (this will confirm the minor version):<\/p>\n<pre><strong>[root@Linux ]# yum info VirtualBox-4.1<\/strong>\r\nAvailable Packages\r\nName        : VirtualBox-4.1\r\nArch        : i686\r\nVersion     : 4.1.8_75467_rhel6\r\nRelease     : 1\r\nSize        : 58 M\r\nRepo        : virtualbox\r\nSummary     : Oracle VM VirtualBox\r\nURL         : http:\/\/www.virtualbox.org\/\r\nLicense     : GPLv2\r\nDescription : VirtualBox is a powerful PC virtualization solution allowing\r\n            : you to run a wide range of PC operating systems on your Linux\r\n            : system. This includes Windows, Linux, FreeBSD, DOS, OpenBSD\r\n            : and others. VirtualBox comes with a broad feature set and\r\n            : excellent performance, making it the premier virtualization\r\n            : software solution on the market.<\/pre>\n<p>Proceed with installing VirtualBox (the command below is case sensitive). When prompted about the GPG key enter Y as long as the key ID matches the one above:<\/p>\n<pre><strong>[root@Linux ]# yum install VirtualBox-4.1<\/strong>\r\nSetting up Install Process\r\n.\r\n&lt;snip&gt;\r\n.\r\nDownloading Packages:\r\nVirtualBox-4.1-4.1.8_75467_rhel6-1.i686.rpm              |  58 MB     01:08     \r\nwarning: rpmts_HdrFromFdno: Header V4 DSA\/SHA1 Signature, key ID 98ab5139: NOKEY\r\nRetrieving key from http:\/\/download.virtualbox.org\/virtualbox\/debian\/oracle_vbox.asc\r\nImporting GPG key 0x98AB5139:\r\n Userid: \"Oracle Corporation (VirtualBox archive signing key) &lt;info@virtualbox.org&gt;\"\r\n From  : http:\/\/download.virtualbox.org\/virtualbox\/debian\/oracle_vbox.asc\r\nIs this ok [y\/N]: y\r\n.\r\n&lt;snip&gt;\r\n.\r\nCreating group 'vboxusers'. VM users must be member of that group!\r\n\r\nNo precompiled module for this kernel found -- trying to build one. Messages\r\nemitted during module compilation will be logged to \/var\/log\/vbox-install.log.\r\n\r\nStopping VirtualBox kernel modules [  OK  ]\r\nUninstalling old VirtualBox DKMS kernel modules [  OK  ]\r\nTrying to register the VirtualBox kernel modules using DKMS [FAILED]\r\n  (Failed, trying without DKMS)\r\nRecompiling VirtualBox kernel modules [FAILED]\r\n  (Look at \/var\/log\/vbox-install.log to find out what went wrong)\r\n\r\nInstalled:\r\n  VirtualBox-4.1.i686 0:4.1.8_75467_rhel6-1                                     \r\n\r\nComplete!<\/pre>\n<p>(note that the second failed entry above shows that a problem which you might not experience on your system did occur for us. We&#8217;ll address this shortly)<\/p>\n<p>Finally don&#8217;t forget to add your user account to the newly created vboxusers group, where &#171;username&#187; is the Linux user that you are adding to this group:<\/p>\n<pre><strong>[root@Linux ]# \/usr\/sbin\/usermod -a -G vboxusers username<\/strong><\/pre>\n<h2><a name=\"Problem\"><\/a>Problems which some may encounter<\/h2>\n<p>Although this problem may not occur for your environment, in ours we can see from the output above that something failed and we are advised to examine <strong>\/var\/log\/vbox-install.log<\/strong> to see what went wrong. In our case it tells us the following:<\/p>\n<p>&#171;unable to find the sources of your current Linux kernel. Specify KERN_DIR=&lt;directory&gt; and run Make again.&#187;<\/p>\n<p>We were able to fix the issue by completing the following additional steps (if you don&#8217;t experience this problem you can <a href=\"http:\/\/www.rationallyparanoid.com\/articles\/virtualbox-centos-6.2.html#Success\">skip to the end<\/a>).<\/p>\n<p>Install the following three packages (kernel-headers, kernel-devel, gcc):<\/p>\n<pre><strong>[root@Linux ]# yum install kernel-headers kernel-devel gcc<\/strong><\/pre>\n<p>Your system will install the packages above if they aren&#8217;t installed already, plus the package dependencies. Next confirm the version of your current kernel release:<\/p>\n<pre><strong>[root@Linux ]# uname -r<\/strong>\r\n2.6.32-220.2.1.el6.i686<\/pre>\n<p>Check <strong>\/usr\/src\/kernels\/<\/strong> to confirm that a directory for the version of your current kernel release exists (this directory should exist after the installation of the packages above):<\/p>\n<pre><strong>ls \/usr\/src\/kernels\/<\/strong>\r\n2.6.32-220.2.1.el6.i686<\/pre>\n<p>Above we see a match for &#171;2.6.32-220.2.1.el6.i686&#187;. Specify and export the KERN_DIR parameter making sure to match the release version with whichever one is current for your system:<\/p>\n<pre><strong>[root@Linux ]# KERN_DIR=\/usr\/src\/kernels\/2.6.32-220.2.1.el6.i686 [root@Linux ]# export KERN_DIR<\/strong><\/pre>\n<p>Echo <strong>KERN_DIR<\/strong> to confirm that you&#8217;ve set it up properly:<\/p>\n<pre><strong>[root@Linux ]# echo $KERN_DIR<\/strong>\r\n\/usr\/src\/kernels\/2.6.32-220.2.1.el6.i686<\/pre>\n<p>Finally re-run vboxdrv setup. This step may take a while to complete:<\/p>\n<pre><strong>[root@Linux ]# \/etc\/init.d\/vboxdrv setup<\/strong>\r\nStopping VirtualBox kernel modules                         [  OK  ]\r\nUninstalling old VirtualBox DKMS kernel modules            [  OK  ]\r\nRemoving old VirtualBox pci kernel module                  [  OK  ]\r\nRemoving old VirtualBox netadp kernel module               [  OK  ]\r\nRemoving old VirtualBox netflt kernel module               [  OK  ]\r\nRemoving old VirtualBox kernel module                      [  OK  ]\r\nTrying to register the VirtualBox kernel modules using DKMS[FAILED]\r\n  (Failed, trying without DKMS)\r\nRecompiling VirtualBox kernel modules                      [  OK  ]\r\nStarting VirtualBox kernel modules                         [  OK  ]<\/pre>\n<p>(the FAILED entry above for DKMS does not matter since recompiling the VirtualBox kernel modules succeeded).<\/p>\n<p>Lastly don&#8217;t forget to add your user account to the vboxusers group if you haven&#8217;t done so already:<\/p>\n<pre><strong>[root@Linux ]# \/usr\/sbin\/usermod -a -G vboxusers username<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This article will show you how to install VirtualBox 4.1 on a fresh installation of CentOS 6.2 Linux. In the tutorial below VirtualBox is installed immediately after having installed CentOS 6.2 (desktop setup) and rebooting it after having applied all &hellip; <a href=\"https:\/\/blog.5flor.ru\/?p=151\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,9],"tags":[],"class_list":["post-151","post","type-post","status-publish","format-standard","hentry","category-linux","category-9"],"_links":{"self":[{"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=\/wp\/v2\/posts\/151"}],"collection":[{"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=151"}],"version-history":[{"count":0,"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=\/wp\/v2\/posts\/151\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}