Configuring a Static IP for VirtualBox VM in Ubuntu along with Internet Connectivity in Virtualbox

Leave a Comment

Configuring a Static IP for VirtualBox VM in Ubuntu along with Internet Connectivity in VirtualBox


If you have provisioned any Ubuntu Server/VM running using Oracle Virtual box and want to have both static IP and Internet connectivity enabled. This is the right place for you to learn how to make the required configurations to achieve this.

For this task, we will need to add two Network adaptor , If you also need your VM to have internet access as well, leave Adapter 1 as NAT and enable Adapter 2, configured as a Host-Only adapter. This will allow your VM to connect to the internet using NAT as well as make a local connection to your Host using Host-Only.

1.  Adaptor 1 - NAT

2. Adaptor 2 : - Host only adaptor


Steps:

1. Shutdown/ Power off  the VM 

2. Go to the VM settings and Select adaptor 1 as NAT as shown in the below screenshot.





3. In the advanced setting, select the port forwarding and configure port forwarding as below

for the 'NAT'. I clicked the 'port forwarding' option at the bottom of the screen. I gave it a name 'PuTTY-port-fwd', protocol TCP, host IP 127.0.1.1 host port 2222 guest IP 10.0.2.15 guest port 22. I then launched PuTTY and set it to 127.0.0.1 port 2222 and it connected to my ubuntu vm







4. Power on the VM and let it boot until login prompt  is available , Open any putty terminal,  i use mobaxterm for the ssh access.

Verify ssh access using ssh -p 2222 himanshu@127.0.1.1



Booyeah!  you have successfully configured your Ubuntu VM to be accessible via Putty session along with the internet access.

I hope this post was helpful for you.

Also read : 




Read More...

Passed CKA exam with 87% marks in First attempt

Leave a Comment

Hi all,  today we are going to talk how you can prepare and pass the CKA exam with great marks.

Last month in November, i scheduled and passed the CKA exam with 87 percent marks.

I will share the tips to crack the CKA exam in the first attempt.


CKA exam


Why CKA 

Read More...

Assign static IP address to Centos/RHEL 7 Virtual machines in Oracle VirtualBox

Leave a Comment

Hello readers, in this post we will learn how we can set up static IP address to the Virtual machines created using Oracle Virtual Box.


In case you want to install Oracle Virtual Box and deploy a Linux VM like Ubuntu or Centos on it, please read old post with detailed steps.


When we created these virtual machines, they have IP address assigned which are from the bridged adaptor on my Wi-Fi router network. So, the ip address that my virtual machines are getting are assigned by the Wi-Fi router using dhcp. As the IPs assigned by the DHCP router are dynamic so they can change anytime when you reboot the machines.  Sometimes, when you reboot the machines, you will find that the IP address assigned got changed than the one they had before.


So, in case you want to have your virtual machines to have static IP address, this cannot be achieved using the bridged network, so a alternate way is to create another network that will be host only network. 


It will be a network on my Laptop and my laptop will have a virtual interface on that network and all of the virtual machines will have a virtual interface on that network and we can assign static IPs for the VMs on that network.






In this post, we have performed steps on CentOS 7.9 Linux VM.


Open Host Network Manager from the File menu or Network option from the Tools menu



Host only Ethernet Adapter

Here you will see list of Host only networks that are already created, sometimes you will one of the default as shown in screenshot below already created, else you can create new host only ethernet network.



In this case, i am going to use default one with IP address range 192.168.56.1/24  Make sure dhcp server option is unchecked.





Once you have identified the host only network, you need to attach this network to your virtual machines. Right click on machine and choose settings and go to network.

Adapter 1 with Bridged Network for internet access 



In the adapter one, you can see it is attached to Bridged network which is required for internet connectivity if you want to download any packages. 






Go to Adapter 2 and select attached to : Host-only adapter , leave everything else as default.







Now we have two adapter attached to the machine, one is the bridged router and second one is host only adapter. Click on OK and power on the Virtual machine. You will see a new interface is attached and verified using the ip a s command or ifconfig command,  however IP address is still not assigned to the interface.


Configure Static IP Address in CentOS 7 / RHEL 7




Perform below steps to create a new config file for the newly added interface enp0s8


# cd /etc/sysconfig/network-scripts# vi ifcfg-enp0s8

Add below to the ifcfg-enp0s8

NAME=enp0s8

DEVICE=enp0s8

BOOTPROTO=none

DEFROUTE=yes

