You are not logged in.

#1 2012-01-09 04:42:40

mrtvt
Member
Registered: 2012-01-09
Posts: 1

Opening ports so virtualbox can provide a service

Hi all . . . I want to open up ports 80 and 443 on an Arch box. Arch seems to open needed ports automagically if a service is installed, but I want to open them without installing a service behind them.

The reason is that I want VirtualBox to run the web server, and set up VirtualBox's internal NAT feature to map from ports 80 and 443 on the Arch host to the same ports on the virtual server. I've been able to do this using other distros for the host, so it can be done (and rather easily too). In Arch, a browser on a remote machine was unable to get a response from the VirtualBox web server, although ssh on the remote machine worked fine (I have sshd running on the Arch host).

I tried setting up iptables according to the article "Simple Stateful Firewall" (https://wiki.archlinux.org/index.php/Si … l_Firewall) and opening up ports 80 and 443. No joy, although 'iptables -L' incremented the accepted packet count on the TCP and UDP chains whenever I tried hitting the web server from a remote machine. So, it seems that there is some mechanism other than the firewall, and linked to Arch's daemon handling, that opens and closes ports.

How can I get to it? I'm suspecting I need some kind of rc.d script that emulates what starting a daemon would do to ports, but without actually starting a daemon. Am I close? Any help is appreciated.

Offline

#2 2012-01-09 05:08:56

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,696

Re: Opening ports so virtualbox can provide a service

Well, that is not quite how to go about it.

You've two choices. 

First, you can configure your VirtualBox network as a bridged network.  In this case, the virtual machine will appear two have its own IP address with access to all of the ports on "Its" IP.
Second, you can configure your VirtualBox as a NAT network.  If you do that, go to the advanced setup in the NAT in the VirualBox network setup for your VM and forward the ports you want to dedicate to the VM.  When the VM is running, those ports will be forwarded to the VM.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB