Assisting 13848744 developers since 2005.

Web Developer, Open Source, Loyal, Dad.  

Read More »

How to Configure VirtualBox with a Static IP in Linux

Posted by David  •  Feb 18th, 2015 7:17:42 pm - Subscribe | Mood: good | Music: Study Music - Music To Make You Smarter

In this entry I will go over how to easily configure VirtualBox and assign your linux machine a static ip.

I am using GNU/Linux CentOs 6.5 as my disto. you may be using something like Ubuntu and if so then that is ok. The main focus here is how to allow VirtualBox to communicate through your network interface card. Once that is completed you can configure your linux machine via it's GUI or the CLI.

Let's get started!
1. Open VirtualBox - I am going to assume that you have your distro already installed on VirtualBox.
2. Click on Network or right click on your distro and go to settings and choose Network.
3. Under Adapter 1 - Checkmark to enable adapter
4. Attached to: Choose Bridge Adapter
5. Name: Choose how you are connected to the internet, you will see a list of adapter names. If you are connected via ethernet (cable) chose that one, or if you are connected to the internet via wifi choose that one. (I am connected via en0: Wi-Fi (Air Port)
6. Now click on the down arrow
7. Adapter type: Choose MT Desktop
8. Promiscuous mode: Choose Allow VM's
9. Click Ok
10. Start your VM

Now you will need to configure your network setting on your Linux VM. I won't go into detail, but my commands are like this.

$ vim /etc/sysconfig/network-scripts/ifconfig-eth0


Be sure to also check your DNS at /etc/resolv.conf

$ vim /etc/resolv.conf


That's pretty much it. If you need info on how to assign a static IP in a Debian based system such as Ubuntu follow this documentation and search for Static IP Address Assignment.

Comments 0  •  Feb 18th, 2015 7:17:42 pm - Subscribe  •  Tweet this entry | Post a comment


Leave a Reply


Posting as anonymous Anonymous guest, why not register, or login now.

Image Gallery


Amazon Wishlist Stumble Upon Toolbar
Internet Blogs - Blog Top Sites Internet Blogs - Blog Top Sites Technology

About Me


iPhone: 29.513522,-98.565523 Web Designer, Open Source, Loyal, Dad. Learn more...