Getting your VirtualBox VM to work with Tata Photon data card

As described in one of my previous post -> Run CentOS VM on your windows laptop, it is easy to get an Oracle VirtualBox VM to host CentOS on your windows laptop.

On a Wifi network the VM fires up fine and is able to access the outside world. However, if you’re a road warrior and need to be able to use the VM while being connected through the Tata Photon Plus data card then follow the steps below –

So let’s get the VirtualBox VM Manager and the CentOS VM to work fine in the following scenarios –

  1. Office/home network with wifi connectivity
  2. Tata Photon data card – USB connectivity

For #1 – Office/home network with wifi connectivity 

  1. Setup the eth0 in DHCP mode as described previously

For #2 – Tata Photon data card – USB connectivity 

Setting up Internet connectivity

  1. In Windows, Go to -> Control Panel\Network and Internet\Network Connections
  2. On the Photon Plus network connection, do a Right Click -> Properties -> Sharing
  3. Select “Allow other network users to connect through this …. “
  4. In the drop down select “VirtualBox Host-Only Network”. Hit OK. If you were previously connected, disconnect and connect again.
  5. Open up a dos console and hit “ipconfig“, note down the IP that you see against “Ethernet adapter VirtualBox Host-Only Network:”

Setting up VM Networking

  1. In the Oracle VM Virtual Box Manager interface, located your VM instance.
  2. Open up Network
  3. Adapter 1 is setup for Wifi access. Leave it alone.
  4. Click on Adapter 2, Select the following values
    1. Attached to -> Host Only Adapter
    2. Name -> VirtualBox Host-Only Virtual Adapter
    3. Jot down the MAC address as shown in Advanced
  5. Now you’ve exposed Virtual Adapter #2 to your VM.
  6. Now power up your VM instance
  7. It might take an unusually long time as it might unsuccessfully try to acquire an IP address for eth0, which was set to auto-start previously. Inhale slowly and deeply. Exhale. 50% done.
  8. Log into the instance via the console
  9. Now go to
    /etc/sysconfig/network-scripts/
  10. Fire up your favorite editor (mine’s VI) and punch in the following
    1. DEVICE="eth1"
    2. BOOTPROTO="static"
    3. HWADDR="08:00:27:24:7D:07" #this is the MAC address that you jotted down above in step “VM Networking #4->3.”
    4. IPADDR="192.168.137.10" #this is a hard-coded IP address from the same series (just change the last octet) that you jotted down in “Internet connectivity #5”
    5. NETMASK="255.255.255.0"
    6. GATEWAY="192.168.137.1" #this is the hard-coded IP address as jotted down in “Internet connectivity #5”
    7. NM_CONTROLLED="yes"
    8. ONBOOT="yes"
    9. TYPE="Ethernet"
    10. UUID="c9a64bf5-fa0c-4d65-8237-a340335b699f"
  11. Save and rename the file “ifcfg-eth1”
  12. Almost there. About 80% done.
  13. Now open up /etc/resolve.conf
  14. Add “nameserver 8.8.8.8” as the first line in the file. Save.
  15. Now let’s bring up the eth1 interface.
  16. Run the following command ->ifup eth1
  17. If all goes okay, you should instantly come back to the command prompt, without any errors.
  18. Now do a “ping google.com” to see if you are able to access the internet.
  19. From putty you should be able to connect just fine to this server using the IP address as given in step “VM Networking #10->4”

 

When you’re connected via Wifi connection do remember to turn off eth1 via ifdown eth1 (to bring it back up use ifup eth1).

When you’re connected via Tata Photon Plus connection do remember to turn off the eth0 via ifdown eth0 (to bring it back up use ifup eth0)

Advertisements

Author: anand

Currently CleverTap. Founder & ex-CTO - burrp. A techie and an entrepreneur at heart. Have worked in US, China and India.

5 thoughts on “Getting your VirtualBox VM to work with Tata Photon data card”

  1. Hi Anand,

    While doing the stated steps, I did not find “VirtualBox Host-Only Network in drop-down also got pop-up of “Access Error in sharing” while Hitting OK.

    Looking for your expert advice.

  2. Hello Anand
    This is what exactly I was looking, but I am stuck at one step.
    Can you please let me know, where is
    /etc/sysconfig/network-scripts/ & /etc/resolve.conf
    in Windows 8
    Thank you
    Hemant

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s