Skip to content

Instantly share code, notes, and snippets.

@headmin
Forked from leoyuholo/ubuntu1404onVMware_setup.sh
Last active August 29, 2015 14:00
Show Gist options
  • Save headmin/11191300 to your computer and use it in GitHub Desktop.
Save headmin/11191300 to your computer and use it in GitHub Desktop.
#ubuntu server setup
#install ubuntu 13.10 server 64-bit on VMware with easy install
#put this script file in guest OS and run
#this includes:
# vmware hgfs,
# correct timezone (HKT),
# ssh,
# git,
# docker
if [ "$1" != "deploy" ]
then
#re-config vmware-tools because of hgfs fails without build-essential
sudo apt-get update
sudo apt-get -y install build-essential
sudo vmware-config-tools.pl -d
#reconfig timezone to Hong Kong (UTC +8)
sudo sh -c "echo 'Europe/Berlin' > /etc/timezone"
sudo dpkg-reconfigure -f noninteractive tzdata
#install ssh:
sudo apt-get -y install ssh
#inject public key
mkdir ~/.ssh
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCiKq8cB1B84okgZ/t+hegIROl0mUbtQGiGIaNlbkAK8g5jYdA7Sln9NuOX2p2pjFOHoFkM78xS+wMRYk2DuUuv8q8uHM966I/WXdak5qoBRHppVFSGnn22zk/yg6CfeSc/4fu0nae8IrGmKZqoWH33ze5t2gqnbICO6HSGvsl4RiReN8v2HtOFVsW03w6N+aC9GAzVtqobiI4RuqnZsJaq3jr8JUFiqbUcVe460Hm77hT28ijnWpO114NSu/T07uRUKYPHt3M0e1fV5jdo3Lf6V7yRz2wVptBcDPr/q3dpe7HTvRmXCh9MCuVJ9r1dXUCohP8fuY+l9kHM3C083S8n" > ~/.ssh/authorized_keys
#install git
sudo apt-get -y install git
#install nfs-common
sudo apt-get -y install nfs-common
fi
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
#install docker
sudo apt-get -y install linux-image-extra-`uname -r`
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get -y install lxc-docker
sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo service docker restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment