Results 1 to 5 of 5

Thread: Access VirtualBox guest from firefox host

  1. #1
    Join Date
    Sep 2012
    Beans
    7

    Arrow Access VirtualBox guest from firefox host

    Hi,

    I have an Ubuntu 12.04 server machine on Virtualbox , hosted on Xubuntu 12.04 .

    I'm trying to access Apache from Firefox. I tried following:

    On host:
    >ifconfig

    inet addr: 10.0.2.15
    On Virtualbox:
    file > preferences > network > new host-only network
    ipv4adress is: 192.168.56.1
    on the machine, settings > network > adapter 2 > "Host-only adapter"

    On Xubuntu host:
    >sudo nano /etc/hosts
    10.0.2.15 example.local

    In Firefox, I try to go to "10.0.2.15", and after some time, I get a "Server not found". I tried also "http://192.168.56.1" and "example.local"

    I tried also:
    on the machine, settings > network > adapter 2 > "Bridged adapter" (eth0).

    I disabled firewall on both host and guest using:

    $ sudo iptables -X
    $ sudo iptables -t nat -F
    $ sudo iptables -t nat -X
    $ sudo iptables -t mangle -F
    $ sudo iptables -t mangle -X
    $ sudo iptables -P INPUT ACCEPT
    $ sudo iptables -P FORWARD ACCEPT
    $ sudo iptables -P OUTPUT ACCEPT

    and

    $ sudo ufw disable

    I can access Internet from host and guest.

    Thanks for your help!
    Last edited by mrwebmaster; September 12th, 2012 at 05:14 PM. Reason: added more info

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Access VirtualBox guest from firefox host

    Just set the network adapter to bridged and access it via the IP the guest gets.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Sep 2012
    Beans
    7

    Re: Access VirtualBox guest from firefox host

    Thanks, I've already tried that

    settings > network > adapter 2 > "Bridged adapter" (eth0).

  4. #4
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Access VirtualBox guest from firefox host

    Check ifconfig again, a 10.0.2.15 IP is associated with NAT, not bridged.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  5. #5
    Join Date
    Sep 2012
    Beans
    7

    Re: Access VirtualBox guest from firefox host

    Thanks, it's working now. The trick was putting the bridged in the first position, and NAT in the second.

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
  •