参考
- Vagrant box rancherio/rancheros | Atlas by HashiCorp
- RancherOSをCDブートで運用 - Qiita
- vDevices/Vagrant-LinuxDesktop · GitHub
起動
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