[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

qemu port forward host -> guest: unable to get network access



Hi,

I want to start a virtual machine and be able to connect to it from the host. Reading the qemu manual, I found I have to use "-net nic" to choose both NIC MAC and model and "-net user" in order to define port forwards from host to guest.

I want to forward ports (tcp) this way:
  host:2564 -> guest:564
  host:2567 -> guest:567

I have a real DHCP server on the network and have associated mac=00:aa:bb:cc:dd:ee:ff to IP 192.168.0.96. I'd like the guest to ask the real DHCP server to get its IP (192.168.0.96). Now, I'm missing something because things do not work at all and I don't know how to tell qemu to use the real DHCP instead of its built-in one. The guest doesn't have network access with:

  qemu -k fr -m 1G -vga std -hda plan9.disk -hdb venti.disk \
       -net nic,macaddr=00:aa:bb:cc:dd:ee:ff,model=rtl8139 \
       -net user,hostfwd=tcp::2564-192.168.0.96:564, \
                 hostfwd=tcp::2567-192.168.0.96:567

Can I use the real DCHP this way or do I have to set up a tap device? This is kown to require qemu to run as root/sudo, sounds ugly to me.

Thanks for your welcoming advices,
Nicolas


Reply to: