VirtualBox guest machine as a nginx host

Marcin

I have VirtualBox 4.3.12 with Fedora 20 and nginx 1.4.7 installed. Machine has Bridged Network interface and pings can be done both ways: from host machine (Windows 7) using

ping 192.168.0.15 (virtual machine's ip address)

and from guest machine

ping 192.168.0.10 (host machine ip address)

but what i can't do is access guest machine's nginx from host machine. I have read this and this and have done as those articles / previously asked question told me to, but i still can't manage to view nginx site from host machine.

netstat -tnlp returns:

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN        930/nginx: master p 
user3188324

When I did:

iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT

I got an error of:

iptables: Index of insertion too big.

The reason is that I do not have any policies in place and so the "INPUT 4" part is trying to insert at index 4 when it should be index = 1. To view your rules do:

sudo iptables --list-rules

Then insert at the appropriate index. (In most cases):

sudo iptables -I INPUT 1 -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT

This finally got it to work!

  • My virtualbox settings are:

    • host port 8080,
    • guest IP 10.0.2.15
    • guest port 80

nginx conf file is:

server {
  listen 0.0.0.0:80;

  location / {
      proxy_pass http://localhost:9000;
      }
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Connect to the host machine from a VirtualBox guest OS?

From Dev

SSH to the Ubuntu host machine from a Ubuntu VirtualBox guest?

From Dev

Oracle VirtualBox - Host machine crashes when booting guest for installation

From Dev

VirtualBox Host ssh to Guest

From Dev

No route to host. How to SSH from guest machine in virtualbox to host machine by bridged adapter?

From Dev

No route to host. How to SSH from guest machine in virtualbox to host machine by bridged adapter?

From Dev

Virtualbox Guest Additions Requires Virtualbox on Guest Machine?

From Dev

In VirtualBox Ubuntu on Windows host can I specify that the Ubuntu guest uses the same MAC address as the host machine?

From Dev

SSH from host machine Win7 to guest Fedora Machine in VirtualBox

From Dev

Virtualbox guest additions on Ubuntu host and Manjaro guest

From Dev

Sharing between Host and Guest in Virtualbox

From Dev

Sharing between Host and Guest in Virtualbox

From Dev

Virtualbox host and guest OS interaction

From Dev

Installed Virtualbox guest additions on host

From Dev

Installed Virtualbox guest additions on host

From Dev

Keystrokes are not grabbed by VirtualBox on guest machine

From Dev

Enable ssh host to guest & guest Internet on CentOS 7 guest with VirtualBox

From Dev

VirtualBox: MacOS host cannot connect to guest, but guest can connect to host

From Java

How to SSH to a VirtualBox guest externally through a host?

From Dev

Network with virtualbox (OS X host/Fedora guest)

From Dev

VirtualBox: How to sync host and guest time?

From Dev

Use VirtualBox to access site on host from guest?

From Dev

Share VirtualBox folders in reverse? Guest-Host?

From Dev

Sharing existing ubuntu folder on host guest with Virtualbox

From Dev

Mac OS X as guest on VirtualBox with Ubuntu Host?

From Dev

Transfer image clipboard between host and VirtualBox guest?

From Dev

Virtualbox vagrant guest can not use host DNS

From Dev

Accessing VPN host by name from VirtualBox guest

From Dev

Flickering of Fedora 27 guest in VirtualBox on OSX host

Related Related

  1. 1

    Connect to the host machine from a VirtualBox guest OS?

  2. 2

    SSH to the Ubuntu host machine from a Ubuntu VirtualBox guest?

  3. 3

    Oracle VirtualBox - Host machine crashes when booting guest for installation

  4. 4

    VirtualBox Host ssh to Guest

  5. 5

    No route to host. How to SSH from guest machine in virtualbox to host machine by bridged adapter?

  6. 6

    No route to host. How to SSH from guest machine in virtualbox to host machine by bridged adapter?

  7. 7

    Virtualbox Guest Additions Requires Virtualbox on Guest Machine?

  8. 8

    In VirtualBox Ubuntu on Windows host can I specify that the Ubuntu guest uses the same MAC address as the host machine?

  9. 9

    SSH from host machine Win7 to guest Fedora Machine in VirtualBox

  10. 10

    Virtualbox guest additions on Ubuntu host and Manjaro guest

  11. 11

    Sharing between Host and Guest in Virtualbox

  12. 12

    Sharing between Host and Guest in Virtualbox

  13. 13

    Virtualbox host and guest OS interaction

  14. 14

    Installed Virtualbox guest additions on host

  15. 15

    Installed Virtualbox guest additions on host

  16. 16

    Keystrokes are not grabbed by VirtualBox on guest machine

  17. 17

    Enable ssh host to guest & guest Internet on CentOS 7 guest with VirtualBox

  18. 18

    VirtualBox: MacOS host cannot connect to guest, but guest can connect to host

  19. 19

    How to SSH to a VirtualBox guest externally through a host?

  20. 20

    Network with virtualbox (OS X host/Fedora guest)

  21. 21

    VirtualBox: How to sync host and guest time?

  22. 22

    Use VirtualBox to access site on host from guest?

  23. 23

    Share VirtualBox folders in reverse? Guest-Host?

  24. 24

    Sharing existing ubuntu folder on host guest with Virtualbox

  25. 25

    Mac OS X as guest on VirtualBox with Ubuntu Host?

  26. 26

    Transfer image clipboard between host and VirtualBox guest?

  27. 27

    Virtualbox vagrant guest can not use host DNS

  28. 28

    Accessing VPN host by name from VirtualBox guest

  29. 29

    Flickering of Fedora 27 guest in VirtualBox on OSX host

HotTag

Archive