ONBOOT=yes

PREFIX=24

IPADDR=192.168.56.2

save and quit the file.


Restart the network service using below command



# systemctl restart network



Now, you will see that IP address 192.168.56.2 given in the config file is plumbed on the interface enp0s8



You can reboot the machine and test ssh via IP, You have successfully assigned static IP address to your Centos 7 /RHEL Linux machine.



Read More...

Steps to Clone Virtual Machines in Oracle VirtualBox

Leave a Comment

Hello readers,  in our last post, we learnt about installing Oracle Virtual box and deploying a Centos 7 Linux machine using the vdi image.  In case you have a scenario to create multiple machines with similar configurations,  you don't need to repeat the steps to install or deploy a new machine.  You can use Cloning feature of Virtual Box to create more machines.



I was setting up a Lab environment for creating Kubernetes cluster and deployed machine 1 on Oracle Virtual box, to create remaining nodes of the cluster, I used the cloning feature of Virtual Box t that is a really great feature.


Steps to Clone a Virtual Machine in Oracle Virtual machine

Power off the machine that you want to clone.  Make sure the virtual machine is powered off before starting the clone steps else the option will be greyed out or disabled.


Right click on the machine, you want to clone and click on Clone option.




In the next step, you will come across below UI , Enter the name of machine and I have used the Mac Address Policy as "Generate new MAC addresses for all network adapters"



This option makes sure that the clone VM don't get the same MAC address assigned as that of the source VM



You may leave the Additional Options unchecked.



In the next step, you need to choose between Full clone or Linked clone,  Full clone creates a full copy of your virtual hard disk while linked clone does not create full copy of virtual hard disk and helps to save disk space.



For my use case,  Linked clone option was fine.  You may use Full clone option as well depending upon your case.




Click on clone option and instantly your source VM will be cloned.



Power on both machines and they are ready to use.



Also read : 40 Linux commands for Beginners and intermediate users

Hope you are able to do the clone of your virtual machine following these steps.




Read More...

How to apply and get Color coded stickers for your vehicle in Haryana with steps

2 comments
Ministry of Road transport and Highways have made a move last year to have High Security registration Plate and color coded stickers affixed on your vehicle for all the vehicles that have been sold before April 2019. The idea and goal behind this move is to prevent Vehicle theft and easing the tracking. Violators are being fined for Rs 5500 in case the vehicles are not fitted with both High security registration plate or color coded sticker.





In case you already have the High security registration plate (HSRP) and just want to have color coded sticker for your vehicle, the process to get it is quite simple that we will see in this post.



The process has been simplified and made online,  Just apply for the color coded stickers on www.hsrphr.com and make the payment online and choose a time slot/date as per your convenience and get the same on the chosen time.



Note : Keep the Front and Rear Laser code of your HSRP handy with you, you can find it as shown in image below.






This post explains the steps for Color coded stickers for vehicles based in Haryana via hsrphr.com, you can also try bookmyhsrp.com that is nation wide site.


Follow the steps as given below:


Go to website https://www.hsrphr.com/ and choose the option for the color coded sticker or Go to website https://www.hsrphr.com/sticker/BookingDetail.aspx link directly to go to sticker booking menu 

 

Fill the details asked in step one that is the Vehicle Registration number,  Last 5 digit of Chassis number and Engine number.  Enter the captcha code and hit on Click here.





Next, it will automatically fill some details like BS number, Vehicle registration date, Fuel type, Vehicle company, type and Category.






In the next step you need to choose the Fitment location that is most feasible to you. I am based in Faridabad currently, hence I choose the nearest option to me.





Once you have selected the Fitment location, confirm the date/slot as per your feasibility. The most recent available was 24th February for me, however I selected 6th March as I wanted weekend.



Review the Booking summary and click on confirm and proceed.



In the next step, you will see the total cost and breakup of the cost with taxes. The total cost for my car came out to be Rs 146.88




Agree to the terms and conditions and go ahead with the payment.


Once payment is completed,  you will get SMS and email regarding the registration confirmation with a summary and a receipt that is valid 2 weeks extra than your booked date.  This receipt can be shown in case you are asked by anyone regarding the Color coded stickers for your vehicles.



Please note you need to carry the receipt and RC copy on the day of the appointment

Read More...

Install Oracle VirtualBox and deploy Centos 7 machine with screenshots

Leave a Comment

Install Oracle VirtualBox on Windows 10 Laptop and deploy Centos 7 machine with screenshots

