WHAT'S NEW?
Loading...

How to create a CentOS 6.7 Virtual Machine with VirtualBox

Sometimes you need a portable virtual machine to distribuite to collegues in the office, we will use the minimal CentOS distribution to create a virtual machine with VirtualBox



 Go to this web site and select the mirror site you like more

http://isoredirect.centos.org/centos/6/isos/x86_64/

The file for this tutorial is named CentOS-6.7-x86_64-minimal.iso

The aim of this ISO image file is to install a very basic CentOS 6.7 system, with the minimum of packages needed to have a functional system.Open VirtualBox and create a new VM with these params:

Name: Centos6_7
OS: Linux
Version: RedHat (64 bit)

Ram 1024 or 2048, this depends from your PC
CentOS
Create a New Disk --> dynamic archiaviation --> 10 gb

If you are ready, start the VM and login as Root
.
Sure the start is working, but the network is, probably, not yet configured as necessary. Try to ping Google over Internet:
ping google.com
You'll possibly see…
ping: unknown host google.com
That's weird. Everybody knows Google! Most probably, CenOS has no Internet access so far.
Let's edit the ifcfg-eth0 file:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
Press i (to insert mode). Change the following lines as below:
ONBOOT=yes
NM_CONTROLLED=no
Press ESC (back to command mode). Enter command :wq!.
Keyboard issue
Try to write by keyboard and if you have problems with weird keyboard settings, such that you can’t use the pipe (passing information from command to command), dash (for command parameters), @ (email sign), etc keys. Use this command to change the keys temporarily and then make a change to

/etc/sysconfig/keyboard
to make a permanent change to keyboard
loadkeys us # or your own locale
vi /etc/sysconfig/keyboard # replace KEYTABLE value to your 
Restart and try to ping google.com again.
Now install wget utility that help you to download file
# yum install wget
Install the Midnight commander file manager, it is very usefull for local and remote session via ssh.
# yum install mc
Now add mysql repositories to start mysql install
# wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
# yum localinstall mysql57-community-release-el6-7.noarch.rpm
verify that the MySQL Yum repository has been added successfully by using following command.
# yum repolist enabled | grep "mysql.*-community.*"
Install latest version of MySQL (currently 5.7) using the following command.
# yum install mysql-community-server
Start MySQL Server
# /etc/init.d/mysqld start
Execute the command mysql_secure_installation that  allows you to secure your MySQL installation by performing important settings like setting the root password, removing anonymous users, removing root login, and so on.
# mysql_secure_installation
be sure you don't forget to install an SSH server:
# install openssh-server openssh-clients
configure the network card by edit configuration files stored in network-scripts directory
cd /etc/sysconfig/network-scripts
create a file named ifcfg-eth1 as follows
DEVICE=eth1
HWADDR=08:00:27:EA:16:DE
TYPE=Ethernet
UUID=81039dee-1cd6-4e2e-8a25-54ae6069d44c
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
NETWORK=192.168.32.1 #your PC IP
NETMASK=255.255.255.0
IPADDR=192.168.32.103 #the address you want give to this Virtual Machine
USERCTL=no
You are ready to start the VM and login by ssh 192.168.32.103
Need more infos? Try these links:
http://vichargrave.com/how-to-create-a-linux-virtual-machine-with-virtualbox/
http://pvalue.ru/install-centos-6-oracle-virtualbox
https://www.ulyaoth.net/resources/tutorial-ssh-into-a-virtualbox-linux-guest-from-your-host.35/

0 comments:

Post a Comment