问题描述:

I got a ubuntu installed on virtual box, I run a server on it.

I can access it through 127.0.0.1

But from outside system, I can't get the web service.

I used ifconfig command in that Ubuntu system.

In the eth0 blank, I saw two other ip: 10.0.2.15, 10.0.2.255

I tried both of them, and still can't work.

I'm using VirtualBox software.

How could I access that local host of virtual Ubuntu in my outside system?

网友答案:

Read the VirtualBox manual :p.. You need to do some port forwarding. Most likely port 22 for ssh and you can tunnel the rest.. Oh, http is port 80, if you didn't already know that. On my "fresh" server vms all i need to do is VBoxManage modifyvm "VM name" --natpf1 "http,tcp,,80,,80" (NAT - if you're using Bridged, it shouldn't be an issue) and i can access the webserver on localhost:80 form the host machine. Make sure nothing else is taking up 80 (Skype, etc.), of course.

相关阅读:
Top