-
Notifications
You must be signed in to change notification settings - Fork 48
revise readme for multiple host os #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 9 commits
9266817
8058808
373c8c7
de1aca6
16167a6
4f9a414
c6bcfb3
86b8481
13d9d94
abf33f2
fe9e7bf
e54e9bc
d4eb9fb
31c846a
66244b3
5f86b8b
d55de27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| ### Install Vagrant using VirtualBox on Fedora 24 | ||
|
|
||
| Tested for Fedora 24 | ||
|
|
||
| Run the following commands on fresh installed Fedora first: | ||
| ```shell | ||
| # Upgrade fedora | ||
| sudo dnf -y update # upgrade to the latest kernel etc. | ||
|
|
||
| # Install vim editor | ||
| sudo dnf -y install vim | ||
|
|
||
| # Reboot machine | ||
| sudo reboot | ||
| ``` | ||
|
|
||
| Have you run `dnf update` lately, then start here: | ||
| ```shell | ||
| # Generate SSH key to use when accessing machines | ||
| ssh-keygen -t rsa -b 4096 -N "" -C "root@example.com" -f ~/.ssh/rhce # empty password | ||
|
|
||
| # Make loading SSH key to ssh agent automatic | ||
| eval $(ssh-agent); echo $'eval $(ssh-agent)' >> ~/.bash_profile | ||
| ssh-add ~/.ssh/rhce; echo $'ssh-add ~/.ssh/rhce' >> ~/.bash_profile | ||
|
|
||
| # Download VritualBox repository | ||
| sudo wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo | ||
|
|
||
| # Clean repository cache & import GPG Key | ||
| sudo dnf clean dbcache | ||
| sudo dnf -y repolist # Import the GPG keys | ||
|
|
||
| # Get vagrant version | ||
| export virtualbox_version=`yum -y search VirtualBox | awk 'match($0, /(VirtualBox-[0-9]\.[0-9])/, a) {b=a[1]} END {print b}'` # depends on yum sorting | ||
| export virtualbox_version=`yum -y search VirtualBox | awk 'match($0, /(VirtualBox-[0-9]\.[0-9])/, a) {if (RSTART) { ++i; v[i]=a[1]}} END {n = asort (v); print v[n]}'` | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @smartbit
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was studying regex, What do you think, should we depend on the output order of Ubuntu.md currently has three steps for installing vagrant:
whereas in CentOS/Fedora it is a simple
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I mean when a user sees theses two command he/she may apply both of them. so why to put two of them if one can handle it properly
If we want to install
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because I didn't come to a conclusion which of the two (three) is better. What are your thoughts? After we made up our mind, we remove the other and have a reference left in the repository.
Like this? It would put vagrant install on a single line, but then we'd have 2 lines for installing: |
||
|
|
||
| # Install packages | ||
| sudo dnf -y install git gcc make kernel-devel $virtualbox_version | ||
|
|
||
| # Install VirtualBox kernel modules | ||
| sudo /sbin/vboxconfig # load the vboxdrv kernel module, will fail without dnf update | ||
|
|
||
| # Check if vboxdrv service is started without errors | ||
| systemctl status vboxdrv # active? | ||
|
|
||
| # Check VirtualBox version | ||
| VBoxManage --version # should return no errors | ||
|
|
||
| # Restart machine | ||
| sudo reboot | ||
| ``` | ||
|
|
||
| ```shell | ||
| # Get latest vagrant version | ||
| export vagrant_version=`wget --quiet -O - https://releases.hashicorp.com/vagrant/ | sed -nr '/.*href="\/vagrant\/([^/]*).*/{s//\1/p;q}' ` # from top of page | ||
| export vagrant_version=`wget --quiet -O - https://releases.hashicorp.com/vagrant/ | awk 'match($0, /href="\/vagrant\/([^/]*)/, a) {if (RSTART) { ++i; v[i]=a[1]}} END {n = asort (v); print v[n]}'` | ||
|
|
||
| # Install vagrant | ||
| sudo dnf -y install https://releases.hashicorp.com/vagrant/"$vagrant_version"/vagrant_"$vagrant_version"_x86_64.rpm | ||
|
|
||
| # Check vagrant version | ||
| vagrant --version | ||
|
|
||
| # Download (clone) lab environment from GitHub | ||
| cd ~ | ||
| git clone https://github.com/AnwarYagoub/RHCSA-RHCE-Lab-Environment.git | ||
| cd ~/RHCSA-RHCE-Lab-Environment | ||
| ``` | ||
|
|
||
| If Fedora runs without GUI, then execute these 2 commands: | ||
| ```shell | ||
| sed -i 's/gui\: true/gui\: false/g' provisioning/RHCSA_RHCE_LAB/defaults/main.yml # no need for gui on commandline | ||
| sed -i 's/vb.gui = true/vb.gui = false/g' Vagrantfile # without GUI vagrant will error with 'vb.gui = true' | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| ### Install Vagrant using KVM on RHEL/CentOS 64-bit | ||
|
|
||
|
|
||
| ```shell | ||
| # Generate SSH key to use when accessing machines | ||
| ssh-keygen -t rsa -b 4096 -N "" -C "root@example.com" -f ~/.ssh/rhce # empty password | ||
|
|
||
| # Make loading SSH key to ssh agent automatic | ||
| eval $(ssh-agent); echo $'eval $(ssh-agent)' >> ~/.bash_profile | ||
| ssh-add ~/.ssh/rhce; echo $'ssh-add ~/.ssh/rhce' >> ~/.bash_profile | ||
|
|
||
| # Get latest vagrant version | ||
| export vagrant_version=`wget --quiet -O - https://releases.hashicorp.com/vagrant/ | sed -nr '/.*href="\/vagrant\/([^/]*).*/{s//\1/p;q}' ` # from top of page | ||
| export vagrant_version=`wget --quiet -O - https://releases.hashicorp.com/vagrant/ | awk 'match($0, /href="\/vagrant\/([^/]*)/, a) {if (RSTART) { ++i; v[i]=a[1]}} END {n = asort (v); print v[n]}'` | ||
| # Install packages | ||
| sudo yum -y install https://releases.hashicorp.com/vagrant/"$vagrant_version"/vagrant_"$vagrant_version"_x86_64.rpm git qemu libvirt libvirt-devel ruby-devel gcc qemu-kvm | ||
|
|
||
| # Install vagrant libvirt plugin | ||
| vagrant plugin install vagrant-libvirt ; echo $'vagrant plugin install vagrant-libvirt'>> ~/.bash_profile | ||
|
|
||
| # Download (clone) lab environment from GitHub | ||
| cd ~ | ||
| git clone https://github.com/AnwarYagoub/RHCSA-RHCE-Lab-Environment.git | ||
| cd RHCSA-RHCE-Lab-Environment/ | ||
| ``` | ||
|
|
||
| If RHEL/CentOS runs without GUI, then execute these 2 commands: | ||
| ```shell | ||
| sed -i 's/gui\: true/gui\: false/g' provisioning/RHCSA_RHCE_LAB/defaults/main.yml # no need for gui on commandline | ||
| sed -i 's/vb.gui = true/vb.gui = false/g' Vagrantfile # without GUI vagrant will error with 'vb.gui = true' | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| ### Install Vagrant using VirtualBox on RHEL/CentOS 64-bit | ||
| ```shell | ||
| # Download VirtualBox repository | ||
| sudo wget http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo | ||
|
|
||
| # Clean repository cache & import GPG Key | ||
| sudo yum clean dbcache; sudo yum -y repolist # Import the GPG keys | ||
|
|
||
| # Ensure latest version of Extra Packages for Enterprise Linux is installed | ||
| sudo yum -y install epel-release # should be 7.8 | ||
|
|
||
| # Get latest VirtualBox version | ||
| export virtualbox_version=`yum -y search VirtualBox | awk 'match($0, /(VirtualBox-[0-9]\.[0-9])/, a) {b=a[1]} END {print b}'` # depends on yum sorting | ||
| export virtualbox_version=`yum -y search VirtualBox | awk 'match($0, /(VirtualBox-[0-9]\.[0-9])/, a) {if (RSTART) { ++i; v[i]=a[1]}} END {n = asort (v); print v[n]}'` | ||
|
|
||
| # Install packages | ||
| sudo yum -y install git gcc make kernel-devel $virtualbox_version | ||
|
|
||
| # Install VirtualBox kernel modules | ||
| sudo /sbin/vboxconfig # load the vboxdrv kernel module | ||
|
|
||
| # Check if vboxdrv service is started without errors | ||
| systemctl status vboxdrv # enabled? | ||
|
|
||
| # Check VirtualBox version | ||
| VBoxManage --version # should return no errors | ||
|
|
||
| # Restart machine | ||
| sudo reboot | ||
| ``` | ||
|
|
||
| ```shell | ||
| # Get latest vagrant version | ||
| export vagrant_version=`wget --quiet -O - https://releases.hashicorp.com/vagrant/ | sed -nr '/.*href="\/vagrant\/([^/]*).*/{s//\1/p;q}' ` # from top of page | ||
| export vagrant_version=`wget --quiet -O - https://releases.hashicorp.com/vagrant/ | awk 'match($0, /href="\/vagrant\/([^/]*)/, a) {if (RSTART) { ++i; v[i]=a[1]}} END {n = asort (v); print v[n]}'` | ||
|
|
||
| # Install vagrant | ||
| sudo yum -y install https://releases.hashicorp.com/vagrant/"$vagrant_version"/vagrant_"$vagrant_version"_x86_64.rpm | ||
|
|
||
| # Check vagrant version | ||
| vagrant --version | ||
|
|
||
| # Download (clone) lab environment from GitHub | ||
| cd ~ | ||
| git clone https://github.com/AnwarYagoub/RHCSA-RHCE-Lab-Environment.git | ||
| cd ~/RHCSA-RHCE-Lab-Environment | ||
| ``` | ||
|
|
||
| If RHEL/CentOS runs without GUI, then execute these 2 commands: | ||
| ```shell | ||
| sed -i 's/gui\: true/gui\: false/g' provisioning/RHCSA_RHCE_LAB/defaults/main.yml # no need for gui on commandline | ||
| sed -i 's/vb.gui = true/vb.gui = false/g' Vagrantfile # without GUI vagrant will error with 'vb.gui = true' | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| ### Ubuntu 16.04 | ||
| Instructions for installing VirtualBox & Vagrant on Ubuntu 16.04 | ||
|
|
||
| ```shell | ||
| # Update packages list | ||
| sudo apt update | ||
|
|
||
| # Upgrade Ubuntu & cleanup | ||
| sudo apt -y upgrade; sudo apt -y autoremove | ||
|
|
||
| # Reboot machine | ||
| sudo reboot | ||
| ``` | ||
|
|
||
| ```shell | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @smartbit I think we can organize it better # Generate SSH key to use when accessing machies
ssh-keygen -t rsa -b 4096 -N "" -C "root@example.com" -f ~/.ssh/rhce # empty password
# Make adding SSH key load to ssh agent automatic
eval $(ssh-agent); echo $'eval $(ssh-agent)' >> ~/.profile
ssh-add ~/.ssh/rhce; echo $'ssh-add ~/.ssh/rhce' >> ~/.profile
# Add Virtualbox GPG Key & repository
wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox_2016.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian `lsb_release -sc` non-free contrib" > /etc/apt/sources.list.d/virtualbox.org.list'
# TODO remove linestarve.com and use alternative method to get latest version of vagrant
# Add a repository to download vagrant
sudo bash -c 'echo deb http://vagrant-deb.linestarve.com/ any main > /etc/apt/sources.list.d/wolfgang42-vagrant.list'
sudo apt-key adv --keyserver pgp.mit.edu --recv-key AD319E0F7CFFA38B4D9F6E55CE3F3DE92099F7A4
# Update packages list
sudo apt update
# TODO remove virtualbox version-number and automatically install latest version; dkms needed when upgrading kernel
# Install packages
sudo apt -y --force-yes install virtualbox-5.1 git vagrant # virtualbox-ext-pack dkms
# Download (clone) lab environment from GitHub
cd ~
git clone https://github.com/AnwarYagoub/RHCSA-RHCE-Lab-Environment.git
cd ~/RHCSA-RHCE-Lab-Environment
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more comment is (almost) always better. Please push to the branch
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok I will pull the latest changes and add comments. |
||
| # Generate SSH key to use when accessing machines | ||
| ssh-keygen -t rsa -b 4096 -N "" -C "root@example.com" -f ~/.ssh/rhce # empty password | ||
|
|
||
| # Make loading SSH key to ssh agent automatic | ||
| eval $(ssh-agent); echo $'eval $(ssh-agent)' >> ~/.profile | ||
| ssh-add ~/.ssh/rhce; echo $'ssh-add ~/.ssh/rhce' >> ~/.profile | ||
|
|
||
| # Add Virtualbox GPG Key & repository | ||
| wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox_2016.asc | sudo apt-key add - | ||
| sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian `lsb_release -sc` non-free contrib" > /etc/apt/sources.list.d/virtualbox.org.list' | ||
| export ubuntu_codename=`lsb_release -sc` | ||
| export virtualbox_version=`wget --quiet -O - http://download.virtualbox.org/virtualbox/debian/dists/$ubuntu_codename/contrib/binary-amd64/Packages | awk 'match($0, /(virtualbox-[0-9]\.[0-9])/, a) {b=a[1]} END {print b}'` # depends on sorting in Packages file | ||
| export virtualbox_version=`wget --quiet -O - http://download.virtualbox.org/virtualbox/debian/dists/$ubuntu_codename/contrib/binary-amd64/Packages | awk 'match($0, /(virtualbox-[0-9]\.[0-9])/, a) {if (RSTART) { ++i; v[i]=a[1]}} END {n = asort (v); print v[n]}'` | ||
|
|
||
| # Get latest vagrant version | ||
| export vagrant_version=`wget --quiet -O - https://releases.hashicorp.com/vagrant/ | sed -nr '/.*href="\/vagrant\/([^/]*).*/{s//\1/p;q}' ` # from top of page | ||
| export vagrant_version=`wget --quiet -O - https://releases.hashicorp.com/vagrant/ | awk 'match($0, /href="\/vagrant\/([^/]*)/, a) {if (RSTART) { ++i; v[i]=a[1]}} END {n = asort (v); print v[n]}'` | ||
| wget https://releases.hashicorp.com/vagrant/"$vagrant_version"/vagrant_"$vagrant_version"_x86_64.deb -O vagrant_"$vagrant_version"_x86_64.deb | ||
|
|
||
| # Update packages list | ||
| sudo apt update | ||
|
|
||
| # Install packages | ||
| sudo apt -y install $virtualbox_version git ./vagrant_"$vagrant_version"_x86_64.deb; rm ./vagrant_"$vagrant_version"_x86_64.deb | ||
|
|
||
| # Download (clone) lab environment from GitHub | ||
| cd ~ | ||
| git clone https://github.com/AnwarYagoub/RHCSA-RHCE-Lab-Environment.git | ||
| cd ~/RHCSA-RHCE-Lab-Environment | ||
| ``` | ||
|
|
||
| If ubuntu runs without GUI, then execute these 2 commands: | ||
| ```shell | ||
| sed -i 's/gui\: true/gui\: false/g' provisioning/RHCSA_RHCE_LAB/defaults/main.yml # no need for gui on commandline | ||
| sed -i 's/vb.gui = true/vb.gui = false/g' Vagrantfile # without GUI vagrant will error with 'vb.gui = true' | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is nice that you added a snapshot part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, in case of errors you can give it a clean start. Should also work on platforms other than Virtualbox.
Sander sometimes assumes changes made in previous chapters, sometimes he doesn't. IMHO a candidate RHCSA should be able to make a small script or flip back a few pages, to get on the same page were Sander assumes you are.