Vagrant is ze new viagra of ze VM

Si avec ce titre je passe pas en spam, c’est que votre anti-spam est mal réglé !

Trêve de plaisanterie, sur les conseils de l’ami biou j’ai regardé ce que pouvait pour moi Vagrant vu que hier j’avais tenté une installation d’une machine virtuelle Debian 8 sous VirtualBox sans réussir à simplement mapper correctement le clavier français du Mac.

En effet, je voulais tester une config Debian 8 + Apache 2.4 + PHP 7 en mode FastCGI / PHP-FPM + MySQL afin de vérifier si un Dotclear tourne correctement dessus ou pas.

Or donc, je télécharge l’appli Vagrant, l’installe, trouve une box debian 8 idoine, me crée un répertoire Vagrant et un sous-répertoire debian8, me positionne dedans et lance la commande suivante :

vagrant init debian/jessie64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

L’appli initialise l’environnement en question. Une fois terminé, je lance la commande :

vagrant up --provider virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'debian/jessie64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'debian/jessie64' is up to date...
==> default: Setting the name of the VM: debian8_default_1459842895303_63805
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default:
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Installing rsync to the VM...
==> default: Rsyncing folder: /Users/…/Geekeries/Vagrant/debian8/ => /vagrant

Et l’appli télécharge (si nécessaire) l’environnement, l’installe et lance la VM sous VirtualBox. Il n’y a plus qu’à se connecter via SSH dessus avec la commande :

vagrant ssh

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
-bash: warning: setlocale: LC_ALL: cannot change locale (fr_FR.utf-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (fr_FR.utf-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (fr_FR.utf-8)
vagrant@debian-jessie:~$

Et voilà ! Une distribution Debian 8 toute neuve dans laquelle vous pouvez faire toutes les conneries que vous voulez !

Pour arrêter la VM il suffit d’un simple :

vagrant halt
==> default: Attempting graceful shutdown of VM...

Et pour vérifier son état :

vagrant status
Current machine states:

default                   running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.

Je vais du coup pouvoir installer Apache, MySQL et PHP 7 pour faire quelques tests…

Ajouter un commentaire

Les champs suivis d'un * sont obligatoires

Les commentaires peuvent être formatés en utilisant la syntaxe Markdown Extra.

Ajouter un rétrolien

URL de rétrolien : https://open-time.net/trackback/12809

Haut de page