27 Responses

  1. Hi Gaurav Verma,

    Thanks your great tutorial
    I’m planning to design an internal network & the internal network should included a router(s)/firewall created by Linux/FreeBSD.

    How can i setup the virtual router that can connect to internet on one interface & the other interface connect to internal network? Also, Can i setup direct connection between two VMs? Just like a ethernet line between them.

    Your tutorial is very helpful, but i don’t know is it the missing piece on my situation.

    Please kindly help ~


  2. Hi Kevin, Thanks a lot for the encouragement in the first place! It is really good to know that this content is helping someone figure out their frustrations.

    Kevin, for your requirement, I think adding a host only or NAT network interface is the answer. if I understand it right, you need

    1) internet connection
    2) have the ability to talk between your 2 VMs
    3) setup a private network between then

    For requirements 2) and 3), setting up a private network will work fine.

    For requirement 1), either NAT or Host only networking will work, but NAT is the easiest to setup (Let it select an IP using DHCP, unless you are really hell bent upon choosing a static IP). For either NAT or host only networking, please see the other 2 articles on this blog:

    # Migrating from vmware to Virtualbox: Making NAT networking type work with SuSE Linux as guest OS and Windows Host

    # Virtualbox Case Study: Making host only networking work between two Ubuntu Guest OS (virtual machine) on Windows Vista host

    Let me know if this helped you at all. I do not know how to design a router from scratch as such, so please forgive my ignorance.


  3. […] Recent Comments Gaurav Verma on Virtualbox Case Study: Making …nurasto on Virtualbox Case Study: Making …A weblog about nothi… on Virtualbox Case Study: Making …Case Study: Discover… on Combining Openfiler and Virtua…Gaurav Verma on Case study: Making Internal ne… […]

  4. Gaurav,

    I have a problem setting up Ubuntu 7.03 as guest OS in Windows Host. Even the NAT networking is not working for me. Not able to understand where I am going wrong. I tried Internal Networking as per your Tutorial. Still not working. BTW I have only one guest OS. Is there something in Vista stopping me to do so.

    Appreciate any quick reply.



  5. Rajesh, make sure you setup the network interface in ubuntu as DHCP. Also make sure the name server is the same as that on your windows host (take it from the ethernet or wireless connection)

  6. Your issue can also be related to a proxy. If you are doing it from office intranet, make sure you set your proxy in http_proxy variable.

  7. My set up is :
    Windows XP SP3 host,
    Sun xVM VirtualBox 1.6,
    Ubuntu 8.04 guest,
    Xubuntu 8.04 guest.

    I followed your tutorial to the letter and everything worked like you said it would. This was a very good tutorial. Thanks a ton, man! Great work 🙂

  8. Surja, Thanks a lot for your encouragement. It is really good to know your feedback.. Thanks

  9. Hi Gaurav
    I found this blog post really useful, and was able to successfully setup network between xubuntu7.10 and Ubuntu8.04 Vbox guests.
    Thanks Man for this really helpful guide.

  10. Hi Gaurav,

    Thanks for your tutorial. In your setup you can have two different IPs in the subnet, but for me I can’t have since I have a private internet connection on my host with a static IP. I don’t want internet connection on my VM guest, but only need to and fro ping from guest and host. Could you please advice me how to do this.

    Thanks a lot in advance

  11. Hi Gaurav,

    I have some sort of problem in the network that was handed to me. This was running before but now, it’s not. The setup is this.

    For the Physical Server (Host)
    IP Address –
    GW –
    SM –

    IP Address –
    GW –
    SM –

    I can ping the gateway of the guest from the physical server(host) but i can’t ping the IP address of the guest. No internet on guest.

    This was working before.What seems to be the problem. Prior to this I upgraded the vmware server from GSX to Vmware server. Will that be a reason why this is not running as before? Can you help me.. please.. thanks.. I’ve been working on this problem for 3 days now and no success..



  12. Hello Gaurav,

    Thanks for the Virtual Box write ups
    I have a couple questions concerning this part:


    Overview of the networking configuration

    Here is how the ifconfig for Gutsy – linux guest OS 1 looks like (as you can see the eth0 IP has been acquired in 10.0.2.x subnet by the DHCP server):
    HWaddr 08:00:27:9A:46:02

    And this is how it looks of Gutsy2 (as you can see, the eth0 IP has been acquired in 10.0.2.x subnet by the DHCP server):
    HWaddr 08:00:27:9A:46:02


    1) What happened to the original Gutsy2 MAC?
    HWaddr 08:00:27:6D:DC:85

    It looks like you pasted the Gutsy ifconfig twice
    instead of using Gutsy2 for the second ifconfig

    2) Would there be any improvement in network speed if used the Intel E1000 vs the PCNet-Fast III(Am79C973) virtual NICS?


  13. Al, you are right. By mistake, I have put the same image for the ifconfig output (that of Gutsy) for Gutsy2 as well. The hardware MAC address for eth1/0 should be different and so should be the the IP address for eth1 — it should be The eth0 IP for Gutsy2 would still be 10.0.2.x as it was of NAT type. — Thanks, Gaurav

  14. Hi, i’m interested in create a virtual network using VirtualBox. Host is Win XP SP2.
    Guest1: Win XP SP2
    Guest2: Win 2003 Server SP1 as a domain controller using LDAP
    Guest3: Win 2003 Server SP1 as a database server using SQL 2005 SP2

    This for a client server app required to validate user first against LDAP.

    given these assumptions, Is it possible to have a virtual network?

    would you provide some basics about how to configure this using VBox?

    Thanks in advance !!

  15. hello!
    thank you very much for this great tutorial!
    i am using it on my project @ OS Admin: samba, nfs, nbd comparisson!
    I have win xp as host.. with Virtual Box two Debian guests. This was exactly what i was looking for. The host only networking looks nice too, but i get my IP from dhcp (student campus) and I would have LAN confflict.
    all works well now, and the two guests are visible by IP.
    indeed, spared me for some hours of searching forums.
    all the best! kiri from Romania

  16. Thanks for these great case studies! They were very helpful! Needed to set up a windows server 2003 guest host as the “main server” for a game design company which would act a domain controller and having windows xp pro connect to it and other domain controllers, all very confusing, seeing as I have ubuntu in virtual box already a simple “ping” between the VM’s was used proove i understand classful IP addressing and all manner of things! 🙂
    Just wanted to say thanks from Terry in England!

  17. Thanks for the tutorial, I used it for VB 2.1.4 and finally got my virtual network up and running after many hours of forum searching.

    One thing I’d like to add (that I learned the hard way after banging my head against the wall many times).

    **Remember to install the “guest additions” VB provides for the guest OSs if your networking doesn’t seem to work despite following the instructions here.**

    Thanks very much for this case study.

  18. Thanks for the help man.
    I appreciate it.

  19. Hi,
    i have created a virtual network with host Vista
    Guest1: Win XP SP3
    Guest2: Ubuntu 8.04
    Guest3: Ubuntu 8.10

    i am able to ping 2 ubuntu machine , but from either ubuntu machines i am not able to ping win xp machine. But am able to ping both ubuntu machines from XP.

    Also i want to know will i have to create one more virtual machine to act as gateway, since i want all the packets to go from one machine with static address.

  20. Hi Gaurav,

    Wonderful…I am searching for this from past 2 days…
    atlast i got it in your blog ….
    great presentation ……… helps a lot for me…

    Thanks So much….

  21. Hi
    I am beginner and need some help in making inter networking between host and virtual machine.On my machine these software are installed
    1. ubuntu 9.04 (Host)
    2. virtual Box 3.0.8
    3. ubuntu 9.04 (virtual machine)
    i have assigned the IP to host eth0 using file /etc/networking/interfaces. while on virtual machine eth0 ip assigned by VirtualBox. i am replacing this IP with same class which assigned host.
    The problem is that, when i was send a ping command from host to virtual machine or virtual machine to host , then response is unreached host.

    any tutorial or web link that helpful for me.thanks for advanced.

    • I have seen the same behaviour and this seems to be some sort of a bug. The workaround seems to be to do the reverse ping first and then try the ping you want to do. It seems to work that way. Good luck.

  22. This post was great ! Awesome ! Thanks for gathering and sharing these info

  23. You have just save my time..I have been using VMware and wanted to try out VB. I had same issues where guest os can’t communicate bwt each other. Your tutorial is great and easy to follow. Now my XP guest can talk to my Ubuntu Server guest.

    Thank you so much, this is awesome…!

  24. Hi, thanks for your post! I have the same problem about the ping as for dany84. Furthermore ssh from host to guest is not working either but http requests are working!
    I wonder why.
    host: Windows Vista
    guest: ubuntu server with LAMP

  25. let the truth be told, i have been trying to do this for 6months!!!!!!!!!!
    thanks man!!

  26. Hi!

    Wonderful post! I need some help. I’m completely new to Linux. I’m trying to set
    up the following scenario:

    +—–+eth0 +—–+ +—+
    | VM2 |———–| VM1 |—————| H |
    +—–+ eth1 +—–+eth0 (NAT) +—+

    VM2 – Virtual machine from Virtual Box, using Ubuntu
    VM1 – Virtual machine from Virtual Box, using Ubuntu: I want this to act as a NAT.
    H – Host, my Windows Vista

    So if I ping H from VM2, H would receive a different IP address from VM2. Could you give me a step by step on this? Not sure what networking notes to use.

    Thanks. Would appreciate the help so much.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: