Page 1 of 15 12311 ... LastLast
Results 1 to 10 of 150

Thread: HOWTO VirtualBox Host networking

  1. #1
    Join Date
    May 2005
    Beans
    68

    HOWTO VirtualBox Host networking

    Edit bodhi.zazen : With the most recent version of Virtualbox, 2.1.0, this entire thread is out dated.

    It may take a while for the Ubuntu repo (OSE) edition to catch up.

    With VirtualBox 2.1.0 you simply select host networking and select your network card (eth0 , wlan0, etc) from the pull down list.

    No need to manually bridge your network card, no need for a tap, although you can use these devices if you wish.

    See the VirtualBox users Guide for details.

    http://download.virtualbox.org/virtu...UserManual.pdf



    =====================

    I started messing around with this stuff (Virtualbox.org) a couple of weeks ago just like everyone else, frantically searching for how to uninstall it (http://www.virtualbox.org/wiki/User_FAQ) when it broke my laptop

    But the last several days, off and on, I have had it running and wanted to get out of the NAT mode of operation. I looked hard at this doc
    HTML Code:
    https://help.ubuntu.com/community/VirtualBox#head-ac88c03223e773c78dbb46b4b13c109de1143a03
    But for me, there were a couple of commands missing, as I followed this doc to a tee! (Great doc, you should start there!) So when I finally saw my virtual w2k machine boot and get an ip from my local dhcp server, I thought, I HAVE to put all of this down here in the forum. So here are the commands ripped right out of my HISTORY.

    Some things to make this easier to read. My eth0 on my host is 192.168.0.45. My tap0 is going to get 192.168.0.94 (totally arbitrary.. ping it first, just to make sure it isn't in use). The "user" in the first command is the user you login with.

    Code:
    sudo tunctl -t tap0 -u user
    sudo chmod 666 /dev/net/tun
    sudo /usr/sbin/brctl addbr br0
    sudo /sbin/ifconfig eth0 0.0.0.0 promisc
    sudo /usr/sbin/brctl addif br0 eth0
    sudo /sbin/dhclient br0
    sudo /usr/sbin/brctl addif br0 tap0
    sudo ifconfig tap0 192.168.0.94 up
    sudo bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp'
    sudo route add -host 192.168.0.45 dev tap0
    sudo arp -Ds 192.168.0.45 eth0 pub
    Those first 7 commands are from the help.ubuntu.com page I listed above (bottom of that page.. long page.. but good!). The rest of the commands are actually in the man page for 'tunctl' (man tunctl at a prompt). I just stumbled on them because the first 7 commands alone were NOT doing it for me (Dapper).

    Add tap0 into the Interface name under
    Virtual machine/Network Tab/Adapter 0

    Save and start machine.

    And on a personal note... I am an old Novell guy (some say that is like being a Jedi these days).. then an old Microsoft guy (have to pay the bills), then an old Cisco guy.. but the last couple of years have been RH, SuSE.. then I found Debian, and now this. Been running it as the only OS in the house for about 18 months... THAT is the real reason I wrote this.. I have to give something back to this incredible community!!

    Thanks!!
    Last edited by bodhi.zazen; December 21st, 2008 at 05:14 PM.

  2. #2
    Join Date
    Nov 2006
    Location
    Switzerland
    Beans
    416

    Re: HOWTO VirtualBox Host networking

    Hi,

    thanks for these infos!!! I have been looking for this for a long time. I'm trying to setup VirtualBox with 2X Application Server to publish Windows-only applications directly from Ubuntu. However I've not been able to achieve this yet. I need to build a host interface so I followed your directions (I chose the same IP address for tap= as you but my host IP is 192.168.112.200). I installed 2X Application Server in Windows (guest) and in Linux (host) as described here:

    http://searchopensource.techtarget.c...238129,00.html

    I tried to publish Internet Explorer as a test. I published it as "IEXPLORE" in Windows. So from Linux the following command should launch it:

    ./appserverclient –s192.168.0.94 –ukilou –a"IEXPLORE"

    I'm not sure if I type this command correctly or if the host interface is not working. Do you know anything about that?

    Thanks


    PS: also what are the benefits of Host interface over NAT in general? I'm a newbie in both Ubuntu and networking and do not understand this clearly.
    Last edited by kilou; January 26th, 2007 at 09:17 AM.

  3. #3
    Join Date
    May 2005
    Beans
    68

    Re: HOWTO VirtualBox Host networking

    Main difference for me between the NAT and Host is testing. When the virtual machines are NAT'd, I can't get to them from my host. So for App testing and Active Directory Domain testing on other windows Virtuals, it doesn't work well.

    I have messed with the 2x stuff for the last 3 months. I really like the concept, but I can't get it to work two times in a row! At one point, I knew I had everything set up correctly, so I actually contacted their support (which was decent). They rdp'd into my house and set it up for me. Nice, but it didn't really help me do it the next time (which didn't work). The next time I went through the same thing, I asked them what I was doing wrong.. they told me to publish more than one app... that sometimes that causes it to not work.

    I don't know, great stuff when it works, but I wouldn't put it in at any of my customers. And I use things like Samba/Squid/DansGuardian all the time.. so complexity shouldn't be a problem I just don't think their stuff is ready for prime time.. yet!

    EDIT: I just re-read your post.. I don't think your tap interface can be the same as mine with your host being on the 192.168.112.0 subnet... not without some extra route statements.

  4. #4
    Join Date
    Aug 2005
    Beans
    1,089

    Re: HOWTO VirtualBox Host networking

    Whats the main advantages of VirtualBox compared to VMWare ?
    Software you want - www.getdeb.net

  5. #5
    Join Date
    Nov 2006
    Location
    Switzerland
    Beans
    416

    Re: HOWTO VirtualBox Host networking

    VirtualBox is GPL now and also people seem to review it as being slightly faster than VMWare Server (but there are mixed opionion about it). I tried both and I think I like VirtualBox better. I'm not sure but VB may have USB2 support while VMWare is only USB1.1. I'm really not sure about it but when I connect my USB stick in XP with VMWare, I get a message that says it is plugged in a USB1 port. Doing the same with VirtualBox doesn't bring any message....but the use of USB devices with VB is also a bit more tricky sometimes. Also I like the fact that the mouse cursor is automatically captured in the Virtual Machines and is released when you go out of the screen. Sometime you still need to release it with a key but overall it works quite well. Probably that for a serious user VMWare (Workstation and not Server) may be more adequate but VirtualBox has all the features I need and it is free (VMWare Server is free as well but not the Workstation). Just try both and decide which one suits you best.

    I'm really wanting to try out this 2x Application software with VirtualBox but cannot achieve to do it. I'm sure I'm doing something wrong but I just don't know what. I could get Internet to work in the Virtual Machine with host interface so this part must be OK thanks to ipguru99. However I must still be doing something wrong with the IP. I reconfigured the IP of the virtual machine with sudo ifconfig tap0 192.168.112.87 up (my host is 192.168.112.200) but when I type ipconfig in XP I get IP 192.168.112.203. I then tried to give these 2 IPs for applicationserver command but none was able to launch internet explorer (the application I'm publishing from XP to Ubuntu).

  6. #6
    Join Date
    Aug 2005
    Beans
    1,089

    Re: HOWTO VirtualBox Host networking

    Thanks for the info

    Please note that the VirtualBox versions available for download are not GPL, you would need to build it from the source.
    Software you want - www.getdeb.net

  7. #7
    Join Date
    Jan 2007
    Beans
    24

    Re: HOWTO VirtualBox Host networking

    Quote Originally Posted by ipguru99 View Post

    Code:
    sudo tunctl -t tap0 -u user
    sudo chmod 666 /dev/net/tun
    sudo /usr/sbin/brctl addbr br0
    sudo /sbin/ifconfig eth0 0.0.0.0 promisc
    sudo /usr/sbin/brctl addif br0 eth0
    sudo /sbin/dhclient br0
    sudo /usr/sbin/brctl addif br0 tap0
    sudo ifconfig tap0 192.168.0.94 up
    sudo bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp'
    sudo route add -host 192.168.0.45 dev tap0
    sudo arp -Ds 192.168.0.45 eth0 pub
    Add tap0 into the Interface name under
    Virtual machine/Network Tab/Adapter 0
    Sweet! Thanks you solved my problem. So If I want to run multiple virtual guest I need to create a new tap device for each one. like tap2 tap3.......

  8. #8

    Re: HOWTO VirtualBox Host networking

    You don't need to make a new bridge for each tap device, do you? I need to know this because I'm making a script to automate all this for you guys.
    Every normal man must be tempted, at times, to spit on his hands, hoist the black flag, and begin slitting throats. ~H.L. Mencken

  9. #9
    Join Date
    Dec 2006
    Beans
    6
    Distro
    Ubuntu 6.10 Edgy

    Re: HOWTO VirtualBox Host networking

    Awesome!!! I'm looking forward to it! Thank you very much!

  10. #10
    Join Date
    May 2005
    Beans
    68

    Re: HOWTO VirtualBox Host networking

    I have no idea how many tap's you need.. I am going to check on that tonight. I want to keep working on the 2X thing.. and the SAMBA 4 stuff.. which scares the crap out of me because they keep saying it will eat my cat! I will report back here as to whether or not you need a tap per vm

Page 1 of 15 12311 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •