Last active
August 16, 2017 09:41
-
-
Save Burning-Chai/7159f7c1e987da196694 to your computer and use it in GitHub Desktop.
VIRTUALBOX から VAGARNT の BOX 作成 ref: http://qiita.com/Burning-Chai/items/8299ff70f44b3b54cf64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vagrant package --base centos-5.8x32 --output centos-5.8x32.box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vagrant box add centos-5.8_x32 centos-5.8_x32.box | |
$ vagrant init centos-5.8_x32 | |
$ vagrant up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sed -i -e "s:^#UseDNS yes:UseDNS no:" /etc/ssh/sshd_config | |
# service sshd start | |
# chkconfig sshd on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ssh root@localhost -p 2222 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 を無効 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yum install -y wget | |
# mkdir /media/VBoxGuestAdditions | |
# wget http://download.virtualbox.org/virtualbox/4.3.18/VBoxGuestAdditions_4.3.18.iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mount -o loop,ro VBoxGuestAdditions_4.3.18.iso /media/VBoxGuestAdditions | |
# sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rm VBoxGuestAdditions_4.3.18.iso | |
# umount /media/VBoxGuestAdditions | |
# rmdir /media/VBoxGuestAdditions/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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