Tuesday, February 20, 2018

How to Change Mac Address of a Cloned Virtual Machine - Linux OS

Sometimes for UAT purpose, you need to copy a VM vdi [extension] file of a existing machine and deploy it to another machine using Oracle VM. But after deploying it, you will find that services are not working. That's why, you need to change some parameters so that you services can be up in new your new machine. Here we are providing you the exact step by step procedure for it where the OS is Linux 2.6 :

Step-1: Install oracle virtual box in new machine.
Step-2: Copy the vdi file [Cloned virtual machine] to your new machine.
Step-3: Add the vdi file to your oracle VM. It is recommended to assign 2.5 GB memory for your VM.
Step-4: After adding your vdi, start the machine
Step-5: Login to your Linux OS using your root username and password
Step-6: Open the terminal as root user
Step-7: Type the following-

vim /etc/udev/rules.d/70-persistent-net.rules

At the end of the line, you will see network configuration for your previous machine which is eth0 and current machine as eth1. Now go to edit mode by press Esc key and i [see vi commands list] and delete the configuration line for eth0 and then rename eth1 to eth0. Copy the new mac address now. Save the existing changes

Step-8: Now type the following-

vim /etc/sysconfig/nework-scripts/ifcfg-eth0




Remove the previous mac address and input the new mac address here.

Step-9: Now go to orcale Virtaul box-->Settings-->Network-->Adapter 1 and change the following-

Attached to : Host only adapter
Name: VM Host only adapter

Step-10: Click on Advanced and put your new MAC address here. Save the configuration

Step-11: Now restart your virtal OS in your root user.

Step-12: After the VM is up then go to terminal and type




start_udev

if your don't the do above then you will get message like eth0 does not seem to be present. You need to start the udev again to implement the changes.

Step-13: Now restart the eth0

/etc/init.d/network-restart

Step-14: Done

No comments:

Post a Comment

Followers