liyang85
6/10/2017 - 7:06 PM

Setting up a Vagrant VM for CentOS 7

Setting up a Vagrant VM for CentOS 7

#!/bin/env bash

echo 'source /opt/rh/devtoolset-6/enable' >> ~/.profile
echo 'source /opt/rh/python33/enable' >> ~/.profile

# rust

curl https://sh.rustup.rs -sSf | sh -s -- -y
source ~/.profile

# LLVM has to be built from source?

# And set up YouCompleteMe

git clone https://github.com/Valloric/YouCompleteMe $HOME/YouCompleteMe
cd $HOME/YouCompleteMe
git submodule update --init --recursive
./install.py --all
#!/bin/env bash

yum update -y

# Install the Parallels tools

mkdir /media/cdrom
mount /dev/cdrom /media/cdrom
/mdeia/cdmrom/install

# To get the version

yum install -y redhat-lsb

# Standard dev tools

yum groupinstall -y "Development tools"

# Install devtoolset-6

yum install -y centos-release-scl
yum install -y devtoolset-6

# Activate it

source /opt/rh/devtoolset-6/enable

# YCM Dependencies: cmake, python

yum install -y cmake
yum install -y python33 python33-devel
source /opt/rh/python33/enable

# golang, node, typescript

yum install -y epel-release
yum install -y golang

curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
yum install -y nodejs

npm install -g typescript

# mono
yum install -y yum-utils
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
yum-config-manager --add-repo http://download.mono-project.com/repo/centos7/
yum install -y mono-devel

# rust, llvm not done as root
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.box = "parallels/centos-7.3"

  #config.vm.network "forwarded_port", guest: 80, host: 8080
  config.vm.network "public_network"

  config.vm.provider "parallels" do |v|
    v.memory = 1024 * 8
    v.cpus = 6

    v.linked_clone = true
  end

  config.vm.provision "shell", path: "provision.root.sh"
  config.vm.provision "shell", path: "provision.vagrant.sh", privileged: false

end