Skip to content

Instantly share code, notes, and snippets.

@yooappn
Last active July 8, 2018 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yooappn/7309846e28d9484bb043f455ee7ca886 to your computer and use it in GitHub Desktop.
Save yooappn/7309846e28d9484bb043f455ee7ca886 to your computer and use it in GitHub Desktop.
# copy from http://serverarekore.blogspot.com/2018/01/vagrantvisual-studio-codexfce.html
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# config.vm.box = "centos7.2"
config.vm.box = "benpiper/centos7-xfce"
config.vm.box_version = "0.0.1"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", type: "dhcp"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
config.vm.network "public_network"
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Customize the amount of memory on the VM:
vb.memory = "4096"
vb.customize ["modifyvm", :id, "--monitorcount", "1"]
end
config.vm.provision "shell", inline: <<-SHELL
localectl set-locale LANG=ja_JP.UTF-8
yum install -y epel-release
yum check-update
yum -y update
# cat << EOF >> /home/vagrant/.Xclients
# export GTK_IM_MODULE=ibus
# export XMODIFIERS=@im=ibus
# export QT_IM_MODULE=ibus
# ibus-daemon -drx
# exec /usr/bin/xfce4-session
# EOF
# chmod +x /home/vagrant/.Xclients
# chown vagrant:vagrant /home/vagrant/.Xclients
# sudo sh -c "echo 'X-GNOME-Autostart-enabled=false' >> /etc/xdg/autostart/gnome-welcome-tour.desktop"
# sudo sh -c "echo 'X-GNOME-Autostart-enabled=false' >> /etc/xdg/autostart/gnome-software-service.desktop"
# sudo sh -c "echo 'X-GNOME-Autostart-enabled=false' >> /etc/xdg/autostart/gnome-settings-daemon.desktop"
# sudo systemctl disable initial-setup-graphical.service
# sudo systemctl disable initial-setup-text.service
# systemctl set-default graphical.target
# systemctl enable xrdp.service
# systemctl start xrdp.service
# git
yum -y install git
# golang
mkdir /home/vagrant/{tools,go}
mkdir /home/vagrant/go/bin
wget -O go1.8.7.tar.gz https://dl.google.com/go/go1.8.7.linux-amd64.tar.gz
wget -O dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64
mv dep /home/vagrant/go/bin
tar -zxf go1.8.7.tar.gz -C /home/vagrant/tools/
# gcloud command
wget -O google-cloud-sdk.tar.gz https://storage.googleapis.com/cloud-sdk-release/google-cloud-sdk-199.0.0-linux-x86_64.tar.gz
tar -zxf google-cloud-sdk.tar.gz -C /home/vagrant/tools/
# node
curl -sL https://rpm.nodesource.com/setup_8.x | bash -
yum install -y nodejs
# docker, docker-compose
sudo yum check-update
curl -fsSL https://get.docker.com/ | sh
sudo systemctl enable docker
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
# install Visual Studio Code
wget -O vsc.rpm https://go.microsoft.com/fwlink/?LinkID=760867
yum -y install vsc.rpm
telinit 5
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment