S
S
soif2012-12-23 05:23:09
linux
soif, 2012-12-23 05:23:09

How to send http request from main OS to guest virtual server?

The main OS is windows 7, Ubuntu Server is installed on the Virtual Box, how to send an HTTP request from the browser to win7 to localhost Ubuntu Server?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
M
mastini, 2012-12-23
@mastini

why on localhost? why not by IP Ubuntu Server'a?
You can go north through the putty tunnel :)

K
KEKSOV, 2012-12-23
@KEKSOV

You need to:
1. Find out the IP address of the virtual machine
2. View the parameter in the web server config under ubuntu that is responsible for the interfaces on which the server receives packets. If it says 127.0.0.1, then you need to write 0.0.0.0 and restart the web server
3. In the browser, just type the IP of the virtual machine from step 1

L
lubezniy, 2012-12-23
@lubezniy

1. In the properties of the network adapter on the virtual machine, set the port forwarding rule from any unoccupied port of the real machine to port 80 of the virtual machine (the default IP address assigned by DHCP is 10.0.2.15 for the virtual machine).
2. Make a request to a given port of a real machine.
I have it written: redirect a request from 192.168.56.1:8080 to 10.0.2.15:80 (port 80 is busy on a real machine). In the browser I type 192.168.56.1:8080 . 192.168.56.1 is the default address of the Virtualbox Host-only network. If you need access from the outside, instead of 192.168.56.1, the address of the network interface through which you want to open access is set.

N
nonname, 2012-12-23
@nonname

You have some strange answers here. In the properties of the virtual machine in the network section, there is a choice of the interface operation mode. The default is NAT in the latest versions, I could not access from the host to the guest using these ip. Therefore, you should most likely switch to the “Network Bridge” operating mode by setting ip to the network adapter to which we are making a bridge and set the guest ip from the same subnet, this will be a normal network. How to set up a network in Ubuntu was written a little higher.

O
OnYourLips, 2012-12-23
@OnYourLips

open sudo vim /etc/network/interfaces and set the static IP
iface eth0 inet static
address 192.168.164.100
netmask 255.255.255.0
network 192.168.164.0
broadcast 192.168.164.255
gateway 192.168.164.2
dns-nameservers 192.164.12

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question