64 Responses

  1. Hey Gaurav,

    I liked the way you have presented your ideas pictorially . Looking at the pictures and your documentation, one can easily understand the topic.

    Keep Blogging !!!

  2. Hi Gaurav,

    What a great case study, your step by step instruction make me understand very well how to setup network under virtualbox. The most clearest virtualbox network setup explaination which I found from google.

    Thank you!

  3. Hello Nurasto, Thanks a LOT for your kind words. I was just like many other wannabe opensource experimenter who wanted to get this good looking piece of software work, but faced many silly issues. To make it easier for the next person, i thought it would make sense to jot these ideas down. I am very thankful that virtualbox.org people linked these articles on their howto page and hence allowed more people to look/evaluate the ideas. Wishing you good luck — regards, Gaurav

  4. Hi Gaurav,

    May be you know how setting up Host Interface Networking based on TCP/IP routing.

    Best regards

    Arik

  5. I don’t understand why have you created two adapters in virtual machines (eth0 and eth1)?

    • He’s running two virtual machines. One adapter is bridged to the host’s physical network adapter to access the outside world. The other adapter is bridged to the second VM’s virtual adapter, so the two VM’s can communicate directly.

      • Hi,

        I have the same question as Mario had. I am using Ubuntu 9.04 and I can’t see such two options. How can we create this two type of interfaces? I just got VIirtualbox 1 on both VMs.

        Can you inform how to create two interface?

        Thanks.

        • If you are talking about creating bonding, then it would need to be done through command line. Kindly google and you will find really good examples. Im a little short of time with my current projects right now. Sorry. If you do find a good link, please post a comment and I will approve them. Thanks much and sorry.

          • Actually I am not sure, host networking is useful for me or not. What I want to do is explained here. Any help is appreciated.

            [1] I have two separate host machines.
            [2] On each machines I have multiple Ethernet connection. [using USB to Ethernet converter]
            [3] Now I want to install guest OS in such a way that it can have only single Ethernet connection to it. So if I install 3 guest os on host machine, they 3 have different Ethernet connection and they should not talk to each other.
            [4] I am running routing software Quagga [on Ubuntu guest os] and it should connect to the other guest machines installed on other host machine over the network.

            So basically, I want to assign separate Ethernet interface to separate guest OS.

            So can you help me in this?
            Which networking type [host-only, bridged or NAT] I should use? I have to give static ip address to each guest os Ethernet interface.

            Thank you.

            • Have you looked into private networking article on this blog website?

              • Hi,

                I am able to do this using bridged networking. I just assign different interface to different guest and separate static ip address for each interface. I am able to perform routing by this way.

                Thanks everyone for help.

  6. Hey Gaurav
    Thanks man for all your contribution for making it work. I am following your case studies to use virtual box on my setups. Gaurav I am facing one big problem.
    I want to set up host only interface when we add an adapter to the bridge then my network on host system gets lost. And it do not come up. It says network cable unplugged. I am using windows XP as host system and ubuntu8.04 as guest. Can you help me in resolving this issue?

    Thanks in advance.

  7. Hi gaurav…………………

    Xcellent !!!!!!!!!!!!!!!!!!!!. it worked. thanks a lot !!!!!!!!!!!. I was looking for such a solution. Thanks and keep up the good work !!!!!!!!!!!!!!

  8. Excellent tutorial! Very well laid out and presented in clear graphical fashion.

    And maybe more importantly it works!

    Is it just me or does there seem to be a bit of attitude on the virtualbox forums. No flaming as such but some of the guys with the apparent knowledge to fix stuff seem more interested in telling users with legitimate problems to the read the manual than actually help 😦

  9. Mark, Usually I am a bit slow in responding to comments but your comment caught my eye. Yes, you are right to a degree. In the world of open source softwares, there is always this facet of the core developers being so busy that it will appear that no one wants to help you. This is the biggest catch of open source softwares — documentation and support is limited and so the people who trek the road of open source softwares must be ready to bear this ignominy, if it may be called so. BUT, we can do away with it by sharing knowledge and our experiences through blogs or websites. I had thought of launching opensourceexperiments.com with this thought.. — it would be a community where people could share their experiences freely and supplement the mailing lists or forums etc. Anyways, thanks for your comments and Please carry the torch forward by sharing your experiences if you can.

  10. FINALLY!!! Thank you for providing some information that actually works! Nowhere else that I’ve found did anyone’s advice worked, but this article did 🙂

  11. Hi!

    WHAT A GREAT POST!
    Finally I am able to create development servers in VirtualBox and use the host system to access them. I can even map shares from the win2003 server (guest) in my host (win xp) system.
    Great post and I think that this should be part of the official VirtualBox documentation.

  12. Great Post- I had struggled with getting a XP guest OS working in my Vista box. Looked at the VirtualBox documentation and no help. I saw the promiscuous notes, but hadn’t found what that meant yet or how to set it in Vista. I am pretty sure you have saved me many hours of searching. More importantly, you saved my computer from a sledgehammer.

  13. THANK YOU!! This was the information I needed to finally get my Ubuntu guest visible on the network. XP Host, Ubuntu guest, so slightly different configuration, but the bit about how to configure the adapter and bridge was exactly what I’d been missing. WOO HOO!!!

  14. Great Tutorial! Helped me a lot.
    I used this case to help me configuring my network between a win xp host and win server 2003 as guest.
    I own you a beer!

  15. Telling users to disable UAC is not responsible. UAC increases security of Windows.

  16. Hi Ryan, If we are able to find a way to make it work without disabling UAC, that would be a good learning. Please post it, if you have discovered te same. –Thanks, Gaurav

  17. Thanks a lot man, I was in a hurry and your post saved me a lot of time!

  18. Hi Gaurav,
    I spent a full day to find the way to bridge a wireless connection with my Virtual Box adapter! Thank you so much!!

  19. Thanks for the posting. Worked like a charm.
    – Pete

  20. thanks gaurav for this detailed howto, it worked superb. until today 🙂
    i updated to virtualbox 2.1.2 on my vista host. after that, id did not work anymore. virtualbox complained that it can’t find the virtualbox hostinterface.
    tap-interfaces and bridges are no longer required since taht update. you can directly use the network interfaces of the host as host-interface for the guest.

  21. Nice article – thanks for the tips.

    Being a newbie to VM’s, this is usually indeed, and you have presented your article in a very clear fashion.

  22. Very detailed … and very easy to follow. I’m tackling the same situation on my server but are working with an openSuse host and a RedHat, Windows2008, and Windows XP virtual machines do you know of any good post that can take me through accomplishing this?

    I need the virtual machines to talk to each other and for the host to be able to talk to any of the virtual machines as well as give internet access to both the host and virtual machines. The tricky part is that I need to run all the nics (both the host and virtual machine nics) on static IP addresses

    I’ve looked but I haven’t been able to find anything that works yet. Can you help me out?

  23. Hi all, I’m using VirtualBox 2.1.4, it’s different from the one of this post and maybe I’ll save someone’s time with this.

    I have a Ubuntu Server 8.10 in a VM, and a windows XP as host, and I couldn’t find a way to make them see each other in the network. My server has an apache-php-mysql installation, and my objective was to access it from the host machine, for example, open my browser, write http://guest-server-ip-address and see the apache welcome page.

    well… After several tries, reading docs, etc with no luck, i tried “brute force” option. I enabled the 4 network adapters from the VirtualBox GUI. each with the different card types (PCFast, intel PRO, etc). all four using the “Host interface”.

    Then edited the interfaces file: sudo vim /etc/network/interfaces

    and started testing different network devices (eth0, eth1, eth2….)

    until this gave me a result (just add this to the end of the file):

    auto eth1
    iface eth1 inet dhcp

    then typed in the console:
    sudo /etc/init.d/networking restart

    and it found my wireless lan… after that, I needed a static IP address, so I edited the interfaces, here’s the result:

    auto eth1
    iface eth1 inet static
    address 192.168.1.11 #Choose this ip
    netmask 255.255.255.0
    network 192.168.1.0 #again, for your ip
    broadcast 192.168.1.255
    gateway 192.168.1.1 #your wireless router ip

    Saved the changes, restarted the network, and got what i wanted :P, now if I type http://192.168.1.11 I can see the apache welcome page.

    HOPE THIS HELPS!!!

  24. […] Virtualbox Case Study: Making host only networking work between two Ubuntu Guest OS (virtual machine… (tags: windows vista sysadmin virtualization vi virtualbox bridge networking linux vmware ubuntu) […]

  25. Nice article.

    I having problems with my setup, which is different to the articles. Hope someone can help.

    Host – windows xp home edition
    VM – Centos 5

    installed on a dell inspiron 6400. Internet connection for both host and vm is through wireless network.

    I can connect to the internet from both vm and host..

    My problem is that i cannot ping the VM from host or ping the host from VM.

    Cheers for any help!!

  26. Dun, you may be required to open the ports in VM (centos) and allow the firewall in XP.

  27. how to make it realized on linux???
    in my case:

    #host:
    debian

    #guest:
    ubuntu.1
    ubuntu.2
    ubuntu.3
    ubuntu.4

  28. […] una solución por internet, pero no me resolvió el problema. No analizé mucho el porqué ni como debia solucionarlo, pero en […]

  29. Gaurag,

    Excellent article. Thanks a lot.
    I have a question, recently Imoved from VMWare to Virtualbox, I’m now creating an Oracle cluster, and found that I cannot mount the same disks on 2 virtual machines, on VMWare there are some configuration steps to do that, is that possible on virtualbox?

    Thanks,

    Alejandro

  30. […] Virtualbox Case Study: Making host only networking work between two Ubuntu Guest OS (virtual machin… […]

  31. Hi,

    great instruction. I although have a new poblem when I do this solution.

    HOST = Vista
    Guest = Ubuntu 9.04

    when apply the solution, i receive the IP address thru the DHCP and can see the router. Can also interact with all -behind router – devices. BUT can not browes the internet or after router network!!

    Indeed it could be a router problem, but my host has no issues going to internet and after router network!!!

    Please help.

    thanks

    R

  32. Fantastic, started using Sun VB today. Zero experience with this, but your consise tut got it working for me in mere seconds. You rock!

  33. Hi Gaurav,

    Excellent article. Thanks a lot.
    This is really very helpful for my new setup…

    Thanks,
    Nagababu

  34. What is the Virtualbox Network Adapter configuration for gsm mobile edge network.I am using Aircel (iNDIA) but failed to connect internet in Virtualbox machine ubuntu 9.04. Please help.

  35. 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.

  36. Good! A crowd who knows about Virtualization (using VirtualBox) and networking.

    I have Virtual Machine running Window XP Pro 32bit on a host: Windows 7 Pro 64bit.

    I need this Virtual Machine to use and publish the actual MAC address of the NIC that’s installed in my host machine. It’s a second card, not used by my host machine. The virtual machine seems to report a made-up MAC. The software I’m trying to run checks the MAC of the NIC for which the software is licensed for. If it’s not the actuall MAC of that NIC, it won’t run.

    Help!!!!

    Thanks,
    Ty

    • Sorry, Ty. I dont know the answer to this one, but i think you can tamper with the /etc/sysconfig/network files for changing the MAC address of the network interface and see if that works.

  37. What if the host is an ubuntu machine?
    How to do the “bridging” there?

    1000Thnx

  38. Thank you so much. It works now !!!!

  39. Hello Sir,

    I did exactly the steps you mentioned.
    I have Vista host and SUSe 11.2 in VirtualBox.

    After bridging I got an ip 192.168.56.104 and I assigned IP of 192.168.56.10 to SUSE 11.2

    It pings both the ways from Vista to SUSE and vice-versa.

    But the problem is putty client cannot connect from Vista to VirtualBox. It says “Connection Timed out”. What may be the problem?

    Also I have disabled firewall in Vista

    Please Help Me

    • Sorry I figured it out. It was problem with SUSE firewall. I added Secure SHELL server to firewall and putty client started working like charm. Thanks for such great article

      Regards
      Nanda

  40. I tried to setup the vbox by following the sample but could not make it work. Host is vista and guest is Suse. Wireless router. First issue is after bridge and enable the both api, the internet connction lost. I have to use cable connection to get on internet from host side.
    The other issue is ping from guest side is still “destination host unreachable”.
    Host static IP address 192.168.0.101. Gateway 192.168.0.1, DNS is 4.2.2.2. Gateway and DNS is fixed by wireless router. I do not how to control with IP address of Vbox (Host) on vistal side but it will not be same as IP address on Suse side. I have set up static address on suse side and setup forwarding to Host IP address and default gateway as same as 192.168.0.1. It might to do the bridge ipaddress? Could any tell what should I do to fix that kind issue.

    Thanks.

  41. This article is quite a bit out-of date. This was written around the time VirtualBox 1.6 came out. VirtualBox 2.1 introduced a driver interface for host systems. With 3.1.6, you now have “Host-Only” and “Bridged.” For what this article is trying to accomplish, Bridged is what you want.

  42. Hello,

    I have installed virtual box in my HP laptop and i lost my wireless internet connection as well as LAN also, is anyone one can help me out,

    Help will be appreciated

    Thanks
    Yogesh

  43. Wondering how to put an 192.168.2.2 /24 to an interface, point its gateway to 192.168.0.1 and you did it work

  44. I guess you don’t realize it, but all that effort you went to is effectively the same as just using ‘bridged’ networking in VirtualBox rather than setting up a bunch of host and virtual adapters then bridging them.

    Theres no need for any of this, just use bridged in the first place and you accomplish the exact same thing.

  45. gr8 Gaurav, nice work !!

  46. we like Centos, this Good OS system

  47. Can anyone tell me how to connect virtual machines in vmware workstation using network.

    My query is:

    On vmware workstation i made two virtual machines of redhat linux and install oracle 11g both on them.

    Now i want to work on both virtual machines as Server and Client.

    My question is how i can connect to server from client, there should be a connection to a server with the help of network in between two machines.

    If anyone having the idea how to do it please let me know with step by step how to configure it.

    the purpose to do this is: On server there will be a listener.ora file who listens the request from a client with the help of tnsnames.ora.

    I want know how to make connection in both of this on linux operating system. please reply me if anyone nows

    Please let me know on my email address: aijaz5k@yahoo.com

    best regards,

  48. I am using virtual box.
    Host OS: Vista SP1 and Guest OS : WinXP SP2

    I have installed some application server in both and want to connect/call the application from host to guest and vice versa. Like giving a request URL(http:///application from guest and vice versa) in browser by mentioning

  49. Great!!!!!

  50. The article is good to understand for novice user

  51. hi mate,,,

    host – windows xp

    guest – windows xp client 1
    guest – windows xp client 2

    how connect the 2 guest os to host os ….

    how to rename virtual network interface

Leave a reply to Alyx Cancel reply