<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Void And Any &#187; virtual machine</title>
	<atom:link href="http://voidandany.free.fr/index.php/tag/virtual-machine/feed/" rel="self" type="application/rss+xml" />
	<link>http://voidandany.free.fr</link>
	<description>mon bazar...</description>
	<lastBuildDate>Sat, 09 Dec 2017 09:24:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Installer virtualbox sur un serveur headless (sans interface graphique)</title>
		<link>http://voidandany.free.fr/index.php/installer-virtualbox-sur-un-serveur-headless-sans-interface-graphique/</link>
		<comments>http://voidandany.free.fr/index.php/installer-virtualbox-sur-un-serveur-headless-sans-interface-graphique/#comments</comments>
		<pubDate>Tue, 20 Nov 2012 22:06:47 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=4747</guid>
		<description><![CDATA[Et hop un petit article rapide et oui je penses encore à ce blog&#8230; Ajout du ppa virtualbox : sudo vim /etc/apt/source.list.d/virtualbox.list Y copier la ligne correspondant à votre version d&#8217;Ubuntu, dans mon cas la 12.04 : deb http://download.virtualbox.org/virtualbox/debian precise &#8230; <a href="http://voidandany.free.fr/index.php/installer-virtualbox-sur-un-serveur-headless-sans-interface-graphique/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Et hop un petit article rapide et oui je penses encore à ce blog&#8230;</p>
<p>Ajout du ppa virtualbox :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>source.list.d<span style="color: #000000; font-weight: bold;">/</span>virtualbox.list</pre></div></div>

<p>Y copier la ligne correspondant à votre version d&#8217;Ubuntu, dans mon cas la 12.04 :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">deb http://download.virtualbox.org/virtualbox/debian precise contrib</pre></div></div>

<p>Liste complète <a href="https://www.virtualbox.org/wiki/Linux_Downloads">ici</a></p>
<p>Ajout de la clé virtualbox et installation :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-q</span> http:<span style="color: #000000; font-weight: bold;">//</span>download.virtualbox.org<span style="color: #000000; font-weight: bold;">/</span>virtualbox<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span>oracle_vbox.asc <span style="color: #660033;">-O-</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-key</span> add -
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> update
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> linux-headers-$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">uname</span> -r<span style="color: #7a0874; font-weight: bold;">&#41;</span> build-essential virtualbox-<span style="color: #000000;">4.2</span> dkms <span style="color: #660033;">--without-recommends</span></pre></div></div>

<p>Installation des additions clientes :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>download.virtualbox.org<span style="color: #000000; font-weight: bold;">/</span>virtualbox<span style="color: #000000; font-weight: bold;">/</span>4.2.4<span style="color: #000000; font-weight: bold;">/</span>Oracle_VM_VirtualBox_Extension_Pack-4.2.4-<span style="color: #000000;">81684</span>.vbox-extpack
<span style="color: #c20cb9; font-weight: bold;">sudo</span> VBoxManage extpack <span style="color: #c20cb9; font-weight: bold;">install</span> Oracle_VM_VirtualBox_Extension_Pack-4.2.4-<span style="color: #000000;">81684</span>.vbox-extpack</pre></div></div>

<p>Et voila virtualbox est installé, on pourrait s’arrêter ici et le commander en ligne de commande, mais pour plus de facilité on va installer phpvirtualbox qui comme son nom l&#8217;indique permet de piloter virtualbox via une interface web.</p>
<p>On partira du principe que vous avez déjà un serveur web (Nginx en l’occurrence, voir <a title="Installer un serveur web (nginx) sur le Seagate Dockstar" href="http://voidandany.free.fr/index.php/installer-un-serveur-web-nginx-sur-le-seagate-dockstar/">Installer Nginx</a>, <a title="Paramétrages NGINX" href="http://voidandany.free.fr/index.php/parametrages-nginx/">Paramétrer Nginx</a>).</p>
<p>On pourra s&#8217;assurer que les paquet suivant sont installés :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">php5-suhosin php-pear unzip</pre></div></div>

<p>On va tout d&#8217;abord créer un utilisateur spécifique qui exécutera le service Vboxweb-service :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">useradd <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>vbox <span style="color: #660033;">-m</span> <span style="color: #660033;">-g</span> vboxusers <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> vbox
<span style="color: #c20cb9; font-weight: bold;">passwd</span> vbox</pre></div></div>

<p>On configure virtualbox pour lui indiquer que l&#8217;on doit utiliser l&#8217;utilisateur que l&#8217;on vient de créer :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>virtuabox</pre></div></div>

<p>On ajoute :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">VBOXWEB_USER</span>=vbox</pre></div></div>

<p>On installe le service vboxweb-service et on le démarre :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">update-rc.d vboxweb-service defaults 
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>vboxweb-service start</pre></div></div>

<p>On récupère le code de phpvirtualbox et on l&#8217;installe :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>localhost
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>phpvirtualbox.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>phpvirtualbox-<span style="color: #000000;">4.2</span>-<span style="color: #000000;">4</span>.zip
<span style="color: #c20cb9; font-weight: bold;">unzip</span> phpvirtualbox-<span style="color: #000000;">4.2</span>-<span style="color: #000000;">4</span>.zip
<span style="color: #c20cb9; font-weight: bold;">mv</span> phpvirtualbox-<span style="color: #000000;">4.2</span>-<span style="color: #000000;">4</span> phpvirtualbox</pre></div></div>

<p>Configuration de phpvirtualbox :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>localhost<span style="color: #000000; font-weight: bold;">/</span>phpvirtualbox<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> config.php-example config.php
<span style="color: #c20cb9; font-weight: bold;">vim</span> config.php</pre></div></div>

<p>Et on modifiera les 2 lignes suivantes :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">var <span style="color: #007800;">$username</span> = <span style="color: #ff0000;">'vbox'</span>;
var <span style="color: #007800;">$password</span> = <span style="color: #ff0000;">'[Mot de passe de l'</span>utilisateur vbox<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #ff0000;">';</span></pre></div></div>

<p>Enfin en bonus voici ma config nginx :</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">server <span style="color: #7a0874; font-weight: bold;">&#123;</span>
 listen       <span style="color: #000000;">80</span>;
 server_name  localhost, <span style="color: #7a0874; font-weight: bold;">&#91;</span>IP locale<span style="color: #7a0874; font-weight: bold;">&#93;</span>;
 root         <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>localhost<span style="color: #000000; font-weight: bold;">/</span>phpvirtualbox;
&nbsp;
 include         <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>common.conf ;
 index           index.html index.php;
 access_log      <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>localhost.access.log;
&nbsp;
 location ~ \.php$ <span style="color: #7a0874; font-weight: bold;">&#123;</span>
 include         <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>fastcgi_params;
 fastcgi_param   SCRIPT_FILENAME  <span style="color: #007800;">$document_root</span><span style="color: #007800;">$fastcgi_script_name</span>;
 fastcgi_pass    127.0.0.1:<span style="color: #000000;">9000</span>;
 <span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>&nbsp;</p>
<p>On peut dès lors se connecter sur son serveur (login et mot de passe par défaut de phpvirtualbox : admin/admin)</p>
<p>A l&#8217;usage phpvirtualbox est comme virtualbox, c&#8217;en est bluffant.</p>
<p>Seul chose à savoir, lorsque l&#8217;on démarre une machine virtuel, on peut y accéder via l&#8217;onglet &laquo;&nbsp;Console&nbsp;&raquo; mais il faut changer l&#8217;adresse de connexion de null:9001 (ou tout autre port) en [IP locale du serveur virtualbox]:9001.</p>
<p>Enfin plus pratique que l&#8217;onglet console, on pourra utiliser rdestop sous Ubuntu (là aussi l&#8217;accès se fait via : [IP locale du serveur virtualbox]:9001.)</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>Sources :</strong></span></p>
<p>http://www.howtoforge.com/vboxheadless-running-virtual-machines-with-virtualbox-4.1-on-a-headless-ubuntu-12.04-server</p>
<p>http://www.vionblog.com/virtualbox-4-2-and-phpvirtualbox-on-debian/</p>
<p>http://www.howtoforge.com/managing-a-headless-virtualbox-installation-with-phpvirtualbox-on-nginx-ubuntu-12.04</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/installer-virtualbox-sur-un-serveur-headless-sans-interface-graphique/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