Hello and welcome to this blog post, In this post we are going to learn how we can set up a Lab environment on our Laptop. We are going to use Oracle Virtual box to setup a lab with a virtual machine and Centos 7.9 installed on it. 


You can choose VMware workstation as well or any virtualization technology you are comfortable with as an alternative option to Oracle VirtualBox.



Install VirtualBox on your Laptop


Download the Oracle Virtual Box software and install the same. It is supported for Linux, Windows, Macintosh  and Solaris

Download page https://www.virtualbox.org/


Go to the download page and install the software for the Laptop OS , in this post we have used Windows 10.




Once downloaded, run the executable and setup wizard, installation is very easy.  Click on the installer with .exe and click on next.





Click next and select the location. We are going to set the default options.








Finally read the warning about the network interfaces, its going to reset the network connection.



Click install and it goes through the installation process and it finishes in a minute




Once installation is finished,  you will see the Oracle Virtual Box interface as shown below






How to install/deploy a Centos Machine on VirtualBox


To deploy the virtual machine, you need a image of the OS you want to deploy. In this demo, we are setting up Centos 7.9 machine.


Download the image from https://osboxes.org/  There are lot of images available for different OS versions,  if you want to download centos image, go directly to https://www.osboxes.org/centos/





It will download a compressed .7z file and it takes about 1 GB space. Once downloaded extract the .7z file.  You will find the centos vdi image in the 64bit folder.





Now go back to Oracle virtual box and start deploy the centos machine.

Click on Machine - New 


It will bring below interface, here you need to specify the name and the OS that you want to install.


Choose Redhat 64 bit as version.






In the next step, select the memory size you want for your machine, i have used 2 GB for my centos 7.9 machine.




I am going to go ahead and select the hard disk, i have used Use an existing virtual hard disk and browse to the path where you have centos vdi image downloaded. 





Click on choose and create




Now, it has deployed the centos image or Centos virtual machine.





Before powering on the Centos machine,  update the settings options and select the network option and set the network type to bridged.  By default, you will find it as NAT.


Update the same and set it to Bridged Adapter and adapter that is going to be bridged to is my wifi router.





You can now proceed to start your virtual machine.









You can now proceed to login to your machine, the password is same as that of user i.e osboxes.org in lowercase.

Hope you are able to deploy centos Linux machine following this tutorial. Feel free to comment in case you are facing any issue or having any doubt.

Read More...

How to install R and RStudio on Linux - CentOS or RHEL 7 in 5 minutes

Leave a Comment

R is a programming language used for statistical computing commonly by Data Scientists and analysts. It is free and open source tool under GNU project and R is maintained by R foundation.


In this article we will learn how to install R and R Studio on a Linux server that can be Centos 7 or Red hat Enterprise Linux 7.  


Please note :  You can install either using root user or a non root user with sudo rights.





Step 1 : Install R 

First, you need to install the epel repo for centos and rhel using below command. Make sure yum works on your machine.

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Install R software using below command

sudo yum install R -y


Once yum completes the installation of R package, you may verify the same using below command.

On your Linux machine, run command R, if successfully installed you will see output as given below.

root@techbuzztimes #  R 






You are done with one part that is R installation, next you need to install R studio.



Step 2: Install R studio


You can find the latest version of R studio for Centos and RHEL 7 from here
Make sure wget is installed on your machine, you need to download the package first and then install it using yum command as given below

wget https://download2.rstudio.org/server/centos6/x86_64/rstudio-server-rhel-1.3.1093-x86_64.rpm
sudo yum install rstudio-server-rhel-1.3.1093-x86_64.rpm

During the installation, at the end it will try to enable and start the service as shown in below screenshot, make sure Rtsudio service is up and running.



Check the Rstudio service using below command.

systemctl status rstudio-server.service

Make sure service is enabled so that it comes up after the server restarts.

systemctl enable rstudio-server.service


Step 3 : Verify Rstudio GUI 

Ok, so you are done with the installation steps, now you can go ahead and verify the R studio gui on web browser.

By default, R studio runs on port 8787


In your web browser open URL http://hostname:8787


You will see gui like below



You can verify access on the R studio using any user, make sure user exists on the server and having valid home directory on the server, you may check using below command.

getent passwd username


Once successfully logged in, you will see Gui as shown below. All these steps will take between 5 to 10 minutes.  Please let us know how your R studio installation went in comments.



 

 

Read More...