Skip to content

Latest commit

 

History

History
99 lines (55 loc) · 2.69 KB

File metadata and controls

99 lines (55 loc) · 2.69 KB

Using Vagrant as Development Environment

Vagrant

Vagrant is an open-source software product for building and maintaining portable virtual software development environments. e.g., for VirtualBox, KVM, Hyper-V or VMware. It tries to simplify the software configuration management of virtualization in order to increase development productivity.

Getting Started

We provide a vagrant setup in this repository. It installs all necassary dependencies needed to build a script-language-container into the Virtual Machine. You can then connect via SSH to run the exaslct commands to build the container. The code of this repository will be shared with VM through rsync.

We support the following Virtual Machine provider:

Installing Vagrant

For installing Vagrant please follow the instrunctions on the vagrant homepage.

Setting up Vagrant for libvirt

First, you should have both QEMU and Libvirt installed if you plan to run VMs on your local system. For instructions, refer to your Linux distribution's documentation.

Vagrant needs the plugin vagrant-libvirt to support libvirt.

In many cases, it is enough to run the following command to install the plugin:

```
vagrant plugin install vagrant-libvirt
```

In case, this doesn't work, please have a look at the documentation of the plugin.

Addtional plugins

We recommend to install also the following vagrant plugin to simplify working with Vagrant:

  • vagrant-scp: This plugin allows to copy files to and from the VM via scp

    vagrant plugin install vagrant-scp
    

Using Vagrant with libvirt

  1. Change into the vagrant directory

    cd vagrant
    
  2. Start the Vagrant VM

    vagrant up
    
  3. Connect to the VM via SSH

    vagrant ssh
    
  4. Run the exaslct commands to build the container

  5. Copy back the container with vagrant scp

    vagrant scp :file_on_vm.txt file_on_host.txt
    
  6. If you modify the repository, you can run vagrant rsync to sync these changes to the VM

    vagrant rsync
    

    With vagrant rsync-auto vagrant observes the repository for changes and will sync them automatically.

  7. You can shutdown your VM with

    vagrant halt
    

    With vagrant up you start it again.

  8. You can destroy your VM with (Caution: This is irreversible)

    vagrant destroy