# Running a webserver inside QEMU

## bastibasti

Hi,

I have a webserver running inside a qemu (its a small 2mb distro with nothing else than the kernel+webserver, readonly root) box on my home server. Its really quick, even though my cpu does not support KVM. Now I wonder how I can forward only port 80 of eth0 to the qemu box, so the qemu box acts like an installed http server??

----------

## chithanh

If you use the user mode networking stack, then the -redir option will redirect ports from the host to the guest.

----------

## Hu

If you do not use the user mode networking stack, please post the command line you used so that we can understand how the guest is connected to the network.

----------

## bastibasti

At the moment Iam using 

```
qemu -cdrom fli4l.iso fli4l_hda.img -boot d -m 128 -nographic -net nic -net user -redir tcp:80:10.0.2.15:80

```

to boot the machine. I cannot get it going somehow..

----------

## Hu

Are you starting qemu as root?  You asked it to forward a privileged port, so it needs to be root to bind port 80 on the host.

----------

