Wednesday, January 13, 2016

Adding Virtualbox Guest Additions and Google Chrome to Centos 7

One effective strategy in preparing for the RHCSA certification is to spend as much time in a Centos environment as one can doing the kinds of things one does each day with a computer.  I'm not prepared yet to give up my Ubuntu desktop, but I've found VirtualBox to be a fine way to switch OSs with ease.

We will be using VirtualBox VMs extensively in our Linux System Administration course, and we have installed two by default, one with a Gnome GUI and one without a GUI.  I want to be able to run the VM with a GUI in full screen mode on my 2560 x 1600 resolution monitor instead of the 1024 x 768 resolution that runs in the VM by default.  I would also like to be able to switch mouse control in and out of the VM without having to press the right control key.  Both of these wishes are granted by the VirtualBox Guest Additions.

As this post explains, all you have to do to get your Centos 7.2 VM ready for Guest Additions is to run:
# yum install epel-release
# yum install dkms
After that, select:
Devices -> Insert Guest Additions CD image...
from the menu of the window containing your running VM, and click on the buttons to download and then mount the image.  After doing that, I changed to the directory where the CD image was mounted with:
# cd /run/media/user/VBOXADDITIONS-$.3.34_104062
and ran:
# ./VBoxLinuxAdditions.run
and then:
# shutdown -r now
After that, I had everything I wanted.  I can resize the window, or maximize it (with Right Control & F keys).  When not full screen, mouse control is transfered to the VM whenever the mouse pointer enters its window and back to the host OS whenever the mouse pointer leaves its window.

In fact, beginning with this sentence, I editing this blog entry from my full screen Centos 7.2 desktop:

Installing Chrome


Then next task to setup a fully functioning desktop is to install Google Chrome.  Here is how to do it:
  1. Create a file /etc/yum.repos.d/google-chrome.repo with the following contents:
    [google-chrome]
    name=google-chrome
    baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
    enabled=1
    gpgcheck=1
    gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
    
  2.  # yum install google-chrome-stable
That's all there is to it.  This has been another fine experience with Centos.  I'm liking it more and more each day ;-)

No comments:

Post a Comment