Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using virtualbox 4.1.16 on a Ubuntu 12.04 x64 vm host and all NAT is working properly, like HOST 2222 -> Client 22

But I have changed my HOST sshd to listen on port 81 and restarted, so host port 22 is free. and order my guest vm to do a NAT (HOST)22 to (CLIENT)22. while the same vm guest, if I map NAT 1234 to 22, it works again.

I have tried ufw disable, /etc/init.d/apparmor stop, nothing helps

Is there anything I need to do to make it happen?

share|improve this question
    
promblem remains but I have found a workaround by port forwarding using iptables iptables -t nat -A PREROUTING -i eth0 -p TCP --dport 22 -j REDIRECT --to-port 1234 –  c2h2 Jul 5 '12 at 7:04

1 Answer 1

This sounds like your VirtualBox process is not running with the right privileges allow it to bind to ports below 1024 - typically that requires root level permissions. According to the VirtualBox manual, there are four limitations to the NAT engine:

  • ICMP protocol limitations, ping works but a lot of things may have trouble
  • Receiving of UDP broadcasts is not reliable
  • Protocols such as GRE are unsupported
  • Forwarding host ports < 1024 impossible on Unix hosts like Linux, Solaris, Mac OS X without running as root.

Reference: http://www.virtualbox.org/manual/ch06.html#nat-limitations

The best workaround would be to configure your virtual machine to use a bridged virtual network adapter if that will work in your environment.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.