Thursday, November 24, 2016

CentOS 6 with GUI after vagrant up

Introduction

In the previous post (http://leaders-skills.blogspot.kr/2016/11/linux-in-vagrant-and-virtualbox.html), you might have created Linux in the vagrant and virtualbox environment.

Now, you can set up a GUI environment for CentOS 6, as follows:
1. Install CentOS 6 update
2. Install "Desktop" packages

3. Install VirtualBoxGuestAdditions and related packages (optional)
4. Install ubuntu fonts (optional)
5. Modify Vagrantfile (optional)

<CentOS 6 with GUI>

Installing CentOS 6 update

You can login to the virtual machine (CentOS guest) and update it by running:

mict@mict:~/centos6$ vagrant ssh
[vagrant@localhost ~]$ sudo yum update

Loaded plugins: fastestmirror, security
Setting up Update Process
base                                                                                        | 3.7 kB     00:00    
base/primary_db                                                                     | 4.7 MB   00:00    
extras                                                                                      | 3.4 kB    00:00    
extras/primary_db                                                                  |  37 kB     00:00    
updates                                                                                   | 3.4 kB     00:00    
updates/primary_db                                                               | 3.7 MB    00:00    
Resolving Dependencies
--> Running transaction check
---> Package bind-libs.x86_64 32:9.8.2-0.47.rc1.el6_8.1 will be updated
---> Package bind-libs.x86_64 32:9.8.2-0.47.rc1.el6_8.3 will be an update
... [deleted] ...
util-linux-ng.x86_64 0:2.17.2-12.24.el6_8.1                

Complete!
[vagrant@localhost ~]$

You have to reboot the virtual machine here for step 3.

Installing "Desktop" packages

You can group install by running:

[vagrant@localhost ~]$ sudo yum groupinstall Desktop
Loaded plugins: fastestmirror, security
Setting up Group Process
Determining fastest mirrors
 * base: ftp.neowiz.com
 * extras: ftp.neowiz.com
 * updates: ftp.neowiz.com
base/group_gz                                                                                | 226 kB     00:00    
Package 1:dbus-1.2.24-8.el6_6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package NetworkManager.x86_64 1:0.8.1-107.el6 will be installed
--> Processing Dependency: ppp = 2.4.5 for package: 1:NetworkManager-0.8.1-107.el6.x86_64
... [deleted] ...
xulrunner.x86_64 0:17.0.10-1.el6.centos
zenity.x86_64 0:2.28.0-1.el6                         

Complete!
[vagrant@localhost ~]$

You have to run startx after login to the CentOS 6 virtual machine. 

[vagrant@localhost ~]$ startx

Installing VirtualBoxGuestAdditions and required packages (optional)

You will need to install VirtualBoxGuestAdditions to resize the CentOS GUI. The installation of VirtualBoxGuestAdditions needs some required packages beforehand. You need to run:

[vagrant@localhost ~]$ sudo yum install kernel-devel kernel-headers gcc
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
... [deleted] ...

Dependency Installed:
  cloog-ppl.x86_64 0:0.15.7-1.2.el6        cpp.x86_64 0:4.4.7-17.el6        glibc-devel.x86_64 0:2.12-1.192.el6  
  glibc-headers.x86_64 0:2.12-1.192.el6    libgomp.x86_64 0:4.4.7-17.el6    mpfr.x86_64 0:2.4.1-6.el6            
  ppl.x86_64 0:0.10.2-11.el6             

Complete!
[vagrant@localhost ~]$

Now, you can download the image by running:

[vagrant@localhost ~]$ wget http://download.virtualbox.org/virtualbox/5.1.10/VBoxGuestAdditions_5.1.10.iso
--2016-11-24 01:01:37--  http://download.virtualbox.org/virtualbox/5.1.10/VBoxGuestAdditions_5.1.10.iso
Resolving download.virtualbox.org... 182.162.106.10, 182.162.106.35
Connecting to download.virtualbox.org|182.162.106.10|:80... failed: Connection timed out.
Connecting to download.virtualbox.org|182.162.106.35|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 59408384 (57M) [application/octet-stream]
Saving to: “VBoxGuestAdditions_5.1.10.iso”
100%[==========================================================>] 59,408,384  11.2M/s   in 5.1s   
2016-11-24 01:02:45 (11.2 MB/s) - “VBoxGuestAdditions_5.1.10.iso” saved [59408384/59408384]

[vagrant@localhost ~]$ sudo mkdir /mnt/VBoxGuestAdditions
[vagrant@localhost ~]$ sudo mount -o loop,ro VBoxGuestAdditions_5.1.10.iso /mnt/VBoxGuestAdditions
[vagrant@localhost ~]$ sudo sh /mnt/VBoxGuestAdditions/VBoxLinuxAdditions.run 
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.1.10 Guest Additions for Linux...........
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
vboxadd.sh: Building Guest Additions kernel modules.
vboxadd.sh: Starting the VirtualBox Guest Additions.

Could not find the X.Org or XFree86 Window System, skipping.


[vagrant@localhost ~]$ rm VBoxGuestAdditions_5.1.10.iso
[vagrant@localhost ~]$ sudo umount /mnt/VBoxGuestAdditions 
[vagrant@localhost ~]$ sudo rmdir /mnt/VBoxGuestAdditions

Now, you have a CentOS 6 virtual machine with GUI. Step 4 and 5 will make it better in another post.

Tuesday, November 22, 2016

Linux in the Vagrant and VirtualBox environment


The whole is greater than the sum of its parts.


Introduction 

There are many ways to install Linux on a desktop PC. A freshly installed Linux can be a powerful environment, in particular. However, when you want to develop or just experiment with some software packages in a variety of operating systems, it is very time consuming to reinstall each operating system using a CD-ROM/DVD.

Vagrant (http://www.vagrantup.com) is an extremely useful tool for those who wish to experiment with Linux on a Win PC. A combination of Vagrant and VirtualBox (http://www.virtualbox.org) is a powerful tool which makes the installation of Linux possible with a couple of commands.

Basically, VirtualBox is a software package which allows you to virtualize another PC on one PC. With the help of VirtualBox, you can run Win on Linux and vice versa. Sometimes, you may wish to have a fresh copy of a certain version of Linux to repeat your experiment for debugging purposes.

 <Win on Ubuntu>


Installing Vagrant and VirtualBox

The two software packages can be downloaded from http://www.vagrantup.com and http://www.virtualbox.org. You can follow the standard installation method, depending on your host PC environment.

How to install CentOS 6 on Ubuntu  

Once you have Vagrant and VirtualBox installed, you can create a virtual machine (guest), quite easily by running the following commands:



mict@mict:~$ mkdir centos6
mict@mict:~$ cd centos6
mict@mict:~/centos6$ vagrant init centos/6
A `Vagrantfile` has been placed in this directory. You are now ready to `vagrant up` your first virtual environment! Please read the comments in the Vagrantfile as well as documentation on `vagrantup.com` for more information on using Vagrant.
mict@mict:~/centos6$ 

mict@mict:~/centos6$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos/6'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'centos/6' is up to date...
==> default: A newer version of the box 'centos/6' is available! You currently
==> default: have version '1609.01'. The latest is version '1610.01'. Run
==> default: `vagrant box update` to update.
==> default: Setting the name of the VM: centos6_default_1479801951475_89912
... [deleted] ...
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Rsyncing folder: /home/mict/centos6/ => /vagrant
mict@mict:~/centos6$

deliberate practice (의도적 연습)

"Living in a cave does not make you a geologist," Anders humorously observes, "and simply being in a management position does not make you a great leader." Researchers are clear that not all practice makes perfect. You need a particular kind of practice - "deliberate practice" - to develop expertise.

Deliberate practice has five elements or characteristics:
1. It is designed specifically to improve performance.
2. It has to be repeated a lot.
3. Feedback on results must be continuously available.
4. It is highly demanding mentally.
5. It isn't all that much fun.

 (pp. 128-131, The Truth about Leadership, James M. Kouzes and Barry Z. Posner)

"동굴에 산다고해서 지질학자가 되는 것은 아니며, 단순히 경영자의 위치에 있다는 것으로 위대한 리더가 되는 것이 아니다."라고 앤더스 에릭슨은 익살스럽게 관찰한다. 모든 연습이 완벽하게 만드는 것은 아니다는 것은 연구를 통해 명백하다. 전문성을 발전시키기 위해서는 특별한 종류의 연습 - 의도적 연습 -이 필요한 것이다.