Skip to content

Instantly share code, notes, and snippets.

@Burning-Chai
Last active August 16, 2017 09:41
Show Gist options
  • Save Burning-Chai/7159f7c1e987da196694 to your computer and use it in GitHub Desktop.
Save Burning-Chai/7159f7c1e987da196694 to your computer and use it in GitHub Desktop.
VIRTUALBOX から VAGARNT の BOX 作成 ref: http://qiita.com/Burning-Chai/items/8299ff70f44b3b54cf64
# sed -i -e "s:^ONBOOT=no$:ONBOOT=yes:" /etc/sysconfig/network-scripts/ifcfg-eth0
# cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep ONBOOT
# service network restart
# ip addr show eth0
# ln -f -s /dev/null /etc/udev/rules.d/70-persistent-net.rules
# sed -i -e "s:HWADDR=.*::g" /etc/sysconfig/network-scripts/ifcfg-eth0
# sed -i -e "s:UUID=.*::g" /etc/sysconfig/network-scripts/ifcfg-eth0
$ vagrant package --base centos-5.8x32 --output centos-5.8x32.box
$ vagrant box add centos-5.8_x32 centos-5.8_x32.box
$ vagrant init centos-5.8_x32
$ vagrant up
# sed -i -e "s:^#UseDNS yes:UseDNS no:" /etc/ssh/sshd_config
# service sshd start
# chkconfig sshd on
$ ssh root@localhost -p 2222
# groupadd vagrant
# useradd vagrant -g vagrant -G wheel
# echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers # sudo設定
# sed -i -e "s:^.*requiretty:#Defaults requiretty:" /etc/sudoers # requiretty を無効
# su - vagrant
# mkdir ~/.ssh
# chmod 0700 ~/.ssh
# curl -k -L -o ~/.ssh/authorized_keys https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub
# chmod 0600 ~/.ssh/authorized_keys
# yum install -y wget
# mkdir /media/VBoxGuestAdditions
# wget http://download.virtualbox.org/virtualbox/4.3.18/VBoxGuestAdditions_4.3.18.iso
# mount -o loop,ro VBoxGuestAdditions_4.3.18.iso /media/VBoxGuestAdditions
# sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run
# rm VBoxGuestAdditions_4.3.18.iso
# umount /media/VBoxGuestAdditions
# rmdir /media/VBoxGuestAdditions/
$ cd ~/VirtualBox\ VMs/centos-5.8_x32/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment