Skip to content

Instantly share code, notes, and snippets.

@nk9453
Forked from clivewalkden/centos-7-package.sh
Created April 2, 2017 17:02
Show Gist options
  • Save nk9453/98b77dbc4c89c97288a282edaa4b8ac8 to your computer and use it in GitHub Desktop.
Save nk9453/98b77dbc4c89c97288a282edaa4b8ac8 to your computer and use it in GitHub Desktop.

Revisions

  1. @clivewalkden clivewalkden revised this gist May 18, 2016. No changes.
  2. @clivewalkden clivewalkden revised this gist May 18, 2016. 2 changed files with 30 additions and 37 deletions.
    30 changes: 30 additions & 0 deletions centos-7-package.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    # Start the old vagrant
    $ vagrant init centos-7
    $ vagrant up

    # You should see a message like:
    # Installing Virtualbox Guest Additions 5.0.20 - guest version is unknown

    $ vagrant ssh
    vagrantup:~$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm
    vagrantup:~$ sudo yum -y update
    vagrantup:~$ sudo yum -y install wget nano
    vagrantup:~$ cd /opt
    vagrantup:~$ sudo wget -c http://download.virtualbox.org/virtualbox/5.0.20/VBoxGuestAdditions_5.0.20.iso \
    -O VBoxGuestAdditions_5.0.20.iso
    vagrantup:~$ sudo mount VBoxGuestAdditions_5.0.20.iso -o loop /mnt
    vagrantup:~$ cd /mnt
    vagrantup:~$ sudo sh VBoxLinuxAdditions.run --nox11
    vagrantup:~$ cd /opt
    vagrantup:~$ sudo rm *.iso
    vagrantup:~$ cat /dev/null > ~/.bash_history
    vagrantup:~$ exit

    # Now check that the Guest Additions work
    $ vagrant halt
    $ vagrant up

    # Package the new VM
    $ vagrant halt
    $ vagrant package
    $ mv package.box centos-7.box
    37 changes: 0 additions & 37 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,37 +0,0 @@
    # Start the old vagrant
    $ vagrant init centos-6.3
    $ vagrant up

    # You should see a message like:
    # [default] The guest additions on this VM do not match the install version of
    # VirtualBox! This may cause things such as forwarded ports, shared
    # folders, and more to not work properly. If any of those things fail on
    # this machine, please update the guest additions and repackage the
    # box.
    #
    # Guest Additions Version: 4.1.18
    # VirtualBox Version: 4.2.8

    $ vagrant ssh
    vagrantup:~$ sudo yum -y update
    vagrantup:~$ cd /opt
    vagrantup:~$ sudo wget -c http://download.virtualbox.org/virtualbox/4.2.8/VBoxGuestAdditions_4.2.8.iso \
    -O VBoxGuestAdditions_4.2.8.iso
    vagrantup:~$ sudo mount VBoxGuestAdditions_4.2.8.iso -o loop /mnt
    vagrantup:~$ cd /mnt
    vagrantup:~$ sudo sh VBoxLinuxAdditions.run --nox11
    vagrantup:~$ cd /opt
    vagrantup:~$ sudo rm *.iso
    vagrantup:~$ sudo /etc/init.d/vboxadd setup
    vagrantup:~$ sudo chkconfig --add vboxadd
    vagrantup:~$ sudo chkconfig vboxadd on
    vagrantup:~$ exit

    # Now check that the Guest Additions work
    $ vagrant halt
    $ vagrant up

    # Package the new VM
    $ vagrant halt
    $ vagrant package
    $ mv package.box centos-6.3.box
  3. @fernandoaleman fernandoaleman revised this gist Mar 4, 2013. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,9 @@ vagrantup:~$ cd /mnt
    vagrantup:~$ sudo sh VBoxLinuxAdditions.run --nox11
    vagrantup:~$ cd /opt
    vagrantup:~$ sudo rm *.iso
    vagrantup:~$ sudo /etc/init.d/vboxadd setup
    vagrantup:~$ sudo chkconfig --add vboxadd
    vagrantup:~$ sudo chkconfig vboxadd on
    vagrantup:~$ exit

    # Now check that the Guest Additions work
  4. @fernandoaleman fernandoaleman revised this gist Mar 4, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ $ vagrant up
    # VirtualBox Version: 4.2.8

    $ vagrant ssh
    vagrantup:~$ sudo yum -u update
    vagrantup:~$ sudo yum -y update
    vagrantup:~$ cd /opt
    vagrantup:~$ sudo wget -c http://download.virtualbox.org/virtualbox/4.2.8/VBoxGuestAdditions_4.2.8.iso \
    -O VBoxGuestAdditions_4.2.8.iso
  5. @fernandoaleman fernandoaleman created this gist Mar 4, 2013.
    34 changes: 34 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    # Start the old vagrant
    $ vagrant init centos-6.3
    $ vagrant up

    # You should see a message like:
    # [default] The guest additions on this VM do not match the install version of
    # VirtualBox! This may cause things such as forwarded ports, shared
    # folders, and more to not work properly. If any of those things fail on
    # this machine, please update the guest additions and repackage the
    # box.
    #
    # Guest Additions Version: 4.1.18
    # VirtualBox Version: 4.2.8

    $ vagrant ssh
    vagrantup:~$ sudo yum -u update
    vagrantup:~$ cd /opt
    vagrantup:~$ sudo wget -c http://download.virtualbox.org/virtualbox/4.2.8/VBoxGuestAdditions_4.2.8.iso \
    -O VBoxGuestAdditions_4.2.8.iso
    vagrantup:~$ sudo mount VBoxGuestAdditions_4.2.8.iso -o loop /mnt
    vagrantup:~$ cd /mnt
    vagrantup:~$ sudo sh VBoxLinuxAdditions.run --nox11
    vagrantup:~$ cd /opt
    vagrantup:~$ sudo rm *.iso
    vagrantup:~$ exit

    # Now check that the Guest Additions work
    $ vagrant halt
    $ vagrant up

    # Package the new VM
    $ vagrant halt
    $ vagrant package
    $ mv package.box centos-6.3.box