Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Installing an Ubuntu VM managed with Vagrant for Crystal development on Windows

Note: Vagrant does not like spaces in Windows directory paths.

1. Install virtualbox from

2. Install Vagrant from

Restart your computer.

3. Install git

4. Add box

using Git Bash

vagrant box add davidallen/xenial-crystal

5. Set up the folder

mkdir xenial_crystal
cd xenial_crystal
vagrant init xenial-crystal

6. Edit Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.define "xenial-crystal" do |c| = "davidallen/xenial-crystal"
    #Make apt-get upgrade completely silent so it doesn't get stuck on selecting a drive for GRUB
    c.vm.provision :shell, inline: %(
      sudo apt-get -y update
      DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
  config.vm.provider "virtualbox" do |vb|
    # Display the VirtualBox GUI when booting the machine
    vb.gui = true

    vb.cpus = 2
    vb.memory = "1024"


7. Create and log into the VM

vagrant up
vagrant ssh

8. Install a browser

sudo apt-get install firefox
cd /tmp
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get -f install

9. Open the gui




makes it verbose

10. Use it!

The terminal comnmand to open an interactive crystal console is icr

To start a fresh Crystal project

crystal init app hello_world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment