Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
166
rated 0 times [  166] [ 0]  / answers: 1 / hits: 360370  / 2 Years ago, mon, september 12, 2022, 2:44:11

I installed Apache on an Ubuntu VM. When I go into the guest and load up Firefox I can see that Apache is working fine when I browse to localhost.



I would like to access this same page through the host. I've tried using the IP address of the guest but nothing comes up.

Ideally I would love to set up my Windows 7 (host) to request http://guestserver.com of the Apache server on the guest. How can I do this?


More From » virtualbox

 Answers
5

If you need other machines in your physical network to be able to reach your VM (or if the VM needs Internet access), use bridged networking. Otherwise, stick to host-only networking.




  1. Stop your VM and open its settings in the VirtualBox (OSE) Manager

  2. Go to the Network tab

  3. Select the network mode at your choice (bridged networking or host-only) (in the below example, I'm using host-only)



    If you want to use bridged networking, you've to select the right network adapter at Name. For wired connections, you'd select something named like eth0. Wireless connections are usually named wlan0 (the numbers may vary)


  4. Save the settings

  5. Start the Ubuntu VM

  6. When up, you can gather the IP address by running:



    ifconfig | grep addr


    In the below output, 192.168.56.101 is the IP address that can be used in your Win7 host system to access your VM:



    eth0  Link encap:Ethernet  HWaddr 08:00:27:70:27:fe  
    inet addr:192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255.0
    inet6 addr: fe80::a00:27ff:fe7b:25fe/64 Scope:Link
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host

  7. In your windows host system, edit C:WindowsSystem32driversetchosts as administrator and add a line:



    192.168.56.101   guestserver.com


    If you've a Ubuntu host system, edit /etc/hosts using sudo nano /etc/hosts


  8. Profit!


[#44311] Tuesday, September 13, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
umplegitimat

Total Points: 137
Total Questions: 126
Total Answers: 118

Location: Saint Pierre and Miquelon
Member since Sat, Aug 21, 2021
3 Years ago
;