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.