LoginSignup
4
3

More than 5 years have passed since last update.

Vagrant+RancherOS,Ubuntu

Last updated at Posted at 2016-02-18

参考

起動

Vagrantfile
Vagrant.configure(2) do |config|
  config.vm.box = "rancherio/rancheros"
end
ubuntuコンソールに切り替え
vagrant up
vagrant ssh

sudo ros service enable ubuntu-console
sudo reboot
  • ubuntuイメージを引っ張ってくるので5分ほど待つ
vagrant ssh

Ubuntu

  • ubuntu/trusty64が更新頻度が高く、一番人気なのでこっちを使ったほうが良さそう
Vagrantfile
Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu"
  config.vm.provision :shell, :path => "provision.sh"
  config.vm.network :forwarded_port, host: 3000, guest: 80

  config.vm.provider "virtualbox" do |vb|
    vb.gui = false
    vb.customize ["modifyvm", :id, "--paravirtprovider", "kvm"]
    vb.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "2"]
    vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
  end
end

provision

provision.sh
## locales
echo "ja_JP.UTF-8 UTF-8" > /etc/locale.gen
locale-gen ja_JP.UTF-8
update-locale LANG=ja_JP.UTF-8

## timezone
echo "Asia/Tokyo" > /etc/timezone 
dpkg-reconfigure -f noninteractive tzdata

## sources.list
sed -i -e 's@http://archive@http://jp.archive@g' /etc/apt/sources.list
apt-get update
apt-get install -y compiz lxde

## compiz settings
mkdir -p /home/vagrant/.config/lxsession/Lubuntu/
cat > /home/vagrant/.config/lxsession/Lubuntu/autostart <<EOF
@/usr/bin/compiz --replace
EOF
vagrant provision
4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3